44 void Foam::solvers::multiphaseEuler::cellPressureCorrector()
55 PtrList<surfaceScalarField> alphafs(
phases.size());
58 const phaseModel& phase =
phases[phasei];
62 alphafs[phasei].rename(
"pEqn" + alphafs[phasei].
name());
73 PtrList<PtrList<volScalarField>> invADVs;
74 PtrList<PtrList<surfaceScalarField>> invADVfs;
85 UEqns[phase.index()].A()
88 max(phase.residualAlpha() -
alpha, scalar(0))
111 PtrList<surfaceScalarField> alphaByADfs;
112 PtrList<surfaceScalarField> FgByADfs;
129 movingAlphafs.
set(movingPhasei, &alphafs[phase.index()]);
135 + alphafs[phase.index()]
145 alphaByADfs = invADVfs & movingAlphafs;
146 FgByADfs = invADVfs & Fgfs;
155 PtrList<volVectorField> HbyADs;
167 UEqns[phase.index()].H()
170 max(phase.residualAlpha() -
alpha, scalar(0))
173 *phase.U()().oldTime()
176 if (HVms.set(movingPhasei))
178 Hs[movingPhasei] += HVms[movingPhasei];
182 HbyADs = invADVs & Hs;
201 alphaByADfs[movingPhasei]*mSfGradp
202 - FgByADfs[movingPhasei]
205 phase.URef().correctBoundaryConditions();
216 PtrList<volVectorField> HbyADs;
217 PtrList<surfaceScalarField> phiHbyADs;
224 PtrList<surfaceScalarField> ddtCorrs
237 UEqns[phase.index()].H()
240 max(phase.residualAlpha() -
alpha, scalar(0))
243 *phase.U()().oldTime()
246 if (HVms.set(movingPhasei))
248 Hs[movingPhasei] += HVms[movingPhasei];
254 fvc::flux(Hs[movingPhasei]) + ddtCorrs[phase.index()]
258 HbyADs = invADVs & Hs;
259 phiHbyADs = invADVfs & phiHs;
269 phiHbyADs[movingPhasei] -= FgByADfs[movingPhasei];
289 phiHbyA += alphafs[phase.index()]*phiHbyADs[movingPhasei];
312 rAf += alphafs[phase.index()]*alphaByADfs[movingPhasei];
329 alphafs[phase.index()].boundaryField()
330 *phase.phi()().boundaryField();
333 setSnGrad<fixedFluxPressureFvPatchScalarField>
343 PtrList<fvScalarMatrix> pEqnComps(compressibilityEqns(dmdts));
364 pEqn += pEqnComps[phasei];
393 phiHbyADs[movingPhasei]
394 + alphaByADfs[movingPhasei]*mSfGradp;
397 phase.divU(-pEqnComps[phase.index()] &
p_rgh);
406 mSfGradp = pEqnIncomp.flux()/rAf;
414 PtrList<volVectorField> dragCorrByADs
419 PtrList<surfaceScalarField> dragCorrByADfs
421 invADVfs & dragCorrfs
432 alphaByADfs[movingPhasei]*mSfGradp
433 - FgByADfs[movingPhasei]
434 + dragCorrByADfs[movingPhasei]
436 - dragCorrByADs[movingPhasei];
449 alphaByADfs[movingPhasei]*mSfGradp
450 - FgByADfs[movingPhasei]
459 phase.URef().correctBoundaryConditions();
488 phaseModel& phase =
phases_[phasei];
489 if (!phase.incompressible())
491 phase.rho() += phase.fluidThermo().psi()*(
p_rgh - p_rgh_0);
#define forAll(list, i)
Loop across all elements in list.
static const DimensionedField< Type, GeoMesh, PrimitiveField > & null()
Return a null DimensionedField.
const dimensionSet & dimensions() const
Return dimensions.
void relax(const scalar alpha)
Relax field (for steady-state solution).
const Boundary & boundaryField() const
Return const-reference to the boundary field.
bool needReference() const
Does the field need a reference level for solution.
GeometricBoundaryField< Type, GeoMesh, PrimitiveField > Boundary
Type of the 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.
bool set(const label) const
Is element set.
label size() const
Return the number of elements in the UPtrList.
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.
void dragCorrs(PtrList< volVectorField > &dragCorrs, PtrList< surfaceScalarField > &dragCorrf) const
Set the cell and faces drag correction fields.
PtrList< surfaceScalarField > ddtCorrs() const
Return the flux corrections for the cell-based algorithm. These.
PtrList< surfaceScalarField > Fs() const
Return the explicit force fluxes for the cell-based algorithm, that.
bool finalNonOrthogonalIter() const
Flag to indicate the last non-orthogonal iteration.
tmp< surfaceScalarField > surfaceTension(const phaseModel &) const
Return the surface tension force.
void correctBoundaryFlux()
Correct fixed-flux BCs to be consistent with the velocity BCs.
bool implicitPhasePressure() const
Returns true if the phase pressure is treated implicitly.
tmp< volScalarField > rho() const
Return the mixture density.
bool incompressible() const
Return incompressibility.
bool correct()
Piso loop within outer loop.
bool correctNonOrthogonal()
Non-orthogonal corrector loop.
PtrList< volScalarField::Internal > dmdts() const
Return the mass transfer rates for each phase.
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
uniformDimensionedScalarField pRef
Reference pressure.
surfaceScalarField ghf
(g & hf) - ghRef
const surfaceScalarField & phi
Reference to the mass-flux field.
const volScalarField & p_rgh
Reference to the buoyant pressure for buoyant cases.
solvers::buoyancy buoyancy
Buoyancy force.
phaseSystem::phaseModelList & phases_
PtrList< fvVectorMatrix > UEqns
Temporary phase momentum matrices.
const phaseSystem::phaseModelPartialList & movingPhases
Reference to the moving phases.
const IOMRFZoneList & MRF
Switch predictMomentum
Momentum equation predictor switch.
momentumTransferSystem momentumTransferSystem_
surfaceScalarField & phi_
Switch dragCorrection
Cell/face drag correction for cell momentum corrector.
volScalarField & p_rgh_
Reference to the buoyant pressure for buoyant cases.
Foam::pressureReference pressureReference
Pressure reference.
PtrList< volScalarField > rAs
Temporary storage for the reciprocal momentum equation diagonal.
const phaseSystem::phaseModelList & phases
Reference to the phases.
phaseSystem::phaseModelPartialList & movingPhases_
const volScalarField & p
Reference to the pressure field.
populationBalanceSystem populationBalanceSystem_
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)
fvMatrix< scalar > fvScalarMatrix
const dimensionSet dimVolumetricFlux
SurfaceField< scalar > surfaceScalarField
tmp< volScalarField > byDt(const volScalarField &vf)
void constrainHbyA(volVectorField &HbyA, const volVectorField &U, const volScalarField &p)
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.
void constrainPhiHbyA(surfaceScalarField &phiHbyA, const volVectorField &U, const volScalarField &p)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.