Given that the number of solid solver modules is currently 1 and unlikely to exceed 3 it is not very useful to maintain solid and fluid sub-directories and easier to see the correspondence between the solver modules and tutorial cases without.
52 lines
1018 B
C++
52 lines
1018 B
C++
tmp<volScalarField::Internal> Sp
|
|
(
|
|
volScalarField::Internal::New
|
|
(
|
|
"Sp",
|
|
mesh,
|
|
dimensionedScalar(dgdt.dimensions(), 0)
|
|
)
|
|
);
|
|
|
|
tmp<volScalarField::Internal> Su
|
|
(
|
|
volScalarField::Internal::New
|
|
(
|
|
"Su",
|
|
mesh,
|
|
dimensionedScalar(dgdt.dimensions(), 0)
|
|
)
|
|
);
|
|
|
|
if (fvModels().addsSupToField(alpha1.name()))
|
|
{
|
|
// Phase change alpha1 source
|
|
const fvScalarMatrix alphaSup(fvModels().source(alpha1));
|
|
|
|
Su = alphaSup.Su();
|
|
Sp = alphaSup.Sp();
|
|
}
|
|
|
|
volScalarField::Internal& SpRef = Sp.ref();
|
|
volScalarField::Internal& SuRef = Su.ref();
|
|
|
|
forAll(dgdt, celli)
|
|
{
|
|
if (dgdt[celli] > 0.0)
|
|
{
|
|
SpRef[celli] -= dgdt[celli]/max(1.0 - alpha1[celli], 1e-4);
|
|
SuRef[celli] += dgdt[celli]/max(1.0 - alpha1[celli], 1e-4);
|
|
}
|
|
else if (dgdt[celli] < 0.0)
|
|
{
|
|
SpRef[celli] += dgdt[celli]/max(alpha1[celli], 1e-4);
|
|
}
|
|
}
|
|
|
|
tmp<volScalarField> divU
|
|
(
|
|
mesh.moving()
|
|
? fvc::div(phiCN() + mesh.phi())
|
|
: fvc::div(phiCN())
|
|
);
|