Skip to content

Commit 9d40eb0

Browse files
paveltominCusiniM
andauthored
refactor: clarify new gravity, clean up kernel flags usage, move CFL computations to FVM solver (#3486)
Co-authored-by: Matteo Cusini <49037133+CusiniM@users.noreply.github.com>
1 parent 52bda31 commit 9d40eb0

31 files changed

+465
-474
lines changed

.integrated_tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
baselines:
22
bucket: geosx
3-
baseline: integratedTests/baseline_integratedTests-pr3479-9362-cffefcc
3+
baseline: integratedTests/baseline_integratedTests-pr3486-9492-f0c817c
44
allow_fail:
55
all: ''
66
streak: ''

BASELINE_NOTES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ This file is designed to track changes to the integrated test baselines.
66
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.
77
These notes should be in reverse-chronological order, and use the following time format: (YYYY-MM-DD).
88

9+
PR #3486 (2025-01-06)
10+
=====================
11+
useNewGravity became gravityDensityScheme.
12+
913
PR #3479 (2024-12-15)
1014
=====================
1115
Refine inputFiles/compositionalMultiphaseFlow: shift reference pressures to initial pressures, make nonlinear tuning more reasonable, minimize output.

src/coreComponents/finiteVolume/docs/FiniteVolume.rst.txt

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,27 @@ The numerical flux is obtained using the following expression for the mass flux
1616
.. math::
1717
F_{KL} = \Upsilon_{KL} \frac{\rho^{upw}}{\mu^{upw}} \big( p_K - p_L - \rho^{avg} g ( d_K - d_L ) \big),
1818
19-
where :math:`p_K` is the pressure of cell :math:`K`, :math:`d_K` is the depth of cell :math:`K`, and :math:`\Upsilon_{KL}` is the standard TPFA transmissibility coefficient at the interface.
19+
20+
where :math:`p_K` is the pressure of cell :math:`K`, :math:`\rho^{avg}` is the average fluid density, :math:`d_K` is the depth of cell :math:`K`, and :math:`\Upsilon_{KL}` is the standard TPFA transmissibility coefficient at the interface.
2021
The fluid density, :math:`\rho^{upw}`, and the fluid viscosity, :math:`\mu^{upw}`, are upwinded using the sign of the potential difference at the interface.
2122

22-
This is currently the only available discretization in the :ref:`CompositionalMultiphaseFlow`.
23+
For :ref:`CompositionalMultiphaseFlow` there are two options to compute the average density, :math:`\rho^{avg}`. The desired option can be selected using the `gravityDensityScheme` parameter:
24+
25+
#. `ArithmeticAverage`: :math:`\rho^{avg}` is computed using simple arithmetic average: :math:`\rho^{avg} = 0.5 \cdot (rho_K + rho_L)`, where :math:`rho_K` and :math:`rho_K` are densities in the two cells.
26+
27+
#. `PhasePresence`: average phase density is computed using checking for phase presence:
28+
29+
* :math:`\rho^{avg} = 0.5 \cdot (\rho_K + \rho_L)` if phase is present in both cells :math:`K` and :math:`L`
30+
31+
* :math:`\rho^{avg} = \rho_K` if phase is present only in cell :math:`K`
32+
33+
* :math:`\rho^{avg} = \rho_L` if phase is present only in cell :math:`L`
2334

2435
Hybrid FVM
2536
~~~~~~~~~~
2637

2738
This discretization scheme overcomes the limitations of the standard TPFA on non K-orthogonal meshes.
2839
The hybrid finite-volume scheme--equivalent to the well-known hybrid Mimetic Finite Difference (MFD) scheme--remains consistent with the pressure equation even when the mesh does not satisfy the K-orthogonality condition.
29-
This numerical scheme is currently implemented in the `SinglePhaseHybridFVM` solver.
3040

3141
The hybrid FVM scheme uses both cell-centered and face-centered pressure degrees of freedom.
3242
The one-sided face flux, :math:`F_{K,f}`, at face :math:`f` of cell :math:`K` is computed as:
@@ -60,5 +70,3 @@ For a given interior face :math:`f` between two neighboring cells :math:`K` and
6070
We obtain a numerical scheme with :math:`n_{\textit{cells}}` cell-centered degrees of freedom and :math:`n_{\textit{faces}}` face-centered pressure degrees of freedom.
6171
The system involves :math:`n_{\textit{cells}}` mass conservation equations and :math:`n_{\textit{faces}}` face-based constraints.
6272
The linear systems can be efficiently solved using the MultiGrid Reduction (MGR) preconditioner implemented in the Hypre linear algebra package.
63-
64-
The implementation of the hybrid FVM scheme for :ref:`CompositionalMultiphaseFlow` is in progress.

src/coreComponents/physicsSolvers/PhysicsSolverBase.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -458,15 +458,6 @@ real64 PhysicsSolverBase::setNextDtBasedOnNewtonIter( real64 const & currentDt )
458458
return nextDt;
459459
}
460460

461-
462-
real64 PhysicsSolverBase::setNextDtBasedOnCFL( const geos::real64 & currentDt, geos::DomainPartition & domain )
463-
{
464-
GEOS_UNUSED_VAR( currentDt, domain );
465-
return LvArray::NumericLimits< real64 >::max; // i.e., not implemented
466-
}
467-
468-
469-
470461
real64 PhysicsSolverBase::linearImplicitStep( real64 const & time_n,
471462
real64 const & dt,
472463
integer const GEOS_UNUSED_PARAM( cycleNumber ),

src/coreComponents/physicsSolvers/PhysicsSolverBase.hpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -239,17 +239,6 @@ class PhysicsSolverBase : public ExecutableGroup
239239
virtual real64 setNextDtBasedOnStateChange( real64 const & currentDt,
240240
DomainPartition & domain );
241241

242-
/**
243-
* @brief function to set the next dt based on state change
244-
* @param [in] currentDt the current time step size
245-
* @param[in] domain the domain object
246-
* @return the prescribed time step size
247-
*/
248-
virtual real64 setNextDtBasedOnCFL( real64 const & currentDt,
249-
DomainPartition & domain );
250-
251-
252-
253242
/**
254243
* @brief Entry function for an explicit time integration step
255244
* @param time_n time at the beginning of the step

0 commit comments

Comments
 (0)