Skip to content

Commit

Permalink
minot clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel Tomin authored and Pavel Tomin committed Dec 20, 2024
1 parent 736cc7c commit 4691447
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,7 @@ void CompositionalMultiphaseBase::initializeFluidState( MeshLevel & mesh,
} );

// check if comp fractions need to be corrected to avoid zero diags etc
if( m_useZFormulation )
if( m_useZFormulation && m_allowCompDensChopping )
{
DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" );
chopNegativeCompFractions( domain );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -672,8 +672,6 @@ real64 CompositionalMultiphaseFVM::scalingForSystemSolutionZFormulation( DomainP
DofManager const & dofManager,
arrayView1d< real64 const > const & localSolution )
{
GEOS_MARK_FUNCTION;

string const dofKey = dofManager.getKey( viewKeyStruct::elemDofFieldString() );
real64 scalingFactor = 1.0;
real64 maxDeltaPres = 0.0, maxDeltaCompFrac = 0.0, maxDeltaTemp = 0.0;
Expand Down Expand Up @@ -954,8 +952,6 @@ void CompositionalMultiphaseFVM::applySystemSolution( DofManager const & dofMana
// if component density chopping is allowed, some component densities may be negative after the update
// these negative component densities are set to zero in this function

// TODO: implement chopNegativeZ

if( m_allowCompDensChopping )
{
if( m_useZFormulation )
Expand All @@ -968,15 +964,8 @@ void CompositionalMultiphaseFVM::applySystemSolution( DofManager const & dofMana
MeshLevel & mesh,
arrayView1d< string const > const & regionNames )
{
std::vector< string > fields{ fields::flow::pressure::key() };
if( m_useZFormulation )
{
fields.emplace_back( fields::flow::globalCompFraction::key() );
}
else
{
fields.emplace_back( fields::flow::globalCompDensity::key() );
}
std::vector< string > fields{ fields::flow::pressure::key(),
m_useZFormulation ? fields::flow::globalCompFraction::key() : fields::flow::globalCompDensity::key() };
if( m_isThermal )
{
fields.emplace_back( fields::flow::temperature::key() );
Expand All @@ -1001,22 +990,14 @@ void CompositionalMultiphaseFVM::updatePhaseMobility( ObjectManagerBase & dataGr

if( m_useZFormulation )
{
if( m_isThermal )
{
// For now: isothermal only
GEOS_ERROR_IF( m_isThermal, GEOS_FMT(
"{}: Z Formulation is currently not available for thermal simulations", getDataContext() ) );
}
else
{
isothermalCompositionalMultiphaseFVMKernels::
PhaseMobilityZFormulationKernelFactory::
createAndLaunch< parallelDevicePolicy<> >( m_numComponents,
m_numPhases,
dataGroup,
fluid,
relperm );
}
// For now: isothermal only
isothermalCompositionalMultiphaseFVMKernels::
PhaseMobilityZFormulationKernelFactory::
createAndLaunch< parallelDevicePolicy<> >( m_numComponents,
m_numPhases,
dataGroup,
fluid,
relperm );
}
else
{
Expand Down Expand Up @@ -1261,8 +1242,6 @@ void CompositionalMultiphaseFVM::applyFaceDirichletBC( real64 const time_n,

if( m_useZFormulation )
{
GEOS_ERROR_IF( m_isThermal, GEOS_FMT(
"{}: Z Formulation is currently not available for thermal simulations", getDataContext() ) );
isothermalCompositionalMultiphaseFVMKernels::
DirichletFluxComputeZFormulationKernelFactory::
createAndLaunch< parallelDevicePolicy<> >( m_numComponents,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class CompositionalMultiphaseFVM : public CompositionalMultiphaseBase
DofManager const & dofManager,
arrayView1d< real64 const > const & localSolution ) override;

virtual real64
real64
scalingForSystemSolutionZFormulation( DomainPartition & domain,
DofManager const & dofManager,
arrayView1d< real64 const > const & localSolution );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -509,17 +509,6 @@ real64 CompositionalMultiphaseHybridFVM::scalingForSystemSolution( DomainPartiti
return LvArray::math::max( MpiWrapper::min( scalingFactor ), m_minScalingFactor );
}

real64 CompositionalMultiphaseHybridFVM::scalingForSystemSolutionZFormulation( DomainPartition & domain,
DofManager const & dofManager,
arrayView1d< real64 const > const & localSolution )
{
GEOS_MARK_FUNCTION;
// z formulation not implemented
GEOS_UNUSED_VAR( domain, dofManager, localSolution );
GEOS_ERROR( "Z formulation not yet available for this flow solver" );
return 0;
}

bool CompositionalMultiphaseHybridFVM::checkSystemSolution( DomainPartition & domain,
DofManager const & dofManager,
arrayView1d< real64 const > const & localSolution,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,6 @@ class CompositionalMultiphaseHybridFVM : public CompositionalMultiphaseBase
DofManager const & dofManager,
arrayView1d< real64 const > const & localSolution ) override;

virtual real64
scalingForSystemSolutionZFormulation( DomainPartition & domain,
DofManager const & dofManager,
arrayView1d< real64 const > const & localSolution );

virtual bool
checkSystemSolution( DomainPartition & domain,
DofManager const & dofManager,
Expand Down

0 comments on commit 4691447

Please sign in to comment.