openfoam/applications/solvers/multiphase/compressibleInterFoam/compressibleInterIsoFoam/alphaSuSp.H
Mark Olesen 5cf80f96e9 COMP: namespace qualify min/max functions (#3348)
FIX: missing patch face index writeFields (#3347)
2025-04-09 15:03:43 +02:00

44 lines
761 B
C

volScalarField::Internal Sp
(
IOobject
(
"Sp",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar(dgdt.dimensions(), Zero)
);
volScalarField::Internal Su
(
IOobject
(
"Su",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar(dgdt.dimensions(), Zero)
);
forAll(dgdt, celli)
{
if (dgdt[celli] > 0.0)
{
Sp[celli] -= dgdt[celli]/Foam::max(1.0 - alpha1[celli], 1e-4);
Su[celli] += dgdt[celli]/Foam::max(1.0 - alpha1[celli], 1e-4);
}
else if (dgdt[celli] < 0.0)
{
Sp[celli] += dgdt[celli]/Foam::max(alpha1[celli], 1e-4);
}
}
volScalarField::Internal divU
(
mesh.moving()
? fvc::div(phi + mesh.phi())
: fvc::div(phi)
);