Rewrite of ddtPhiCorr - ddtCorr and density-weight HbyA on compressible solvers.

For DyM solvers phiAbs is replaced by Uf but this conversion is currently not complete
This commit is contained in:
Henry
2013-09-09 12:41:20 +01:00
parent 6817ed416b
commit 51f085faa5
164 changed files with 2157 additions and 1808 deletions

View File

@ -4,6 +4,8 @@ rho = min(rho, rhoMax);
rho.relax();
volScalarField rAU(1.0/UEqn().A());
surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU));
volVectorField HbyA("HbyA", U);
HbyA = rAU*UEqn().H();
@ -19,15 +21,13 @@ if (pimple.transonic())
"phid",
fvc::interpolate(psi)
*(
(fvc::interpolate(HbyA) & mesh.Sf())
+ fvc::ddtPhiCorr(rAU, rho, U, phi)
)
(fvc::interpolate(rho*HbyA) & mesh.Sf())
+ Dp*fvc::ddtCorr(rho, U, phi)
)/fvc::interpolate(rho)
);
fvOptions.makeRelative(fvc::interpolate(psi), phid);
volScalarField Dp("Dp", rho*rAU);
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix pEqn
@ -54,10 +54,9 @@ else
surfaceScalarField phiHbyA
(
"phiHbyA",
fvc::interpolate(rho)
*(
(fvc::interpolate(HbyA) & mesh.Sf())
+ fvc::ddtPhiCorr(rAU, rho, U, phi)
(
(fvc::interpolate(rho*HbyA) & mesh.Sf())
+ Dp*fvc::ddtCorr(rho, U, phi)
)
);

View File

@ -4,6 +4,8 @@ rho = min(rho, rhoMax);
rho.relax();
volScalarField rAU(1.0/UEqn().A());
surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU));
volVectorField HbyA("HbyA", U);
HbyA = rAU*UEqn().H();
@ -19,15 +21,13 @@ if (pimple.transonic())
"phid",
fvc::interpolate(psi)
*(
(fvc::interpolate(HbyA) & mesh.Sf())
+ fvc::ddtPhiCorr(rAU, rho, U, phiAbs)
)
(fvc::interpolate(rho*HbyA) & mesh.Sf())
+ Dp*fvc::ddtCorr(rho, U, phiAbs)
)/fvc::interpolate(rho)
);
fvOptions.makeRelative(fvc::interpolate(psi), phid);
volScalarField Dp("Dp", rho*rAU);
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix pEqn
@ -54,18 +54,12 @@ else
surfaceScalarField phiHbyA
(
"phiHbyA",
fvc::interpolate(rho)
*(
(fvc::interpolate(HbyA) & mesh.Sf())
- fvc::meshPhi(rho, U)
+ fvc::ddtPhiCorr(rAU, rho, U, phiAbs)
)
(fvc::interpolate(rho*HbyA) & mesh.Sf())
+ Dp*fvc::ddtCorr(rho, U, phiAbs)
);
fvOptions.makeRelative(fvc::interpolate(rho), phiHbyA);
volScalarField Dp("Dp", rho*rAU);
while (pimple.correctNonOrthogonal())
{
// Pressure corrector

View File

@ -59,7 +59,7 @@ int main(int argc, char *argv[])
#include "CourantNo.H"
#include "setInitialDeltaT.H"
// Create old-time absolute flux for ddtPhiCorr
// Create old-time absolute flux for ddtCorr
surfaceScalarField phiAbs("phiAbs", phi);
@ -75,7 +75,7 @@ int main(int argc, char *argv[])
// Make the fluxes absolute before mesh-motion
fvc::makeAbsolute(phi, rho, U);
// Update absolute flux for ddtPhiCorr
// Update absolute flux for ddtCorr
phiAbs = phi;
#include "setDeltaT.H"

View File

@ -20,9 +20,9 @@ if (pimple.transonic())
"phid",
fvc::interpolate(psi)
*(
(fvc::interpolate(HbyA) & mesh.Sf())
+ fvc::ddtPhiCorr(rAU, rho, U, phi)
)
(fvc::interpolate(rho*HbyA) & mesh.Sf())
+ fvc::interpolate(rho*rAU)*fvc::ddtCorr(rho, U, phi)
)/fvc::interpolate(rho)
);
fvOptions.makeRelative(fvc::interpolate(psi), phid);
@ -64,10 +64,9 @@ else
surfaceScalarField phiHbyA
(
"phiHbyA",
fvc::interpolate(rho)
*(
(fvc::interpolate(HbyA) & mesh.Sf())
+ fvc::ddtPhiCorr(rAU, rho, U, phi)
(
(fvc::interpolate(rho*HbyA) & mesh.Sf())
+ fvc::interpolate(rho*rAU)*fvc::ddtCorr(rho, U, phi)
)
);

View File

@ -12,7 +12,9 @@
surfaceScalarField phid
(
"phid",
fvc::interpolate(psi)*(fvc::interpolate(HbyA) & mesh.Sf())
fvc::interpolate(psi)
*(fvc::interpolate(rho*HbyA) & mesh.Sf())
/fvc::interpolate(rho)
);
fvOptions.makeRelative(fvc::interpolate(psi), phid);
@ -47,7 +49,7 @@
surfaceScalarField phiHbyA
(
"phiHbyA",
fvc::interpolate(rho)*(fvc::interpolate(HbyA) & mesh.Sf())
fvc::interpolate(rho*HbyA) & mesh.Sf()
);
fvOptions.makeRelative(fvc::interpolate(rho), phiHbyA);

View File

@ -13,7 +13,9 @@ if (simple.transonic())
surfaceScalarField phid
(
"phid",
fvc::interpolate(psi)*(fvc::interpolate(HbyA) & mesh.Sf())
fvc::interpolate(psi)
*(fvc::interpolate(rho*HbyA) & mesh.Sf())
/fvc::interpolate(rho)
);
surfaceScalarField phic
@ -57,7 +59,7 @@ else
surfaceScalarField phiHbyA
(
"phiHbyA",
fvc::interpolate(rho)*(fvc::interpolate(HbyA) & mesh.Sf())
fvc::interpolate(rho*HbyA) & mesh.Sf()
);
closedVolume = adjustPhi(phiHbyA, U, p);

View File

@ -1,22 +1,21 @@
rho = thermo.rho();
volScalarField rAU(1.0/UEqn.A());
surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU));
volVectorField HbyA("HbyA", U);
HbyA = rAU*UEqn.H();
surfaceScalarField phid
(
"phid",
fvc::interpolate(psi)
*(
(fvc::interpolate(HbyA) & mesh.Sf())
+ fvc::ddtPhiCorr(rAU, rho, U, phi)
)
fvc::interpolate(psi)*
(
(mesh.Sf() & fvc::interpolate(rho*HbyA))
+ Dp*fvc::ddtCorr(rho, U, phi)
)/fvc::interpolate(rho)
);
volScalarField Dp("Dp", rho*rAU);
// Non-orthogonal pressure corrector loop
while (pimple.correctNonOrthogonal())
{

View File

@ -0,0 +1,56 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Global
createUf
Description
Creates and initialises the velocity velocity field Uf.
\*---------------------------------------------------------------------------*/
#ifndef createUf_H
#define createUf_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "Reading/calculating face velocity rhoUf\n" << endl;
surfaceVectorField rhoUf
(
IOobject
(
"rhoUf",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
linearInterpolate(rho*U)
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,6 +1,8 @@
rho = thermo.rho();
volScalarField rAU(1.0/UEqn.A());
surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU));
volVectorField HbyA("HbyA", U);
HbyA = rAU*UEqn.H();
@ -9,13 +11,14 @@ surfaceScalarField phid
"phid",
fvc::interpolate(psi)
*(
(fvc::interpolate(HbyA) & mesh.Sf())
(
(fvc::interpolate(rho*HbyA) & mesh.Sf())
//***HGW + Dp*fvc::ddtCorr(rho, U, phi)
)/fvc::interpolate(rho)
- fvc::meshPhi(rho, U)
)
);
volScalarField Dp("Dp", rho*rAU);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pEqn

View File

@ -44,6 +44,7 @@ int main(int argc, char *argv[])
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"
#include "createRhoUf.H"
#include "initContinuityErrs.H"
pimpleControl pimple(mesh);
@ -63,6 +64,12 @@ int main(int argc, char *argv[])
mesh.movePoints(motionPtr->newPoints());
// Calculate absolute flux from the mapped surface velocity
phi = mesh.Sf() & rhoUf;
// Make the flux relative to the mesh motion
fvc::makeRelative(phi, rho, U);
#include "rhoEqn.H"
// --- Pressure-velocity PIMPLE corrector loop

View File

@ -76,6 +76,8 @@ int main(int argc, char *argv[])
while (pimple.correct())
{
volScalarField rAU(1.0/UEqn.A());
surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU));
U = rAU*UEqn.H();
surfaceScalarField phid
@ -83,13 +85,12 @@ int main(int argc, char *argv[])
"phid",
psi
*(
(fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rAU, rho, U, phi)
)
(fvc::interpolate(rho*U) & mesh.Sf())
+ Dp*fvc::ddtCorr(rho, U, phi)
)/fvc::interpolate(rho)
);
phi = (rhoO/psi)*phid;
volScalarField Dp("Dp", rho*rAU);
fvScalarMatrix pEqn
(