solvers: Provided public constant access to state fields

This commit is contained in:
Henry Weller
2023-04-08 16:05:39 +01:00
parent 59218933a3
commit fb052b9d79
23 changed files with 126 additions and 88 deletions

View File

@ -88,8 +88,8 @@ Foam::solvers::VoFSolver::VoFSolver
:
fluidSolver(mesh),
mixture_(mixturePtr),
mixture(mixture_()),
mixturePtr_(mixturePtr),
mixture_(mixturePtr_()),
divAlphaName("div(phi,alpha)"),
@ -106,7 +106,7 @@ Foam::solvers::VoFSolver::VoFSolver
mesh
),
phi
phi_
(
IOobject
(
@ -123,7 +123,7 @@ Foam::solvers::VoFSolver::VoFSolver
p_rgh(buoyancy.p_rgh),
rho(mixture.rho()),
rho(mixture_.rho()),
rhoPhi
(
@ -140,7 +140,9 @@ Foam::solvers::VoFSolver::VoFSolver
MRF(mesh),
U(U_)
mixture(mixture_),
U(U_),
phi(phi_)
{
mesh.schemes().setFluxRequired(p_rgh.name());

View File

@ -78,9 +78,9 @@ protected:
// Phase properties
//- The compressible two-phase mixture
autoPtr<VoFMixture> mixture_;
autoPtr<VoFMixture> mixturePtr_;
VoFMixture& mixture;
VoFMixture& mixture_;
//- Name of the alpha convection scheme
const word divAlphaName;
@ -95,7 +95,7 @@ protected:
volVectorField U_;
//- Volumetric flux field
surfaceScalarField phi;
surfaceScalarField phi_;
// Thermophysical properties
@ -201,13 +201,17 @@ protected:
public:
// Access to the physical state
// Public Data
//- Velocity field
//- Reference to the VoF mixture
const VoFMixture& mixture;
//- Reference to the velocity field
const volVectorField& U;
//- Reference to the mass-flux field
const surfaceScalarField& phi;
public:
//- Runtime type information
TypeName("VoFSolver");

View File

@ -62,15 +62,15 @@ void Foam::solvers::VoFSolver::moveMesh()
{
// Calculate absolute flux
// from the mapped surface velocity
phi = mesh.Sf() & Uf();
phi_ = mesh.Sf() & Uf();
correctUphiBCs(U_, phi, true);
correctUphiBCs(U_, phi_, true);
if (incompressible())
{
fv::correctPhi
(
phi,
phi_,
U,
p_rgh,
rAU,
@ -83,7 +83,7 @@ void Foam::solvers::VoFSolver::moveMesh()
{
fv::correctPhi
(
phi,
phi_,
p_rgh,
psiByRho(),
rAU,
@ -93,7 +93,7 @@ void Foam::solvers::VoFSolver::moveMesh()
}
// Make the fluxes relative to the mesh motion
fvc::makeRelative(phi, U);
fvc::makeRelative(phi_, U);
}
meshCourantNo();