mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
reactingMultiphaseEulerFoam: Correct and test LTS support
This commit is contained in:
@ -71,6 +71,8 @@ void Foam::multiphaseSystem::calcAlphas()
|
|||||||
|
|
||||||
void Foam::multiphaseSystem::solveAlphas()
|
void Foam::multiphaseSystem::solveAlphas()
|
||||||
{
|
{
|
||||||
|
bool LTS = fv::localEulerDdt::enabled(mesh_);
|
||||||
|
|
||||||
PtrList<surfaceScalarField> alphaPhiCorrs(phases().size());
|
PtrList<surfaceScalarField> alphaPhiCorrs(phases().size());
|
||||||
forAll(phases(), phasei)
|
forAll(phases(), phasei)
|
||||||
{
|
{
|
||||||
@ -155,14 +157,11 @@ void Foam::multiphaseSystem::solveAlphas()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fv::localEulerDdt::enabled(mesh_))
|
if (LTS)
|
||||||
{
|
{
|
||||||
const volScalarField& rDeltaT =
|
|
||||||
fv::localEulerDdt::localRDeltaT(mesh_);
|
|
||||||
|
|
||||||
MULES::limit
|
MULES::limit
|
||||||
(
|
(
|
||||||
rDeltaT,
|
fv::localEulerDdt::localRDeltaT(mesh_),
|
||||||
geometricOneField(),
|
geometricOneField(),
|
||||||
phase,
|
phase,
|
||||||
phi_,
|
phi_,
|
||||||
@ -636,8 +635,6 @@ void Foam::multiphaseSystem::solve()
|
|||||||
fv::localEulerDdt::localRSubDeltaT(mesh_, nAlphaSubCycles);
|
fv::localEulerDdt::localRSubDeltaT(mesh_, nAlphaSubCycles);
|
||||||
}
|
}
|
||||||
|
|
||||||
dimensionedScalar totalDeltaT = runTime.deltaT();
|
|
||||||
|
|
||||||
PtrList<volScalarField> alpha0s(phases().size());
|
PtrList<volScalarField> alpha0s(phases().size());
|
||||||
PtrList<surfaceScalarField> alphaPhiSums(phases().size());
|
PtrList<surfaceScalarField> alphaPhiSums(phases().size());
|
||||||
|
|
||||||
|
|||||||
@ -186,18 +186,17 @@ Foam::twoPhaseSystem::dmdt() const
|
|||||||
|
|
||||||
void Foam::twoPhaseSystem::solve()
|
void Foam::twoPhaseSystem::solve()
|
||||||
{
|
{
|
||||||
const fvMesh& mesh = this->mesh();
|
const Time& runTime = mesh_.time();
|
||||||
const Time& runTime = mesh.time();
|
|
||||||
|
|
||||||
volScalarField& alpha1 = phase1_;
|
volScalarField& alpha1 = phase1_;
|
||||||
volScalarField& alpha2 = phase2_;
|
volScalarField& alpha2 = phase2_;
|
||||||
|
|
||||||
const dictionary& alphaControls = mesh.solverDict(alpha1.name());
|
const dictionary& alphaControls = mesh_.solverDict(alpha1.name());
|
||||||
|
|
||||||
label nAlphaSubCycles(readLabel(alphaControls.lookup("nAlphaSubCycles")));
|
label nAlphaSubCycles(readLabel(alphaControls.lookup("nAlphaSubCycles")));
|
||||||
label nAlphaCorr(readLabel(alphaControls.lookup("nAlphaCorr")));
|
label nAlphaCorr(readLabel(alphaControls.lookup("nAlphaCorr")));
|
||||||
|
|
||||||
bool LTS = fv::localEulerDdt::enabled(mesh);
|
bool LTS = fv::localEulerDdt::enabled(mesh_);
|
||||||
|
|
||||||
word alphaScheme("div(phi," + alpha1.name() + ')');
|
word alphaScheme("div(phi," + alpha1.name() + ')');
|
||||||
word alpharScheme("div(phir," + alpha1.name() + ')');
|
word alpharScheme("div(phir," + alpha1.name() + ')');
|
||||||
@ -264,9 +263,9 @@ void Foam::twoPhaseSystem::solve()
|
|||||||
(
|
(
|
||||||
"Sp",
|
"Sp",
|
||||||
runTime.timeName(),
|
runTime.timeName(),
|
||||||
mesh
|
mesh_
|
||||||
),
|
),
|
||||||
mesh,
|
mesh_,
|
||||||
dimensionedScalar("Sp", dimless/dimTime, 0.0)
|
dimensionedScalar("Sp", dimless/dimTime, 0.0)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -276,7 +275,7 @@ void Foam::twoPhaseSystem::solve()
|
|||||||
(
|
(
|
||||||
"Su",
|
"Su",
|
||||||
runTime.timeName(),
|
runTime.timeName(),
|
||||||
mesh
|
mesh_
|
||||||
),
|
),
|
||||||
// Divergence term is handled explicitly to be
|
// Divergence term is handled explicitly to be
|
||||||
// consistent with the explicit transport solution
|
// consistent with the explicit transport solution
|
||||||
@ -345,7 +344,7 @@ void Foam::twoPhaseSystem::solve()
|
|||||||
if (LTS)
|
if (LTS)
|
||||||
{
|
{
|
||||||
trSubDeltaT =
|
trSubDeltaT =
|
||||||
fv::localEulerDdt::localRSubDeltaT(mesh, nAlphaSubCycles);
|
fv::localEulerDdt::localRSubDeltaT(mesh_, nAlphaSubCycles);
|
||||||
}
|
}
|
||||||
|
|
||||||
for
|
for
|
||||||
@ -420,7 +419,7 @@ void Foam::twoPhaseSystem::solve()
|
|||||||
fvc::interpolate(phase2_.rho())*phase2_.alphaPhi();
|
fvc::interpolate(phase2_.rho())*phase2_.alphaPhi();
|
||||||
|
|
||||||
Info<< alpha1.name() << " volume fraction = "
|
Info<< alpha1.name() << " volume fraction = "
|
||||||
<< alpha1.weightedAverage(mesh.V()).value()
|
<< alpha1.weightedAverage(mesh_.V()).value()
|
||||||
<< " Min(alpha1) = " << min(alpha1).value()
|
<< " Min(alpha1) = " << min(alpha1).value()
|
||||||
<< " Max(alpha1) = " << max(alpha1).value()
|
<< " Max(alpha1) = " << max(alpha1).value()
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|||||||
@ -89,8 +89,17 @@ void Foam::MULES::explicitSolve
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
const fvMesh& mesh = psi.mesh();
|
const fvMesh& mesh = psi.mesh();
|
||||||
const scalar rDeltaT = 1.0/mesh.time().deltaTValue();
|
|
||||||
explicitSolve(rDeltaT, rho, psi, phiPsi, Sp, Su);
|
if (fv::localEulerDdt::enabled(mesh))
|
||||||
|
{
|
||||||
|
const volScalarField& rDeltaT = fv::localEulerDdt::localRDeltaT(mesh);
|
||||||
|
explicitSolve(rDeltaT, rho, psi, phiPsi, Sp, Su);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const scalar rDeltaT = 1.0/mesh.time().deltaTValue();
|
||||||
|
explicitSolve(rDeltaT, rho, psi, phiPsi, Sp, Su);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user