GEOS-DEV / GEOS

GEOS Simulation Framework
GNU Lesser General Public License v2.1
206 stars 83 forks source link

[Bug] Broken VTK output for Compositional Multiphase Flow/Well simulations #1112

Closed francoishamon closed 3 years ago

francoishamon commented 4 years ago

Describe the bug When trying to use the VTK output for a compositional simulation in the tutorials, I got the following error:

***** LOCATION: /g/g90/hamon1/geosx/GEOSX/src/coreComponents/fileIO/vtk/VTKPolyDataWriterInterface.cpp:442                                     
***** Controlling expression (should be false): true                                                                                           
***** ERROR                                                                                                                                    
***** LOCATION: /g/g90/hamon1/geosx/GEOSX/src/coreComponents/common/DataTypes.hpp:917                                                          
***** Controlling expression (should be false): true                                                                                           
***** Rank 0: TypeID not recognized.                                                                                                           

** StackTrace of 8 frames **                                                                                                                   
Frame 0: geosx::vtk::VTKPolyDataWriterInterface::WriteField(geosx::dataRepository::WrapperBase const&, vtkSmartPointer<geosx::vtk::VTKGEOSXDat\
a>, long, long&) const                                                                                                                         
Frame 1: void geosx::vtk::VTKPolyDataWriterInterface::WriteElementFields<geosx::CellElementSubRegion>(vtkSmartPointer<vtkCellData>, geosx::Ele\
mentRegionBase const&) const                                                                                                                   
Frame 2: geosx::vtk::VTKPolyDataWriterInterface::WriteCellElementRegions(double, geosx::ElementRegionManager const&, geosx::NodeManager const&\
) const                                                                                                                                        
Frame 3: geosx::vtk::VTKPolyDataWriterInterface::Write(double, int, geosx::DomainPartition const&)                                             
Frame 4: geosx::EventBase::Execute(double, double, int, int, double, geosx::dataRepository::Group*)                                            
Frame 5: geosx::EventManager::Run(geosx::dataRepository::Group*)                                                                               
Frame 6: main                                                                                                                                  
Frame 7: __libc_start_main                                                                                                                     
Frame 8:                                                                                                                                       
===== 

This happens when the VTK writer is trying to output an array4d< real64 > such as phaseCompFraction.

If I roll back one commit to go before PR #1106 (which fixed the allocation of the constitutive models), then the VTK writer does not try to output any of the MultiFluid properties and the VTK writer works.

To Reproduce Steps to reproduce the behavior:

  1. Modify a compositional integrated test to output with VTK
  2. Run the test

Expected behavior It should work, and preferably, output the constitutive properties.

Platform (please complete the following information):

Additional context

@AntoineMazuyer any ideas?

AntoineMazuyer commented 4 years ago

Yes it's a known issue. I'll take care of that

AntoineMazuyer commented 4 years ago

What is the plot level of such an array4d ?

AntoineMazuyer commented 4 years ago

@francoishamon did pr #1131 solved the problem ?

francoishamon commented 4 years ago

@AntoineMazuyer Yes it solved the problem in the sense that VTK is no longer trying to output the array4d that was causing the problem. Do you think there is a way to modify the VTK output so that it outputs this field (phaseCompFraction)? Silo can output this field so it would be nice to have it with VTK as well.

AntoineMazuyer commented 4 years ago

@francoishamon it's an array2d isn't it ?

AntoineMazuyer commented 4 years ago

I can see

./constitutive/fluid/MultiFluidBase.hpp:159: arraySlice2d< real64 > const & phaseCompFraction, when I grep but also ./constitutive/fluid/MultiFluidBase.hpp:277: arrayView4d< real64 const > const & phaseCompFraction() const { return m_phaseCompFraction;

francoishamon commented 4 years ago

The phaseCompFraction is an array4d with the following entries:

https://github.com/GEOSX/GEOSX/blob/33e1a8dd6525f22ac87a6d60fee9f385cb7d7a15/src/coreComponents/constitutive/fluid/MultiFluidBase.cpp#L116

and the arraySlice2d you saw is used for the point-wise update. For the Silo output, the function that takes care of outputting phaseCompFraction is: https://github.com/GEOSX/GEOSX/blob/33e1a8dd6525f22ac87a6d60fee9f385cb7d7a15/src/coreComponents/fileIO/silo/SiloFile.cpp#L965-L972

francoishamon commented 3 years ago

Solved by PR #1131. Thanks @af1990 !