Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
f57757a
fix: Missing face boundary condition support
OmarDuran Aug 12, 2025
9d88fe7
Update src/coreComponents/physicsSolvers/fluidFlow/CompositionalMulti…
OmarDuran Aug 12, 2025
f627f65
Update CompositionalMultiphaseHybridFVM.cpp
OmarDuran Aug 12, 2025
a6d1477
Merge branch 'develop' into fix/oduran/weak_dirichlet_bc_mfd
OmarDuran Aug 12, 2025
7c972c9
Merge branch 'develop' into fix/oduran/weak_dirichlet_bc_mfd
OmarDuran Aug 13, 2025
d802798
Merge branch 'develop' into fix/oduran/weak_dirichlet_bc_mfd
OmarDuran Aug 14, 2025
d8c180f
Merge branch 'develop' into fix/oduran/weak_dirichlet_bc_mfd
OmarDuran Aug 14, 2025
60ae205
fix: Lambda capture 'mat' is not used
OmarDuran Aug 14, 2025
f24de72
Merge branch 'fix/oduran/remove_unused_lambda_capture' into fix/odura…
OmarDuran Aug 14, 2025
48bfed1
Merge branch 'develop' into fix/oduran/weak_dirichlet_bc_mfd
OmarDuran Aug 17, 2025
d9552ff
Merge branch 'develop' into fix/oduran/weak_dirichlet_bc_mfd
OmarDuran Aug 25, 2025
0629c09
Merge branch 'develop' into fix/oduran/weak_dirichlet_bc_mfd
OmarDuran Sep 5, 2025
a04df83
Merge branch 'develop' into fix/oduran/weak_dirichlet_bc_mfd
OmarDuran Sep 22, 2025
0f88a06
Merge branch 'develop' into fix/oduran/weak_dirichlet_bc_mfd
OmarDuran Sep 28, 2025
da63b72
Merge branch 'develop' into fix/oduran/weak_dirichlet_bc_mfd
OmarDuran Oct 12, 2025
bb1e825
wip: consistent T g grad(z)
OmarDuran Oct 12, 2025
633bfdf
Update CompositionalMultiphaseHybridFVMKernels.hpp
OmarDuran Oct 12, 2025
a496131
Update CompositionalMultiphaseHybridFVMKernels.hpp
OmarDuran Oct 12, 2025
e8a2a17
wip: ongoing work with consistent gravity terms
OmarDuran Oct 12, 2025
a203c65
Update CompositionalMultiphaseHybridFVMKernels_impl.hpp
OmarDuran Oct 12, 2025
c3b4c12
Update CompositionalMultiphaseHybridFVMKernels_impl.hpp
OmarDuran Oct 12, 2025
afdb405
wip: ongoing work with consistent gravity terms
OmarDuran Oct 12, 2025
35c0c19
Update CompositionalMultiphaseHybridFVM.cpp
OmarDuran Oct 12, 2025
e1ec4b1
Update kernelSpecs.json
OmarDuran Oct 12, 2025
3035ace
Update CompositionalMultiphaseHybridFVMKernels.hpp
OmarDuran Oct 12, 2025
b6cde0e
wip: ongoing work with consistent gravity terms afdb405b8a src
OmarDuran Oct 12, 2025
0db774b
Update kernelSpecs.json
OmarDuran Oct 12, 2025
3eaa7c5
fix: consistent gravity term
OmarDuran Oct 12, 2025
6d731cb
Update CompositionalMultiphaseHybridFVM.cpp
OmarDuran Oct 12, 2025
f8b8afa
Update CompositionalMultiphaseHybridFVMKernels.cpp
OmarDuran Oct 12, 2025
b384cd6
Update CompositionalMultiphaseHybridFVMKernels.hpp
OmarDuran Oct 12, 2025
adc61e6
wip: improving solution strategy
OmarDuran Oct 13, 2025
78438e3
Merge branch 'develop' into fix/oduran/weak_dirichlet_bc_mfd
OmarDuran Oct 20, 2025
4470735
Merge branch 'develop' into fix/oduran/consistent_compositional_buoya…
OmarDuran Oct 20, 2025
f95ea48
Update CompositionalMultiphaseHybridFVM.cpp
OmarDuran Oct 20, 2025
4ac73f2
wip: add a kernel for handling composition boundary conditions
OmarDuran Oct 20, 2025
f2af474
wip: compiling code
OmarDuran Oct 21, 2025
c127d36
wip: inlcuding DirichletFluxKernel in CompositionalMultiphaseHybridFV…
OmarDuran Oct 22, 2025
73f0b83
Merge branch 'develop' into fix/oduran/weak_dirichlet_bc_mfd
OmarDuran Oct 24, 2025
55f5898
wip: number of iterations should be exactly 2
OmarDuran Oct 25, 2025
4436fd8
Merge branch 'develop' into fix/oduran/weak_dirichlet_bc_mfd
OmarDuran Oct 25, 2025
854eaea
wip: exact linear pressure field
OmarDuran Oct 25, 2025
32a4a0b
Update CompositionalMultiphaseHybridFVMKernels_impl.hpp
OmarDuran Oct 27, 2025
88cea37
Update CompositionalMultiphaseHybridFVMKernels_impl.hpp
OmarDuran Oct 27, 2025
160da95
wip:
OmarDuran Oct 27, 2025
28cb9c7
Update CompositionalMultiphaseHybridFVM.cpp
OmarDuran Oct 28, 2025
6dfa7ec
wip
OmarDuran Oct 28, 2025
e0d64e3
Update CompositionalMultiphaseHybridFVMKernels_impl.hpp
OmarDuran Oct 28, 2025
c441dbd
Update CompositionalMultiphaseHybridFVMKernels_impl.hpp
OmarDuran Oct 28, 2025
a209bc8
Update CompositionalMultiphaseHybridFVMKernels_impl.hpp
OmarDuran Oct 28, 2025
cb8667b
Update CompositionalMultiphaseHybridFVMKernels_impl.hpp
OmarDuran Oct 28, 2025
b110603
Update CompositionalMultiphaseHybridFVM.cpp
OmarDuran Oct 28, 2025
496bd4f
wip
OmarDuran Oct 28, 2025
bb8e128
Update CompositionalMultiphaseHybridFVM.cpp
OmarDuran Oct 28, 2025
b66560a
wip: adding Boundary identifiers
OmarDuran Oct 28, 2025
9a49230
Update CompositionalMultiphaseHybridFVMKernels.hpp
OmarDuran Oct 28, 2025
9026ca4
Update CompositionalMultiphaseHybridFVM.cpp
OmarDuran Oct 28, 2025
e2fd317
wip:
OmarDuran Oct 28, 2025
97029a5
Update CompositionalMultiphaseHybridFVMKernels.hpp
OmarDuran Oct 28, 2025
393bf06
wip:
OmarDuran Oct 28, 2025
97ab88a
wip:
OmarDuran Oct 28, 2025
e7edc23
Update CompositionalMultiphaseHybridFVMKernels_impl.hpp
OmarDuran Oct 28, 2025
a2e599f
Merge branch 'develop' into fix/oduran/weak_dirichlet_bc_mfd
OmarDuran Oct 28, 2025
cc63407
Update CompositionalMultiphaseHybridFVMKernels_impl.hpp
OmarDuran Oct 29, 2025
b7b7308
wip: consistent pressure solution
OmarDuran Oct 29, 2025
f234840
Merge branch 'fix/oduran/weak_dirichlet_bc_mfd' of https://github.com…
OmarDuran Oct 29, 2025
84275e1
Update CompositionalMultiphaseHybridFVM.cpp
OmarDuran Oct 29, 2025
0dfc988
wip: adding integration test
OmarDuran Oct 29, 2025
7171e33
Update testCompositionalMultiPhaseMFDPolyhedral.cpp
OmarDuran Oct 29, 2025
7ed0293
Merge branch 'develop' into fix/oduran/weak_dirichlet_bc_mfd
OmarDuran Oct 29, 2025
7810bf6
wip: adding support for full set of cells and inner products
OmarDuran Oct 29, 2025
6fd5307
Merge branch 'fix/oduran/weak_dirichlet_bc_mfd' of https://github.com…
OmarDuran Oct 29, 2025
1e88b3e
Update testCompositionalMultiPhaseMFDPolyhedral.cpp
OmarDuran Oct 29, 2025
cbbc3b8
wip: adding support for QuasiTPFA
OmarDuran Oct 29, 2025
982149d
Update kernelSpecs.json
OmarDuran Oct 29, 2025
d388d56
Delete CompositionalMultiphaseHybridFVM.cpp.backup
OmarDuran Oct 29, 2025
4ffad81
wip: apply code review and make code CI compliant
OmarDuran Oct 29, 2025
9e397a1
fix: code style and reduce number of kernel combinations
OmarDuran Oct 30, 2025
113f9af
Merge branch 'develop' into fix/oduran/consistent_compositional_buoya…
OmarDuran Oct 30, 2025
5fb7a62
fix: code style and reduce number of kernel combinations
OmarDuran Oct 30, 2025
4204558
Update src/coreComponents/integrationTests/fluidFlowTests/CMakeLists.txt
OmarDuran Oct 30, 2025
1428556
Update src/coreComponents/physicsSolvers/fluidFlow/kernelSpecs.json
OmarDuran Oct 30, 2025
4d97286
Update src/coreComponents/physicsSolvers/fluidFlow/CompositionalMulti…
OmarDuran Oct 30, 2025
cfb1fde
Update CompositionalMultiphaseHybridFVMKernels_impl.hpp
OmarDuran Oct 30, 2025
dd8f391
Merge branch 'fix/oduran/weak_dirichlet_bc_mfd' of https://github.com…
OmarDuran Oct 30, 2025
4a2f9b9
Merge branch 'fix/oduran/weak_dirichlet_bc_mfd' into fix/oduran/consi…
OmarDuran Oct 30, 2025
92747f2
Update CompositionalMultiphaseHybridFVMKernels.hpp
OmarDuran Oct 30, 2025
0feb21a
fix: merge conflicts
OmarDuran Oct 30, 2025
9e7b03d
wip: fix merge conflicts
OmarDuran Oct 30, 2025
a3d5091
fix: rebaselines
OmarDuran Oct 30, 2025
498692f
Merge branch 'develop' into fix/oduran/weak_dirichlet_bc_mfd
OmarDuran Oct 30, 2025
c9a7242
wip: rebase lined and adding complete instantiation of MDF kernels
OmarDuran Oct 31, 2025
6949133
wip: complete selector by number of facets
OmarDuran Oct 31, 2025
c7a12b4
wip: testing general meshes for MFD compositional
OmarDuran Oct 31, 2025
106b23f
Update testCompositionalMultiPhaseMFDPolyhedral.cpp
OmarDuran Oct 31, 2025
f9c395b
fix: generateXmlInputCompMFD - it initializes face pressure but NOT f…
OmarDuran Oct 31, 2025
67ffbef
Merge branch 'develop' into fix/oduran/weak_dirichlet_bc_mfd
OmarDuran Oct 31, 2025
cceaa21
Update src/coreComponents/integrationTests/fluidFlowTests/testComposi…
OmarDuran Nov 1, 2025
dedbdf1
Update src/coreComponents/integrationTests/fluidFlowTests/testComposi…
OmarDuran Nov 1, 2025
54900ce
Update src/coreComponents/integrationTests/fluidFlowTests/testComposi…
OmarDuran Nov 1, 2025
a3743bc
Update testCompositionalMultiPhaseMFDPolyhedral.cpp
OmarDuran Nov 1, 2025
4aa0614
Merge branch 'fix/oduran/weak_dirichlet_bc_mfd' of https://github.com…
OmarDuran Nov 1, 2025
dfe87d9
Update testCompositionalMultiPhaseMFDPolyhedral.cpp
OmarDuran Nov 1, 2025
393e562
Update testCompositionalMultiPhaseMFDPolyhedral.cpp
OmarDuran Nov 1, 2025
8d7fab6
Update CompositionalMultiphaseHybridFVMKernels_impl.hpp
OmarDuran Nov 3, 2025
59cab8a
Merge branch 'develop' into fix/oduran/weak_dirichlet_bc_mfd
OmarDuran Nov 3, 2025
aded73c
Update CompositionalMultiphaseHybridFVMKernels_impl.hpp
OmarDuran Nov 3, 2025
c3e10c3
Merge branch 'develop' into fix/oduran/consistent_compositional_buoya…
OmarDuran Nov 3, 2025
7bf45fc
fix: run evaluateBCFaceProperties with parallelDevicePolicy
OmarDuran Nov 3, 2025
60e9849
fix: run evaluateBCFaceProperties with serialPolicy
OmarDuran Nov 3, 2025
bb9a6b8
Update CompositionalMultiphaseHybridFVM.cpp
OmarDuran Nov 3, 2025
a642f32
doc: improving documentation
OmarDuran Nov 3, 2025
be93e97
Update CompositionalMultiphaseHybridFVM.cpp
OmarDuran Nov 3, 2025
61c2a6a
fix: code style
OmarDuran Nov 3, 2025
1bb64cc
Merge branch 'fix/oduran/weak_dirichlet_bc_mfd' into fix/oduran/consi…
OmarDuran Nov 6, 2025
83ff57c
Update CompositionalMultiphaseHybridFVMKernels.hpp
OmarDuran Nov 7, 2025
f3c8503
Merge branch 'develop' into fix/oduran/weak_dirichlet_bc_mfd
OmarDuran Nov 8, 2025
dc00171
Merge branch 'fix/oduran/weak_dirichlet_bc_mfd' into fix/oduran/consi…
OmarDuran Nov 8, 2025
009a461
wip: fix usage of usage of upwindingScheme HU2PH
OmarDuran Nov 8, 2025
b137713
wip: removing unused instantiations file
OmarDuran Nov 12, 2025
a4baf83
Merge branch 'fix/oduran/weak_dirichlet_bc_mfd' into fix/oduran/consi…
OmarDuran Nov 13, 2025
001654c
Merge branch 'develop' into fix/oduran/consistent_compositional_buoya…
OmarDuran Nov 14, 2025
75982e7
Update CompositionalMultiphaseHybridFVM.cpp
OmarDuran Nov 17, 2025
0293a9d
Merge branch 'develop' into fix/oduran/consistent_compositional_buoya…
OmarDuran Dec 8, 2025
88f39a6
Merge branch 'fix/oduran/consistent_compositional_buoyant_flux' of ht…
OmarDuran Dec 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?xml version="1.0" ?>

<Problem>

<Included>
<File name="./staircase_co2_3d_base.xml"/>
</Included>

<NumericalMethods>
<FiniteVolume>
<HybridMimeticDiscretization
name="fluidHybridMimetic"
innerProductType="beiraoDaVeigaLipnikovManzini"/>
</FiniteVolume>
</NumericalMethods>

<Solvers gravityVector="{ 0.0, 0.0, -9.81 }">
<CompositionalMultiphaseHybridFVM
name="twoPhaseFlow"
logLevel="1"
discretization="fluidHybridMimetic"
targetRelativePressureChangeInTimeStep="1"
targetPhaseVolFractionChangeInTimeStep="1"
targetRegions="{ channel, barrier }"
temperature="300"
useMass="1">
<NonlinearSolverParameters
newtonTol="1.0e-4"
maxTimeStepCuts="100"
maxSubSteps="1000"
lineSearchAction="Attempt"
lineSearchStartingIteration="5"
timeStepIncreaseIterLimit="0.3"
timeStepDecreaseIterLimit="0.6"
newtonMaxIter="15" />
<LinearSolverParameters
solverType="fgmres"
preconditionerType="mgr"
krylovTol="1e-5"
krylovMaxIter="100"
logLevel="1" />
</CompositionalMultiphaseHybridFVM>
</Solvers>

<Events
minTime="0.0"
maxTime="8640000">

<PeriodicEvent
name="outputs"
timeFrequency="864000"
target="/Outputs/vtkOutputMFD"/>


<PeriodicEvent
name="solverApplications1"
endTime="86400000"
maxEventDt="86400"
target="/Solvers/twoPhaseFlow"/>

</Events>

<Outputs>
<VTK
name="vtkOutputMFD"
fieldNames="{ initialPressure, skeletonChannel_density }"/>
</Outputs>

<Tasks>

</Tasks>

</Problem>
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?xml version="1.0" ?>

<Problem>

<Included>
<File name="./staircase_co2_3d_base.xml"/>
</Included>

<NumericalMethods>
<FiniteVolume>
<TwoPointFluxApproximation
name="fluidTPFA"
upwindingScheme="HU2PH"/>
</FiniteVolume>
</NumericalMethods>

<Solvers gravityVector="{ 0.0, 0.0, -9.81 }">
<CompositionalMultiphaseFVM
name="twoPhaseFlow"
logLevel="1"
discretization="fluidTPFA"
targetRelativePressureChangeInTimeStep="1"
targetPhaseVolFractionChangeInTimeStep="1"
targetRegions="{ channel, barrier }"
temperature="300"
useMass="1">
<NonlinearSolverParameters
newtonTol="1.0e-4"
maxTimeStepCuts="100"
maxSubSteps="1000"
lineSearchAction="Attempt"
lineSearchStartingIteration="5"
timeStepIncreaseIterLimit="0.3"
timeStepDecreaseIterLimit="0.6"
newtonMaxIter="15" />
<LinearSolverParameters
solverType="fgmres"
preconditionerType="mgr"
krylovTol="1e-5"
krylovMaxIter="100"
logLevel="1" />
</CompositionalMultiphaseFVM>
</Solvers>

<Events
minTime="0.0"
maxTime="8640000">

<PeriodicEvent
name="outputs"
timeFrequency="864000"
target="/Outputs/vtkOutputTPFA"/>


<PeriodicEvent
name="solverApplications1"
endTime="86400000"
maxEventDt="86400"
target="/Solvers/twoPhaseFlow"/>

</Events>

<Outputs>
<VTK
name="vtkOutputTPFA"
fieldNames="{ initialPressure, skeletonChannel_density }"/>
</Outputs>

<Tasks>

</Tasks>

</Problem>
2 changes: 1 addition & 1 deletion src/cmake/GeosxOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ message( "CMAKE_CXX_COMPILER_ID = ${CMAKE_CXX_COMPILER_ID}" )
blt_append_custom_compiler_flag( FLAGS_VAR CMAKE_CXX_FLAGS DEFAULT "${OpenMP_CXX_FLAGS}" )
blt_append_custom_compiler_flag( FLAGS_VAR CMAKE_CXX_FLAGS
GNU "-Wpedantic -pedantic-errors -Wshadow -Wfloat-equal -Wcast-align -Wcast-qual"
CLANG "-Wpedantic -pedantic-errors -Wshadow -Wfloat-equal -Wno-cast-align -Wcast-qual"
CLANG "-Wpedantic -pedantic-errors -Wshadow -Wfloat-equal -Wno-cast-align -Wcast-qual -Wno-shorten-64-to-32"
)

blt_append_custom_compiler_flag( FLAGS_VAR CMAKE_CXX_FLAGS_DEBUG
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,12 @@ class CompositionalMultiphaseHybridFVM : public MGRStrategyBase< 3 >

// Level 1
m_levelFRelaxType[1] = MGRFRelaxationType::none;
m_levelInterpType[1] = MGRInterpolationType::jacobi;
m_levelFRelaxIters[1] = 1;
m_levelInterpType[1] = MGRInterpolationType::injection;
m_levelRestrictType[1] = MGRRestrictionType::blockColLumped; // True-IMPES
m_levelCoarseGridMethod[1] = MGRCoarseGridMethod::galerkin;
m_levelGlobalSmootherType[1] = MGRGlobalSmootherType::none;
m_levelGlobalSmootherType[1] = MGRGlobalSmootherType::ilu0;
m_levelGlobalSmootherIters[1] = 1;

// Level 2
m_levelFRelaxType[2] = MGRFRelaxationType::jacobi;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ void CompositionalMultiphaseFVM::postInputInitialization()
FluxApproximationBase const & fluxApprox = fvManager.getFluxApproximation( m_discretizationName );
auto const & upwindingParams = fluxApprox.upwindingParams();
if( upwindingParams.upwindingScheme == UpwindingScheme::C1PPU ||
upwindingParams.upwindingScheme == UpwindingScheme::IHU )
upwindingParams.upwindingScheme == UpwindingScheme::IHU ||
upwindingParams.upwindingScheme == UpwindingScheme::HU2PH )
{
GEOS_ERROR( GEOS_FMT( "{}: {} is not available for {}",
getDataContext(),
Expand Down Expand Up @@ -273,7 +274,9 @@ void CompositionalMultiphaseFVM::assembleFluxTerms( real64 const dt,
kernelFlags.set( KernelFlags::C1PPU );
else if( upwindingParams.upwindingScheme == UpwindingScheme::IHU )
kernelFlags.set( KernelFlags::IHU );

else if( upwindingParams.upwindingScheme == UpwindingScheme::HU2PH )
kernelFlags.set( KernelFlags::HU2PH );

string const & elemDofKey = dofManager.getKey( viewKeyStruct::elemDofFieldString() );

fluxApprox.forAllStencils( mesh, [&] ( auto & stencil )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ void CompositionalMultiphaseHybridFVM::registerDataOnMesh( Group & meshBodies )
// Register the face data for temperature
faceManager.registerField< flow::faceTemperature >( getName() );



// Register the bc face data for pressure
faceManager.registerField< flow::bcPressure >( getName() );

Expand All @@ -106,11 +104,11 @@ void CompositionalMultiphaseHybridFVM::registerDataOnMesh( Group & meshBodies )
reference().resizeDimension< 1, 2 >( m_numPhases, m_numComponents );

// Register boundary face indicator (1 for boundary faces with Dirichlet BCs, 0 for interior)
// Used to skip flux continuity constraints for boundary faces
faceManager.registerField< flow::isBoundaryFace >( getName() );

// auxiliary data for the buoyancy coefficient
faceManager.registerField< flow::mimGravityCoefficient >( getName() );
// precomputed mimetic gravity-driven trans coefficient on faces
faceManager.registerField< flow::mimeticTransGgradZ >( getName() );

} );
}

Expand Down Expand Up @@ -241,67 +239,57 @@ void CompositionalMultiphaseHybridFVM::precomputeData( MeshLevel & mesh, string_
{
FlowSolverBase::precomputeData( mesh, regionNames );

NodeManager const & nodeManager = mesh.getNodeManager();
FaceManager & faceManager = mesh.getFaceManager();

array1d< RAJA::ReduceSum< serialReduce, real64 > > mimFaceGravCoefNumerator;
array1d< RAJA::ReduceSum< serialReduce, real64 > > mimFaceGravCoefDenominator;
mimFaceGravCoefNumerator.resize( faceManager.size() );
mimFaceGravCoefDenominator.resize( faceManager.size() );

// node data

arrayView2d< real64 const, nodes::REFERENCE_POSITION_USD > const & nodePosition = nodeManager.referencePosition();

// face data

arrayView1d< real64 const > const & transMultiplier =
faceManager.getField< flow::transMultiplier >();

arrayView1d< real64 > const mimFaceGravCoef =
faceManager.getField< flow::mimGravityCoefficient >();

ArrayOfArraysView< localIndex const > const & faceToNodes = faceManager.nodeList().toViewConst();

real64 const lengthTolerance = m_lengthTolerance;

mesh.getElemManager().forElementSubRegions< CellElementSubRegion >( regionNames, [&]( localIndex const,
CellElementSubRegion & subRegion )
// Pre-compute and initialize face mimeticTransGgradZ once (only for HybridMimetic discretization)
{
arrayView2d< real64 const > const & elemCenter =
subRegion.template getReference< array2d< real64 > >( CellElementSubRegion::viewKeyStruct::elementCenterString() );
string const & permModelName = subRegion.getReference< string >( viewKeyStruct::permeabilityNamesString() );
arrayView3d< real64 const > const & elemPerm =
getConstitutiveModel< PermeabilityBase >( subRegion, permModelName ).permeability();
arrayView1d< real64 const > const elemGravCoef =
subRegion.template getReference< array1d< real64 > >( flow::gravityCoefficient::key() );
arrayView1d< real64 const > const & elemVolume = subRegion.getElementVolume();
arrayView2d< localIndex const > const & elemToFaces = subRegion.faceList();

// here we precompute some quantities (mimFaceFracCoef) used in the FluxKernel to assemble the one-sided gravity term in the transport
// scheme
// This one-sided gravity term is currently always treated with TPFA, as in MRST.
// In the future, I will change that (here and in the FluxKernel) to have a consistent inner product for the gravity term as well
compositionalMultiphaseHybridFVMKernels::
simpleKernelLaunchSelector< PrecomputeKernel,
mimeticInnerProduct::TPFAInnerProduct >( subRegion.numFacesPerElement(),
subRegion.size(),
faceManager.size(),
nodePosition,
faceToNodes,
elemCenter,
elemVolume,
elemPerm,
elemGravCoef,
elemToFaces,
transMultiplier,
lengthTolerance,
mimFaceGravCoefNumerator.toView(),
mimFaceGravCoefDenominator.toView(),
mimFaceGravCoef );
DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" );
NumericalMethodsManager const & nm = domain.getNumericalMethodManager();
FiniteVolumeManager const & fvManager = nm.getFiniteVolumeManager();

} );
HybridMimeticDiscretization const & hm = fvManager.getHybridMimeticDiscretization( m_discretizationName );
mimeticInnerProduct::MimeticInnerProductBase const & ip = hm.getReference< mimeticInnerProduct::MimeticInnerProductBase >( HybridMimeticDiscretization::viewKeyStruct::innerProductString() );
real64 const lengthTolerance = domain.getMeshBody( 0 ).getGlobalLengthScale() * m_lengthTolerance;

forDiscretizationOnMeshTargets( domain.getMeshBodies(), [&]( string const &, MeshLevel & mesh, string_array const & regionNames )
{
FaceManager & faceManager = mesh.getFaceManager();
// Temporary accumulators
array1d< real64 > invSum( faceManager.size() ); invSum.setValues< parallelDevicePolicy<> >( 0.0 );
array1d< integer > count( faceManager.size() ); count.setValues< parallelDevicePolicy<> >( 0 );

NodeManager const & nodeManager = mesh.getNodeManager();
mesh.getElemManager().forElementSubRegionsComplete< CellElementSubRegion >( regionNames,
[&]( localIndex const, localIndex const er, localIndex const esr, ElementRegionBase const &,
CellElementSubRegion const & subRegion )
{
GEOS_UNUSED_VAR( er );
GEOS_UNUSED_VAR( esr );
string const & permName = subRegion.getReference< string >( viewKeyStruct::permeabilityNamesString() );
PermeabilityBase const & permeability = getConstitutiveModel< PermeabilityBase >( subRegion, permName );
PrecomputeMimeticTransGgradZKernel::createAndLaunch< parallelDevicePolicy<> >( ip,
nodeManager,
faceManager,
subRegion,
permeability,
lengthTolerance,
invSum.toView(),
count.toView() );
} );

// Reduce to effective value per face and write to field
arrayView1d< real64 > mimeticTransGgradZ = faceManager.getField< flow::mimeticTransGgradZ >();
arrayView1d< integer const > ghost = faceManager.ghostRank();
forAll< parallelDevicePolicy<> >( faceManager.size(), [=] GEOS_HOST_DEVICE ( localIndex const kf )
{
if( ghost[kf] >= 0 )
{
return;
}
real64 const s = invSum[kf];
integer const c = count[kf];
mimeticTransGgradZ[kf] = (c > 0 && s > 0.0) ? static_cast< real64 >( c ) / s : 0.0;
} );
} );
}
}

void CompositionalMultiphaseHybridFVM::implicitStepSetup( real64 const & time_n,
Expand Down Expand Up @@ -417,8 +405,8 @@ void CompositionalMultiphaseHybridFVM::assembleFluxTerms( real64 const dt,
// get the face-centered depth
arrayView1d< real64 const > const & faceGravCoef =
faceManager.getField< flow::gravityCoefficient >();
arrayView1d< real64 const > const & mimFaceGravCoef =
faceManager.getField< flow::mimGravityCoefficient >();
arrayView1d< real64 const > const & mimeticTransGgradZ =
faceManager.getField< flow::mimeticTransGgradZ >();

// get the face-centered transMultiplier
arrayView1d< real64 const > const & transMultiplier =
Expand Down Expand Up @@ -468,7 +456,7 @@ void CompositionalMultiphaseHybridFVM::assembleFluxTerms( real64 const dt,
isBoundaryFaceView,
facePres,
faceGravCoef,
mimFaceGravCoef,
mimeticTransGgradZ,
transMultiplier,
compFlowAccessors.get( flow::phaseMobility{} ),
compFlowAccessors.get( flow::dPhaseMobility{} ),
Expand Down Expand Up @@ -809,8 +797,6 @@ void CompositionalMultiphaseHybridFVM::applyFaceDirichletBC( real64 const time_n
} );
}

// CRITICAL: Move the SAME array views that were just modified back to device memory
// Don't get new views - use the views that evaluateBCFaceProperties actually modified
// evaluateBCFaceProperties uses serialPolicy (host), DirichletFluxKernel uses parallelDevicePolicy (device)
facePhaseMob.move( parallelDeviceMemorySpace, false );
facePhaseMassDens.move( parallelDeviceMemorySpace, false );
Expand Down Expand Up @@ -980,12 +966,6 @@ void CompositionalMultiphaseHybridFVM::applyFaceDirichletBC( real64 const time_n
// Mathematical procedure to enforce prescribed value in Ax = b:
// 1. For row i: Zero all entries except diagonal, set A[i,i] = 1, set b[i] = x_spec
// 2. For all other rows k: subtract A[k,i] * x_spec from b[k], then set A[k,i] = 0
//
// Note: Step 2 (removing column influence) should ideally be done, but in practice
// for boundary face DOFs in hybrid FVM, the column entries from interior faces to
// boundary faces are typically zero or minimal because boundary faces don't strongly
// couple to interior equations. The strong coupling is boundary->interior (via fluxes).
// For exact enforcement in non-trivial cases, column zeroing would be needed.

if( localRow >= 0 && localRow < localMatrix.numRows() )
{
Expand All @@ -1009,7 +989,6 @@ void CompositionalMultiphaseHybridFVM::applyFaceDirichletBC( real64 const time_n
// Set RHS to the prescribed boundary value (absolute value)
localRhs[localRow] = presFace[kf] - presFaceBC[kf];
}

} );
} );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,13 @@ DECLARE_FIELD( gravityCoefficient,
WRITE_AND_READ,
"Gravity coefficient (dot product of gravity acceleration by gravity vector)" );

DECLARE_FIELD( mimGravityCoefficient,
"mimGravityCoefficient",
DECLARE_FIELD( mimeticTransGgradZ,
"mimeticTransGgradZ",
array1d< real64 >,
0,
NOPLOT,
WRITE_AND_READ,
"Mimetic gravity coefficient" );
"Consistent mimetic operator applied to g grad(z) (harmonic average of element contributions)" );

DECLARE_FIELD( macroElementIndex,
"macroElementIndex",
Expand Down
Loading
Loading