Commit a114345e authored by Henry's avatar Henry
Browse files

Thermodynamics and sub-models: Removed "Sp" boundedness corrections on...

Thermodynamics and sub-models:  Removed "Sp" boundedness corrections on transport, replaced with "bounded Gauss" scheme
parent 1d83996c
......@@ -4,7 +4,6 @@ tmp<fvVectorMatrix> UEqn
(
fvm::ddt(rho, U)
+ fvm::div(phi, U)
- fvm::Sp(fvc::ddt(rho) + fvc::div(phi), U)
+ turbulence->divDevRhoReff(U)
);
......
......@@ -3,14 +3,10 @@
(
fvm::ddt(rho, h)
+ fvm::div(phi, h)
- fvm::Sp(fvc::ddt(rho) + fvc::div(phi), h)
- fvm::laplacian(turbulence->alphaEff(), h)
==
dpdt
- (
fvc::ddt(rho, K) + fvc::div(phi, K)
- (fvc::ddt(rho) + fvc::div(phi))*K
)
- fvc::ddt(rho, K) + fvc::div(phi, K)
);
hEqn.relax();
......
......@@ -3,7 +3,6 @@
tmp<fvVectorMatrix> UEqn
(
fvm::div(phi, U)
- fvm::Sp(fvc::div(phi), U)
+ turbulence->divDevRhoReff(U)
);
......
......@@ -7,7 +7,6 @@
fvScalarMatrix TEqn
(
fvm::div(phi, T)
- fvm::Sp(fvc::div(phi), T)
- fvm::laplacian(kappaEff, T)
);
......
......@@ -2,7 +2,6 @@
fvScalarMatrix hEqn
(
fvm::div(phi, h)
- fvm::Sp(fvc::div(phi), h)
- fvm::laplacian(turb.alphaEff(), h)
==
- fvc::div(phi, 0.5*magSqr(U), "div(phi,K)")
......
......@@ -7,23 +7,31 @@
volScalarField rAU(1.0/UEqn().A());
surfaceScalarField rhorAUf("Dp", fvc::interpolate(rho*rAU));
U = rAU*UEqn().H();
volVectorField HbyA("HbyA", U);
HbyA = rAU*UEqn().H();
UEqn.clear();
phi = fvc::interpolate(rho)*(fvc::interpolate(U) & mesh.Sf());
bool closedVolume = adjustPhi(phi, U, p_rgh);
surfaceScalarField phig(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf());
surfaceScalarField phiHbyA
(
"phiHbyA",
fvc::interpolate(rho)*(fvc::interpolate(HbyA) & mesh.Sf())
);
bool closedVolume = adjustPhi(phiHbyA, U, p_rgh);
phiHbyA += phig;
dimensionedScalar compressibility = fvc::domainIntegrate(psi);
bool compressible = (compressibility.value() > SMALL);
surfaceScalarField phig(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf());
phi += phig;
// Solve pressure
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix p_rghEqn
(
fvm::laplacian(rhorAUf, p_rgh) == fvc::div(phi)
fvm::laplacian(rhorAUf, p_rgh) == fvc::div(phiHbyA)
);
p_rghEqn.setReference
......@@ -37,14 +45,14 @@
if (nonOrth == nNonOrthCorr)
{
// Calculate the conservative fluxes
phi -= p_rghEqn.flux();
phi = phiHbyA - p_rghEqn.flux();
// Explicitly relax pressure for momentum corrector
p_rgh.relax();
// Correct the momentum source with the pressure gradient flux
// calculated from the relaxed pressure
U += rAU*fvc::reconstruct((phig - p_rghEqn.flux())/rhorAUf);
U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/rhorAUf);
U.correctBoundaryConditions();
}
}
......
......@@ -2,7 +2,6 @@
fvScalarMatrix hPorousEqn
(
fvm::div(porousPhi, porousH)
- fvm::Sp(fvc::div(porousPhi), porousH)
- fvm::laplacian(turbPorous.alphaEff(), porousH)
==
- fvc::div(porousPhi, 0.5*magSqr(porousU), "div(phi,K)")
......
......@@ -5,6 +5,27 @@
volScalarField rAU("rAU", 1.0/UEqn.A());
surfaceScalarField rAUf("Dp", fvc::interpolate(rAU));
volVectorField HbyA("HbyA", U);
HbyA = rAU*UEqn.H();
surfaceScalarField phiHbyA
(
"phiHbyA",
(fvc::interpolate(HbyA) & mesh.Sf())
+ fvc::ddtPhiCorr(rAU, rho, U, phi)
);
phi = phiHbyA;
surfaceScalarField phig
(
(
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
- ghf*fvc::snGrad(rho)
)*rAUf*mesh.magSf()
);
phiHbyA += phig;
tmp<fvScalarMatrix> p_rghEqnComp1;
tmp<fvScalarMatrix> p_rghEqnComp2;
......@@ -27,27 +48,6 @@
- fvc::Sp(fvc::div(phid2), p_rgh);
}
volVectorField HbyA("HbyA", U);
HbyA = rAU*UEqn.H();
surfaceScalarField phiHbyA
(
"phiHbyA",
(fvc::interpolate(HbyA) & mesh.Sf())
+ fvc::ddtPhiCorr(rAU, rho, U, phi)
);
phi = phiHbyA;
surfaceScalarField phig
(
(
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
- ghf*fvc::snGrad(rho)
)*rAUf*mesh.magSf()
);
phiHbyA += phig;
// Thermodynamic density needs to be updated by psi*d(p) after the
// pressure solution - done in 2 parts. Part 1:
//thermo.rho() -= psi*p_rgh;
......
......@@ -6,7 +6,6 @@
(
fvm::ddt(alpha1, T1)
+ fvm::div(alphaPhi1, T1)
- fvm::Sp(fvc::ddt(alpha1) + fvc::div(alphaPhi1), T1)
- fvm::laplacian(kByCp1, T1)
==
heatTransferCoeff*T2/Cp1/rho1
......@@ -18,7 +17,6 @@
(
fvm::ddt(alpha2, T2)
+ fvm::div(alphaPhi2, T2)
- fvm::Sp(fvc::ddt(alpha2) + fvc::div(alphaPhi2), T2)
- fvm::laplacian(kByCp2, T2)
==
heatTransferCoeff*T1/Cp2/rho2
......
......@@ -30,7 +30,6 @@ fvVectorMatrix U2Eqn(U2, U2.dimensions()*dimVol/dimTime);
(
fvm::ddt(alpha1, U1)
+ fvm::div(alphaPhi1, U1)
- fvm::Sp(fvc::ddt(alpha1) + fvc::div(alphaPhi1), U1)
+ Cvm*rho2*alpha1*alpha2/rho1*
(
......@@ -61,7 +60,6 @@ fvVectorMatrix U2Eqn(U2, U2.dimensions()*dimVol/dimTime);
(
fvm::ddt(alpha2, U2)
+ fvm::div(alphaPhi2, U2)
- fvm::Sp(fvc::ddt(alpha2) + fvc::div(alphaPhi2), U2)
+ Cvm*rho2*alpha1*alpha2/rho2*
(
......
......@@ -2,7 +2,6 @@
(
fvm::ddt(rho, U)
+ fvm::div(rhoPhi, U)
- fvm::Sp(fvc::ddt(rho) + fvc::div(rhoPhi), U)
+ turbulence->divDevRhoReff(rho, U)
);
......
......@@ -6,7 +6,6 @@
(
fvm::ddt(alpha1, T1)
+ fvm::div(alphaPhi1, T1)
- fvm::Sp(fvc::ddt(alpha1) + fvc::div(alphaPhi1), T1)
- fvm::laplacian(kByCp1, T1)
==
heatTransferCoeff*T2/Cp1/rho1
......@@ -18,7 +17,6 @@
(
fvm::ddt(alpha2, T2)
+ fvm::div(alphaPhi2, T2)
- fvm::Sp(fvc::ddt(alpha2) + fvc::div(alphaPhi2), T2)
- fvm::laplacian(kByCp2, T2)
==
heatTransferCoeff*T1/Cp2/rho2
......
......@@ -17,7 +17,6 @@ forAllIter(PtrDictionary<phaseModel>, fluid.phases(), iter)
(
fvm::ddt(alpha, U)
+ fvm::div(phase.phiAlpha(), U)
- fvm::Sp(fvc::ddt(alpha) + fvc::div(phase.phiAlpha()), U)
+ (alpha/phase.rho())*fluid.Cvm(phase)*
(
......
......@@ -351,7 +351,6 @@ void LRR::correct()
(
fvm::ddt(rho_, epsilon_)
+ fvm::div(phi_, epsilon_)
- fvm::Sp(fvc::ddt(rho_) + fvc::div(phi_), epsilon_)
//- fvm::laplacian(Ceps*rho_*(k_/epsilon_)*R_, epsilon_)
- fvm::laplacian(DepsilonEff(), epsilon_)
==
......@@ -394,7 +393,6 @@ void LRR::correct()
(
fvm::ddt(rho_, R_)
+ fvm::div(phi_, R_)
- fvm::Sp(fvc::ddt(rho_) + fvc::div(phi_), R_)
//- fvm::laplacian(Cs*rho_*(k_/epsilon_)*R_, R_)
- fvm::laplacian(DREff(), R_)
+ fvm::Sp(Clrr1_*rho_*epsilon_/k_, R_)
......
......@@ -389,7 +389,6 @@ void LaunderGibsonRSTM::correct()
(
fvm::ddt(rho_, epsilon_)
+ fvm::div(phi_, epsilon_)
- fvm::Sp(fvc::ddt(rho_) + fvc::div(phi_), epsilon_)
//- fvm::laplacian(Ceps*rho_*(k_/epsilon_)*R_, epsilon_)
- fvm::laplacian(DepsilonEff(), epsilon_)
==
......@@ -433,7 +432,6 @@ void LaunderGibsonRSTM::correct()
(
fvm::ddt(rho_, R_)
+ fvm::div(phi_, R_)
- fvm::Sp(fvc::ddt(rho_) + fvc::div(phi_), R_)
//- fvm::laplacian(Cs*rho_*(k_/epsilon_)*R_, R_)
- fvm::laplacian(DREff(), R_)
+ fvm::Sp(Clg1_*rho_*epsilon_/k_, R_)
......
......@@ -314,7 +314,6 @@ void LaunderSharmaKE::correct()
(
fvm::ddt(rho_, epsilon_)
+ fvm::div(phi_, epsilon_)
- fvm::Sp(fvc::ddt(rho_) + fvc::div(phi_), epsilon_)
- fvm::laplacian(DepsilonEff(), epsilon_)
==
C1_*G*epsilon_/k_
......@@ -334,7 +333,6 @@ void LaunderSharmaKE::correct()
(
fvm::ddt(rho_, k_)
+ fvm::div(phi_, k_)
- fvm::Sp(fvc::ddt(rho_) + fvc::div(phi_), k_)
- fvm::laplacian(DkEff(), k_)
==
G - fvm::SuSp(2.0/3.0*rho_*divU, k_)
......
......@@ -321,7 +321,6 @@ void RNGkEpsilon::correct()
(
fvm::ddt(rho_, epsilon_)
+ fvm::div(phi_, epsilon_)
- fvm::Sp(fvc::ddt(rho_) + fvc::div(phi_), epsilon_)
- fvm::laplacian(DepsilonEff(), epsilon_)
==
(C1_ - R)*G*epsilon_/k_
......@@ -343,7 +342,6 @@ void RNGkEpsilon::correct()
(
fvm::ddt(rho_, k_)
+ fvm::div(phi_, k_)
- fvm::Sp(fvc::ddt(rho_) + fvc::div(phi_), k_)
- fvm::laplacian(DkEff(), k_)
==
G - fvm::SuSp(2.0/3.0*rho_*divU, k_)
......
......@@ -416,7 +416,6 @@ void SpalartAllmaras::correct()
(
fvm::ddt(rho_, nuTilda_)
+ fvm::div(phi_, nuTilda_)
- fvm::Sp(fvc::ddt(rho_) + fvc::div(phi_), nuTilda_)
- fvm::laplacian(DnuTildaEff(), nuTilda_)
- Cb2_/sigmaNut_*rho_*magSqr(fvc::grad(nuTilda_))
==
......
Supports Markdown
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