Commit eda41a68 authored by sergio's avatar sergio

ENH: Changing energy Eq in interCondensatingEvaporatingFoam

from e to T. T proved to be more generic solution.
parent 7dc44ae0
fvVectorMatrix UEqn
(
fvm::ddt(rho, U)
+ fvm::div(rhoPhi, U)
+ turbulence->divDevRhoReff(rho, U)
);
UEqn.relax();
if (pimple.momentumPredictor())
{
solve
(
UEqn
==
fvc::reconstruct
(
(
interface.surfaceTensionForce()
- ghf*fvc::snGrad(rho)
- fvc::snGrad(p_rgh)
) * mesh.magSf()
)
);
}
......@@ -40,9 +40,6 @@ autoPtr<temperaturePhaseChangeTwoPhaseMixture> mixture =
temperaturePhaseChangeTwoPhaseMixture::New(thermo(), mesh);
// Correct e from T and alpha
//thermo->correct();
volScalarField& alpha1(thermo->alpha1());
volScalarField& alpha2(thermo->alpha2());
......@@ -139,3 +136,17 @@ volScalarField pDivU
dimensionedScalar(p.dimensions()/dimTime, Zero)
);
// Need to store rho for ddt(rhoCp, U)
volScalarField rhoCp
(
IOobject
(
"rhoCp",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
rho*thermo->Cp()
);
rhoCp.oldTime();
{
tmp<volScalarField> tcp(thermo->Cp());
const volScalarField& cp = tcp();
rhoCp = rho*cp;
kappaEff = thermo->kappa() + rho*cp*turbulence->nut()/Prt;
......@@ -11,18 +12,26 @@
pDivU = (p*fvc::div(rhoPhi/fvc::interpolate(rho)));
}
fvScalarMatrix eEqn
const surfaceScalarField rhoCpPhi(fvc::interpolate(cp)*rhoPhi);
Pair<tmp<volScalarField>> vDotAlphal = mixture->mDot();
const volScalarField& vDotcAlphal = vDotAlphal[0]();
const volScalarField& vDotvAlphal = vDotAlphal[1]();
const volScalarField vDotvmcAlphal(vDotvAlphal - vDotcAlphal);
fvScalarMatrix TEqn
(
fvm::ddt(rho, e)
+ fvm::div(rhoPhi, e)
- fvm::laplacian(kappaEff/cp, e)
+ pDivU
fvm::ddt(rhoCp, T)
+ fvm::div(rhoCpPhi, T, "div(rhoCpPhi,T)")
- fvm::Sp(fvc::ddt(rhoCp) + fvc::div(rhoCpPhi), T)
- fvm::laplacian(kappaEff, T)
+ thermo->hc()*vDotvmcAlphal
+ pDivU
);
eEqn.relax();
eEqn.solve();
thermo->correct();
TEqn.relax();
TEqn.solve();
Info<< "min/max(T) = " << min(T).value() << ", "
<< max(T).value() <<endl;
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2016-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -79,8 +79,6 @@ int main(int argc, char *argv[])
#include "setInitialDeltaT.H"
volScalarField& T = thermo->T();
volScalarField& e = thermo->he();
e.oldTime();
turbulence->validate();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment