BUG: Caching alphaPhiUn for VoF for scalarTransport FOcin mixture. #2053

This commit is contained in:
sergio
2021-07-12 14:22:08 -07:00
parent 20ca8e8aac
commit c1c1799051
6 changed files with 23 additions and 56 deletions

View File

@ -161,12 +161,11 @@
surfaceScalarField phir(phic*mixture.nHatf()); surfaceScalarField phir(phic*mixture.nHatf());
tmp<surfaceScalarField> talphaPhi1Un alphaPhiUn =
(
fvc::flux fvc::flux
( (
phiCN(), phi,
cnCoeff*alpha1 + (1.0 - cnCoeff)*alpha1.oldTime(), alpha1,
alphaScheme alphaScheme
) )
+ fvc::flux + fvc::flux
@ -174,19 +173,18 @@
-fvc::flux(-phir, alpha2, alpharScheme), -fvc::flux(-phir, alpha2, alpharScheme),
alpha1, alpha1,
alpharScheme alpharScheme
) );
);
if (MULESCorr) if (MULESCorr)
{ {
tmp<surfaceScalarField> talphaPhi1Corr(talphaPhi1Un() - alphaPhi10); tmp<surfaceScalarField> talphaPhi1Corr(alphaPhiUn - alphaPhi10);
volScalarField alpha10("alpha10", alpha1); volScalarField alpha10("alpha10", alpha1);
MULES::correct MULES::correct
( (
geometricOneField(), geometricOneField(),
alpha1, alpha1,
talphaPhi1Un(), alphaPhiUn,
talphaPhi1Corr.ref(), talphaPhi1Corr.ref(),
Sp, Sp,
(-Sp*alpha1)(), (-Sp*alpha1)(),
@ -207,7 +205,7 @@
} }
else else
{ {
alphaPhi10 = talphaPhi1Un; alphaPhi10 = alphaPhiUn;
MULES::explicitSolve MULES::explicitSolve
( (

View File

@ -24,3 +24,18 @@ surfaceScalarField alphaPhi10
// MULES Correction // MULES Correction
tmp<surfaceScalarField> talphaPhi1Corr0; tmp<surfaceScalarField> talphaPhi1Corr0;
// MULES compressed flux is registered in case scalarTransport FO needs it.
surfaceScalarField alphaPhiUn
(
IOobject
(
"alphaPhiUn",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar(phi.dimensions(), Zero)
);

View File

@ -120,21 +120,6 @@ if (p_rgh.needReference())
mesh.setFluxRequired(p_rgh.name()); mesh.setFluxRequired(p_rgh.name());
mesh.setFluxRequired(alpha1.name()); mesh.setFluxRequired(alpha1.name());
// MULES compressed flux is registered in case scalarTransport FO needs it.
surfaceScalarField alphaPhiUn
(
IOobject
(
"alphaPhiUn",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar(phi.dimensions(), Zero)
);
#include "createMRF.H" #include "createMRF.H"
#include "createFvOptions.H" #include "createFvOptions.H"

View File

@ -126,20 +126,5 @@ if (p_rgh.needReference())
mesh.setFluxRequired(p_rgh.name()); mesh.setFluxRequired(p_rgh.name());
mesh.setFluxRequired(alpha1.name()); mesh.setFluxRequired(alpha1.name());
// MULES compressed flux is registered in case scalarTransport FO needs it.
surfaceScalarField alphaPhiUn
(
IOobject
(
"alphaPhiUn",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar(phi.dimensions(), Zero)
);
#include "createMRF.H" #include "createMRF.H"
#include "createFvOptions.H" #include "createFvOptions.H"

View File

@ -147,19 +147,4 @@ if (p_rgh.needReference())
mesh.setFluxRequired(p_rgh.name()); mesh.setFluxRequired(p_rgh.name());
mesh.setFluxRequired(alpha1.name()); mesh.setFluxRequired(alpha1.name());
// MULES compressed flux is registered in case scalarTransport FO needs it.
surfaceScalarField alphaPhiUn
(
IOobject
(
"alphaPhiUn",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar(phi.dimensions(), Zero)
);
#include "createMRF.H" #include "createMRF.H"

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2016-2020 OpenCFD Ltd. Copyright (C) 2016-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -202,7 +202,6 @@ void reactingOneDim::updateFields()
updateqr(); updateqr();
} }
//Note: Commented out as the sensible gas energy is included in energy eq.
updatePhiGas(); updatePhiGas();
} }