44 void Foam::solvers::multiphaseEuler::cellPressureCorrector()
49 PtrList<surfaceScalarField> alphafs(
phases.size());
52 const phaseModel& phase =
phases[phasei];
56 alphafs[phasei].rename(
"pEqn" + alphafs[phasei].
name());
66 PtrList<volScalarField> Kds(
fluid.
Kds());
75 UEqns[phase.index()].A()
78 max(phase.residualAlpha() -
alpha, scalar(0))
83 if (Kds.set(phase.index()))
85 AU += Kds[phase.index()];
105 PtrList<surfaceScalarField> alpharAUfs(
phases.size());
108 const phaseModel& phase =
phases[phasei];
122 PtrList<surfaceScalarField> Fs(
fluid.
Fs());
140 PtrList<surfaceScalarField> phigFs(
phases.size());
150 const phaseModel& phase =
phases[phasei];
168 PtrList<volVectorField> HbyAs(
phases.size());
169 PtrList<surfaceScalarField> phiHbyAs(
phases.size());
178 const label phasei = phase.index();
187 max(phase.residualAlpha() -
alpha, scalar(0))
190 *phase.U()().oldTime(),
197 HbyAs.set(phasei,
rAUs[phasei]*H);
206 - alpharAUfs[phasei]*phigFs[phasei]
207 -
rAUfs[phasei]*Fs[phasei]
216 PtrList<volVectorField> KdUs(
fluid.
KdUs());
217 PtrList<surfaceScalarField> KdPhis(
fluid.
KdPhis());
221 if (KdUs.set(phasei))
223 HbyAs[phasei] -=
rAUs[phasei]*KdUs[phasei];
226 if (KdPhis.set(phasei))
228 phiHbyAs[phasei] -=
rAUfs[phasei]*KdPhis[phasei];
249 phiHbyA += alphafs[phasei]*phiHbyAs[phasei];
270 rAUf += alphafs[phasei]*alpharAUfs[phasei];
284 const phaseModel& phase =
phases[phasei];
286 alphafs[phasei].boundaryField()
287 *phase.phi()().boundaryField();
290 setSnGrad<fixedFluxPressureFvPatchScalarField>
300 PtrList<fvScalarMatrix> pEqnComps(compressibilityEqns(dmdts, d2mdtdps));
321 pEqn += pEqnComps[phasei];
350 phiHbyAs[phase.index()]
351 + alpharAUfs[phase.index()]*mSfGradp;
354 phase.divU(-pEqnComps[phase.index()] &
p_rgh);
360 mSfGradp = pEqnIncomp.flux()/rAUf;
367 const label phasei = phase.index();
373 alpharAUfs[phasei]*(mSfGradp - phigFs[phasei])
374 -
rAUfs[phasei]*Fs[phasei]
380 PtrList<volVectorField> dragCorrs(
phases.size());
381 PtrList<surfaceScalarField> dragCorrfs(
phases.size());
387 const label phasei = phase.index();
393 alpharAUfs[phasei]*(mSfGradp - phigFs[phasei])
394 +
rAUfs[phasei]*(dragCorrfs[phasei] - Fs[phasei])
396 -
rAUs[phasei]*dragCorrs[phasei];
426 phase.URef().correctBoundaryConditions();
455 phaseModel& phase =
phases_[phasei];
456 phase.rho() += phase.thermo().psi()*(
p_rgh - p_rgh_0);
462 if (dmdts.set(phasei) && d2mdtdps.set(phasei))
464 dmdts[phasei] += d2mdtdps[phasei]*(
p_rgh - p_rgh_0);
#define forAll(list, i)
Loop across all elements in list.
const dimensionSet & dimensions() const
Return dimensions.
static const DimensionedField< Type, GeoMesh > & null()
Return a null DimensionedField.
void relax(const scalar alpha)
Relax field (for steady-state solution).
GeometricBoundaryField< Type, PatchField, GeoMesh > Boundary
Type of the boundary field.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
bool needReference() const
Does the field need a reference level for solution.
void correctBoundaryConditions()
Correct boundary field.
Boundary & boundaryFieldRef()
Return a reference to the boundary field.
IOobject(const word &name, const fileName &instance, const objectRegistry ®istry, readOption r=NO_READ, writeOption w=NO_WRITE, bool registerObject=true)
Construct from name, instance, registry, io options.
const word & name() const
Return name.
static word groupName(Name name, const word &group)
void makeRelative(volVectorField &U) const
Make the given absolute velocity relative within the MRF region.
autoPtr< T > set(const label, const word &key, T *)
Set element to pointer provided and return old element.
const word & name() const
Return const reference to name.
bool constrain(fvMatrix< Type > &eqn) const
Apply constraints to an equation.
const surfaceVectorField & Sf() const
Return cell face area vectors.
const surfaceScalarField & magSf() const
Return cell face area magnitudes.
bool finalNonOrthogonalIter() const
Flag to indicate the last non-orthogonal iteration.
virtual PtrList< surfaceScalarField > KdPhis() const =0
Return the force fluxes for the cell-based algorithm.
virtual PtrList< volScalarField > Kds() const =0
Return the implicit part of the drag force.
virtual PtrList< surfaceScalarField > ddtCorrs() const =0
Return the flux corrections for the cell-based algorithm.
virtual PtrList< volVectorField > KdUs() const =0
Return the explicit part of the drag force.
const phaseModelPartialList & movingPhases() const
Return the models for phases that are moving.
void correctBoundaryFlux()
Correct fixed-flux BCs to be consistent with the velocity BCs.
virtual bool implicitPhasePressure(const phaseModel &phase) const
Returns true if the phase pressure is treated implicitly.
virtual void dragCorrs(PtrList< volVectorField > &dragCorrs, PtrList< surfaceScalarField > &dragCorrf) const =0
Set the cell and faces drag correction fields.
void fillFields(const word &name, const dimensionSet &dims, PtrList< GeometricField< Type, PatchField, GeoMesh >> &fieldList) const
Fill up gaps in a phase-indexed list of fields with zeros.
virtual PtrList< volScalarField > dmdts() const
Return the mass transfer rates for each phase.
virtual PtrList< surfaceScalarField > Fs() const =0
Return the force fluxes for the cell-based algorithm.
tmp< surfaceScalarField > surfaceTension(const phaseModel &phase) const
Return the surface tension force.
virtual void partialElimination(const PtrList< volScalarField > &rAUs, const PtrList< volVectorField > &KdUs, const PtrList< surfaceScalarField > &alphafs, const PtrList< surfaceScalarField > &rAUfs, const PtrList< surfaceScalarField > &KdPhis)=0
Solve the drag system for the new velocities and fluxes.
tmp< volScalarField > rho() const
Return the mixture density.
virtual PtrList< volScalarField > d2mdtdps() const
Return the mass transfer pressure implicit coefficients.
bool incompressible() const
Return incompressibility.
bool correct()
Piso loop within outer loop.
bool correctNonOrthogonal()
Non-orthogonal corrector loop.
scalar refValue() const
Return the pressure reference level.
label refCell() const
Return the cell in which the reference pressure is set.
pimpleNoLoopControl pimple
PIMPLE inner-loop controls.
Foam::fvConstraints & fvConstraints() const
Return the fvConstraints that are created on demand.
const Time & runTime
Time.
const fvMesh & mesh
Region mesh.
uniformDimensionedVectorField g
Gravitational acceleration.
volScalarField gh
(g & h) - ghRef
surfaceScalarField ghf
(g & hf) - ghRef
volScalarField & p_rgh
Reference to the buoyant pressure for buoyant cases.
const surfaceScalarField & phi
Reference to the mass-flux field.
solvers::buoyancy buoyancy
Buoyancy force.
phaseSystem::phaseModelList & phases_
Switch partialElimination
Partial elimination drag contribution optimisation.
PtrList< fvVectorMatrix > UEqns
Temporary phase momentum matrices.
const IOMRFZoneList & MRF
surfaceScalarField & phi_
Switch dragCorrection
Cell/face drag correction for cell momentum corrector.
PtrList< surfaceScalarField > rAUfs
Temporary storage for the reciprocal momentum equation diagonal.
PtrList< volScalarField > rAUs
Temporary storage for the reciprocal momentum equation diagonal.
Foam::pressureReference pressureReference
Pressure reference.
const phaseSystem::phaseModelList & phases
Reference to the phases.
const volScalarField & p
Reference to the pressure field.
const phaseSystem & fluid
Reference to the multiphase fluid.
Find the reference cell nearest (in index) to the given cell but which is not on a cyclic,...
Calculate the first temporal derivative.
Calculate the divergence of the given field.
Calculate the face-flux of the given field.
Calculate the mesh motion flux and convert fluxes from absolute to relative and back.
Reconstruct volField from a face flux field.
Calculate the snGrad of the given volField.
Calculate the field for explicit evaluation of implicit and explicit sources.
Calculate the matrix for the first temporal derivative.
Calculate the matrix for the divergence of the given field and flux.
Calculate the matrix for the laplacian of the field.
Calculate the matrix for implicit and explicit sources.
surfaceScalarField phiHbyA("phiHbyA", fvc::interpolate(rho) *fvc::flux(HbyA))
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
tmp< SurfaceField< typename innerProduct< vector, Type >::type > > flux(const VolField< Type > &vf)
Return the face-flux field obtained from the given volVectorField.
static tmp< SurfaceField< Type > > interpolate(const VolField< Type > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
tmp< VolField< typename outerProduct< vector, Type >::type > > reconstruct(const SurfaceField< Type > &ssf)
tmp< VolField< Type > > div(const SurfaceField< Type > &ssf)
void makeRelative(surfaceScalarField &phi, const volVectorField &U)
Make the given flux relative.
tmp< SurfaceField< Type > > snGrad(const VolField< Type > &vf, const word &name)
tmp< fvMatrix< Type > > laplacian(const VolField< Type > &vf, const word &name)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
VolField< vector > volVectorField
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
fvMatrix< scalar > fvScalarMatrix
SurfaceField< scalar > surfaceScalarField
const dimensionSet dimForce
tmp< volScalarField > byDt(const volScalarField &vf)
const dimensionSet dimTime
const dimensionSet dimDensity
VolField< scalar > volScalarField
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
scalar getRefCellValue(const volScalarField &field, const label refCelli)
Return the current value of field in the reference cell.
const dimensionSet dimVelocity
const dimensionSet dimFlux
tmp< volVectorField > constrainH(const tmp< volVectorField > &tH, const volScalarField &rA, const volVectorField &U, const volScalarField &p)