Skip to content

Commit

Permalink
fix: Compositional flow kernels - split into separate files, bugfix f…
Browse files Browse the repository at this point in the history
…or gravity treatment in flux for thermal (#3374)
  • Loading branch information
paveltomin authored Nov 11, 2024
1 parent c70e8c0 commit 3b0d907
Show file tree
Hide file tree
Showing 64 changed files with 9,742 additions and 8,418 deletions.
2 changes: 1 addition & 1 deletion .integrated_tests.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
baselines:
bucket: geosx
baseline: integratedTests/baseline_integratedTests-pr3372-8610-4b9a7b3
baseline: integratedTests/baseline_integratedTests-pr3374-8621-bbb3cb2

allow_fail:
all: ''
Expand Down
4 changes: 4 additions & 0 deletions BASELINE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ This file is designed to track changes to the integrated test baselines.
Any developer who updates the baseline ID in the .integrated_tests.yaml file is expected to create an entry in this file with the pull request number, date, and their justification for rebaselining.
These notes should be in reverse-chronological order, and use the following time format: (YYYY-MM-DD).

PR #3374 (2024-11-09)
====================
Bugfix for gravity treatment in flux for thermal.

PR #3372 (2024-11-09)
====================
Fix a bug related to mass and energy updates for poromechanics.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/

/**
* @file multiFluidSelector.hpp
* @file MultiFluidSelector.hpp
*/
#ifndef GEOS_CONSTITUTIVE_FLUID_MULTIFLUIDSELECTOR_HPP_
#define GEOS_CONSTITUTIVE_FLUID_MULTIFLUIDSELECTOR_HPP_
Expand Down
50 changes: 43 additions & 7 deletions src/coreComponents/physicsSolvers/fluidFlow/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,48 @@ set( physicsSolvers_headers
fluidFlow/kernels/singlePhase/ThermalFluxComputeKernel.hpp
fluidFlow/kernels/singlePhase/proppant/ProppantBaseKernels.hpp
fluidFlow/kernels/singlePhase/proppant/ProppantFluxKernels.hpp
fluidFlow/kernels/compositional/IsothermalCompositionalMultiphaseBaseKernels.hpp
fluidFlow/kernels/compositional/ThermalCompositionalMultiphaseBaseKernels.hpp
fluidFlow/kernels/compositional/IsothermalCompositionalMultiphaseFVMKernels.hpp
fluidFlow/kernels/compositional/IsothermalCompositionalMultiphaseFVMKernelUtilities.hpp
fluidFlow/kernels/compositional/ThermalCompositionalMultiphaseFVMKernels.hpp
fluidFlow/kernels/compositional/AccumulationKernel.hpp
fluidFlow/kernels/compositional/AquiferBCKernel.hpp
fluidFlow/kernels/compositional/PPUPhaseFlux.hpp
fluidFlow/kernels/compositional/C1PPUPhaseFlux.hpp
fluidFlow/kernels/compositional/CapillaryPressureUpdateKernel.hpp
fluidFlow/kernels/compositional/CFLKernel.hpp
fluidFlow/kernels/compositional/CompositionalMultiphaseHybridFVMKernels.hpp
fluidFlow/kernels/compositional/DiffusionDispersionFluxComputeKernel.hpp
fluidFlow/kernels/compositional/DirichletFluxComputeKernel.hpp
fluidFlow/kernels/compositional/DissipationFluxComputeKernel.hpp
fluidFlow/kernels/compositional/FluidUpdateKernel.hpp
fluidFlow/kernels/compositional/FluidUpdateKernel.hpp
fluidFlow/kernels/compositional/FluxComputeKernel.hpp
fluidFlow/kernels/compositional/FluxComputeKernelBase.hpp
fluidFlow/kernels/compositional/GlobalComponentFractionKernel.hpp
fluidFlow/kernels/compositional/HydrostaticPressureKernel.hpp
fluidFlow/kernels/compositional/IHUPhaseFlux.hpp
fluidFlow/kernels/compositional/KernelLaunchSelectors.hpp
fluidFlow/kernels/compositional/PhaseComponentFlux.hpp
fluidFlow/kernels/compositional/PhaseMobilityKernel.hpp
fluidFlow/kernels/compositional/PhaseVolumeFractionKernel.hpp
fluidFlow/kernels/compositional/PotGrad.hpp
fluidFlow/kernels/compositional/PPUPhaseFlux.hpp
fluidFlow/kernels/compositional/PropertyKernelBase.hpp
fluidFlow/kernels/compositional/ReactiveCompositionalMultiphaseOBLKernels.hpp
fluidFlow/kernels/compositional/StabilizedCompositionalMultiphaseFVMKernels.hpp
fluidFlow/kernels/compositional/RelativePermeabilityUpdateKernel.hpp
fluidFlow/kernels/compositional/ResidualNormKernel.hpp
fluidFlow/kernels/compositional/SolidInternalEnergyUpdateKernel.hpp
fluidFlow/kernels/compositional/SolutionScalingAndCheckingKernelBase.hpp
fluidFlow/kernels/compositional/SolutionCheckKernel.hpp
fluidFlow/kernels/compositional/SolutionScalingKernel.hpp
fluidFlow/kernels/compositional/StabilizedFluxComputeKernel.hpp
fluidFlow/kernels/compositional/StatisticsKernel.hpp
fluidFlow/kernels/compositional/ThermalAccumulationKernel.hpp
fluidFlow/kernels/compositional/ThermalDiffusionDispersionFluxComputeKernel.hpp
fluidFlow/kernels/compositional/ThermalDirichletFluxComputeKernel.hpp
fluidFlow/kernels/compositional/ThermalFluxComputeKernel.hpp
fluidFlow/kernels/compositional/ThermalPhaseMobilityKernel.hpp
fluidFlow/kernels/compositional/ThermalPhaseVolumeFractionKernel.hpp
fluidFlow/kernels/compositional/ThermalResidualNormKernel.hpp
fluidFlow/kernels/compositional/ThermalSolutionCheckKernel.hpp
fluidFlow/kernels/compositional/ThermalSolutionScalingKernel.hpp
fluidFlow/wells/CompositionalMultiphaseWell.hpp
fluidFlow/wells/CompositionalMultiphaseWellFields.hpp
fluidFlow/wells/SinglePhaseWell.hpp
Expand Down Expand Up @@ -86,7 +120,9 @@ set( physicsSolvers_sources
fluidFlow/SourceFluxStatistics.cpp
fluidFlow/StencilDataCollection.cpp
fluidFlow/kernels/singlePhase/proppant/ProppantFluxKernels.cpp
fluidFlow/kernels/compositional/IsothermalCompositionalMultiphaseFVMKernels.cpp
fluidFlow/kernels/compositional/AquiferBCKernel.cpp
fluidFlow/kernels/compositional/CFLKernel.cpp
fluidFlow/kernels/compositional/FluxComputeKernelBase.cpp
fluidFlow/kernels/compositional/CompositionalMultiphaseHybridFVMKernels.cpp
fluidFlow/wells/CompositionalMultiphaseWell.cpp
fluidFlow/wells/kernels/CompositionalMultiphaseWellKernels.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,24 @@
#include "fieldSpecification/AquiferBoundaryCondition.hpp"
#include "fieldSpecification/EquilibriumInitialCondition.hpp"
#include "fieldSpecification/SourceFluxBoundaryCondition.hpp"
#include "physicsSolvers/fluidFlow/SourceFluxStatistics.hpp"
#include "finiteVolume/FluxApproximationBase.hpp"
#include "mesh/DomainPartition.hpp"
#include "mesh/mpiCommunications/CommunicationTools.hpp"
#include "physicsSolvers/fluidFlow/CompositionalMultiphaseBaseFields.hpp"
#include "physicsSolvers/fluidFlow/FlowSolverBaseFields.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/IsothermalCompositionalMultiphaseBaseKernels.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/IsothermalCompositionalMultiphaseFVMKernels.hpp" // TODO this should not be here
#include "physicsSolvers/fluidFlow/kernels/compositional/ThermalCompositionalMultiphaseBaseKernels.hpp"
#include "physicsSolvers/fluidFlow/SourceFluxStatistics.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/AccumulationKernel.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/ThermalAccumulationKernel.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/GlobalComponentFractionKernel.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/PhaseVolumeFractionKernel.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/ThermalPhaseVolumeFractionKernel.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/FluidUpdateKernel.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/RelativePermeabilityUpdateKernel.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/CapillaryPressureUpdateKernel.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/SolidInternalEnergyUpdateKernel.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/HydrostaticPressureKernel.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/StatisticsKernel.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/CFLKernel.hpp"

#if defined( __INTEL_COMPILER )
#pragma GCC optimize "O0"
Expand Down Expand Up @@ -1410,7 +1420,7 @@ void CompositionalMultiphaseBase::assembleAccumulationAndVolumeBalanceTerms( Dom
if( m_isThermal )
{
thermalCompositionalMultiphaseBaseKernels::
ElementBasedAssemblyKernelFactory::
AccumulationKernelFactory::
createAndLaunch< parallelDevicePolicy<> >( m_numComponents,
m_numPhases,
dofManager.rankOffset(),
Expand All @@ -1425,7 +1435,7 @@ void CompositionalMultiphaseBase::assembleAccumulationAndVolumeBalanceTerms( Dom
else
{
isothermalCompositionalMultiphaseBaseKernels::
ElementBasedAssemblyKernelFactory::
AccumulationKernelFactory::
createAndLaunch< parallelDevicePolicy<> >( m_numComponents,
m_numPhases,
dofManager.rankOffset(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,25 @@
#include "mesh/mpiCommunications/CommunicationTools.hpp"
#include "physicsSolvers/fluidFlow/FlowSolverBaseFields.hpp"
#include "physicsSolvers/fluidFlow/CompositionalMultiphaseBaseFields.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/IsothermalCompositionalMultiphaseBaseKernels.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/ThermalCompositionalMultiphaseBaseKernels.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/IsothermalCompositionalMultiphaseFVMKernels.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/ThermalCompositionalMultiphaseFVMKernels.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/StabilizedCompositionalMultiphaseFVMKernels.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/DissipationCompositionalMultiphaseFVMKernels.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/AccumulationKernel.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/ThermalAccumulationKernel.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/ResidualNormKernel.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/ThermalResidualNormKernel.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/SolutionScalingKernel.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/ThermalSolutionScalingKernel.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/SolutionCheckKernel.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/ThermalSolutionCheckKernel.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/FluxComputeKernel.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/ThermalFluxComputeKernel.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/DiffusionDispersionFluxComputeKernel.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/ThermalDiffusionDispersionFluxComputeKernel.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/StabilizedFluxComputeKernel.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/DissipationFluxComputeKernel.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/PhaseMobilityKernel.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/ThermalPhaseMobilityKernel.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/DirichletFluxComputeKernel.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/ThermalDirichletFluxComputeKernel.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/AquiferBCKernel.hpp"

namespace geos
{
Expand Down Expand Up @@ -171,7 +184,7 @@ void CompositionalMultiphaseFVM::assembleFluxTerms( real64 const dt,
if( m_isThermal )
{
thermalCompositionalMultiphaseFVMKernels::
FaceBasedAssemblyKernelFactory::
FluxComputeKernelFactory::
createAndLaunch< parallelDevicePolicy<> >( m_numComponents,
m_numPhases,
dofManager.rankOffset(),
Expand All @@ -190,7 +203,7 @@ void CompositionalMultiphaseFVM::assembleFluxTerms( real64 const dt,
if( m_dbcParams.useDBC )
{
dissipationCompositionalMultiphaseFVMKernels::
FaceBasedAssemblyKernelFactory::
FluxComputeKernelFactory::
createAndLaunch< parallelDevicePolicy<> >( m_numComponents,
m_numPhases,
dofManager.rankOffset(),
Expand All @@ -213,7 +226,7 @@ void CompositionalMultiphaseFVM::assembleFluxTerms( real64 const dt,
else
{
isothermalCompositionalMultiphaseFVMKernels::
FaceBasedAssemblyKernelFactory::
FluxComputeKernelFactory::
createAndLaunch< parallelDevicePolicy<> >( m_numComponents,
m_numPhases,
dofManager.rankOffset(),
Expand All @@ -237,7 +250,7 @@ void CompositionalMultiphaseFVM::assembleFluxTerms( real64 const dt,
if( m_isThermal )
{
thermalCompositionalMultiphaseFVMKernels::
DiffusionDispersionFaceBasedAssemblyKernelFactory::
DiffusionDispersionFluxComputeKernelFactory::
createAndLaunch< parallelDevicePolicy<> >( m_numComponents,
m_numPhases,
dofManager.rankOffset(),
Expand All @@ -255,7 +268,7 @@ void CompositionalMultiphaseFVM::assembleFluxTerms( real64 const dt,
else
{
isothermalCompositionalMultiphaseFVMKernels::
DiffusionDispersionFaceBasedAssemblyKernelFactory::
DiffusionDispersionFluxComputeKernelFactory::
createAndLaunch< parallelDevicePolicy<> >( m_numComponents,
m_numPhases,
dofManager.rankOffset(),
Expand Down Expand Up @@ -304,7 +317,7 @@ void CompositionalMultiphaseFVM::assembleStabilizedFluxTerms( real64 const dt,
// Thermal implementation not supported yet

stabilizedCompositionalMultiphaseFVMKernels::
FaceBasedAssemblyKernelFactory::
FluxComputeKernelFactory::
createAndLaunch< parallelDevicePolicy<> >( m_numComponents,
m_numPhases,
dofManager.rankOffset(),
Expand Down Expand Up @@ -499,7 +512,7 @@ real64 CompositionalMultiphaseFVM::scalingForSystemSolution( DomainPartition & d
auto const subRegionData =
m_isThermal
? thermalCompositionalMultiphaseBaseKernels::
ScalingForSystemSolutionKernelFactory::
SolutionScalingKernelFactory::
createAndLaunch< parallelDevicePolicy<> >( m_maxRelativePresChange,
m_maxAbsolutePresChange,
m_maxRelativeTempChange,
Expand All @@ -518,7 +531,7 @@ real64 CompositionalMultiphaseFVM::scalingForSystemSolution( DomainPartition & d
localSolution,
temperatureOffset )
: isothermalCompositionalMultiphaseBaseKernels::
ScalingForSystemSolutionKernelFactory::
SolutionScalingKernelFactory::
createAndLaunch< parallelDevicePolicy<> >( m_maxRelativePresChange,
m_maxAbsolutePresChange,
m_maxCompFracChange,
Expand Down Expand Up @@ -638,10 +651,8 @@ bool CompositionalMultiphaseFVM::checkSystemSolution( DomainPartition & domain,
m_scalingType,
scalingFactor,
pressure,

compDens,
pressureScalingFactor,

compDensScalingFactor,
dofManager.rankOffset(),
m_numComponents,
Expand Down Expand Up @@ -1025,7 +1036,7 @@ void CompositionalMultiphaseFVM::applyFaceDirichletBC( real64 const time_n,
{
//todo (jafranc) extend upwindScheme name if satisfied in isothermalCase
thermalCompositionalMultiphaseFVMKernels::
DirichletFaceBasedAssemblyKernelFactory::
DirichletFluxComputeKernelFactory::
createAndLaunch< parallelDevicePolicy<> >( m_numComponents,
m_numPhases,
dofManager.rankOffset(),
Expand All @@ -1043,7 +1054,7 @@ void CompositionalMultiphaseFVM::applyFaceDirichletBC( real64 const time_n,
else
{
isothermalCompositionalMultiphaseFVMKernels::
DirichletFaceBasedAssemblyKernelFactory::
DirichletFluxComputeKernelFactory::
createAndLaunch< parallelDevicePolicy<> >( m_numComponents,
m_numPhases,
dofManager.rankOffset(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@
#include "physicsSolvers/fluidFlow/FlowSolverBaseFields.hpp"
#include "physicsSolvers/fluidFlow/CompositionalMultiphaseBaseFields.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/CompositionalMultiphaseHybridFVMKernels.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/IsothermalCompositionalMultiphaseBaseKernels.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/AccumulationKernel.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/SolutionScalingKernel.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/SolutionCheckKernel.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/ResidualNormKernel.hpp"

/**
* @namespace the geos namespace that encapsulates the majority of the code
Expand Down Expand Up @@ -451,7 +454,7 @@ real64 CompositionalMultiphaseHybridFVM::scalingForSystemSolution( DomainPartiti
arrayView1d< real64 > compDensScalingFactor = subRegion.getField< fields::flow::globalCompDensityScalingFactor >();
auto const subRegionData =
isothermalCompositionalMultiphaseBaseKernels::
ScalingForSystemSolutionKernelFactory::
SolutionScalingKernelFactory::
createAndLaunch< parallelDevicePolicy<> >( m_maxRelativePresChange,
m_maxAbsolutePresChange,
m_maxCompFracChange,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,15 @@

#include "CompositionalMultiphaseStatistics.hpp"

#include "mesh/DomainPartition.hpp"
#include "constitutive/fluid/multifluid/MultiFluidBase.hpp"
#include "constitutive/relativePermeability/RelativePermeabilityBase.hpp"
#include "constitutive/solid/CoupledSolidBase.hpp"
#include "finiteVolume/FiniteVolumeManager.hpp"
#include "finiteVolume/FluxApproximationBase.hpp"
#include "mainInterface/ProblemManager.hpp"
#include "physicsSolvers/PhysicsSolverManager.hpp"
#include "physicsSolvers/fluidFlow/CompositionalMultiphaseBase.hpp"
#include "physicsSolvers/fluidFlow/CompositionalMultiphaseBaseFields.hpp"
#include "physicsSolvers/fluidFlow/CompositionalMultiphaseHybridFVM.hpp"
#include "physicsSolvers/fluidFlow/FlowSolverBaseFields.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/IsothermalCompositionalMultiphaseBaseKernels.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/IsothermalCompositionalMultiphaseFVMKernels.hpp"
#include "physicsSolvers/fluidFlow/kernels/compositional/StatisticsKernel.hpp"
#include "physicsSolvers/fluidFlow/LogLevelsInfo.hpp"


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ void ReactiveCompositionalMultiphaseOBL::assembleFluxTerms( real64 const dt,
{
typename TYPEOFREF( stencil ) ::KernelWrapper stencilWrapper = stencil.createKernelWrapper();

FaceBasedAssemblyKernelFactory::
FluxComputeKernelFactory::
createAndLaunch< parallelDevicePolicy<> >( m_numPhases,
m_numComponents,
m_enableEnergyBalance,
Expand Down
Loading

0 comments on commit 3b0d907

Please sign in to comment.