mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Corrected headers.
This commit is contained in:
@ -13,7 +13,6 @@
|
||||
);
|
||||
|
||||
TEqn.relax();
|
||||
|
||||
TEqn.solve();
|
||||
|
||||
rhok = 1.0 - beta*(T - TRef);
|
||||
|
||||
@ -8,15 +8,18 @@
|
||||
|
||||
UEqn().relax();
|
||||
|
||||
solve
|
||||
(
|
||||
UEqn()
|
||||
==
|
||||
fvc::reconstruct
|
||||
if (momentumPredictor)
|
||||
{
|
||||
solve
|
||||
(
|
||||
UEqn()
|
||||
==
|
||||
fvc::reconstruct
|
||||
(
|
||||
fvc::interpolate(rhok)*(g & mesh.Sf())
|
||||
- fvc::snGrad(p)*mesh.magSf()
|
||||
(
|
||||
- ghf*fvc::snGrad(rhok)
|
||||
- fvc::snGrad(p_rgh)
|
||||
)*mesh.magSf()
|
||||
)
|
||||
)
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
@ -70,7 +70,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
#include "readSIMPLEControls.H"
|
||||
|
||||
p.storePrevIter();
|
||||
p_rgh.storePrevIter();
|
||||
|
||||
// Pressure-velocity SIMPLE corrector
|
||||
{
|
||||
|
||||
@ -14,12 +14,12 @@
|
||||
mesh
|
||||
);
|
||||
|
||||
Info<< "Reading field p\n" << endl;
|
||||
volScalarField p
|
||||
Info<< "Reading field p_rgh\n" << endl;
|
||||
volScalarField p_rgh
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"p",
|
||||
"p_rgh",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
@ -42,9 +42,9 @@
|
||||
mesh
|
||||
);
|
||||
|
||||
# include "createPhi.H"
|
||||
#include "createPhi.H"
|
||||
|
||||
# include "readTransportProperties.H"
|
||||
#include "readTransportProperties.H"
|
||||
|
||||
Info<< "Creating turbulence model\n" << endl;
|
||||
autoPtr<incompressible::RASModel> turbulence
|
||||
@ -52,20 +52,6 @@
|
||||
incompressible::RASModel::New(U, phi, laminarTransport)
|
||||
);
|
||||
|
||||
Info<< "Calculating field beta*(g.h)\n" << endl;
|
||||
surfaceScalarField betaghf("betagh", beta*(g & mesh.Cf()));
|
||||
|
||||
label pRefCell = 0;
|
||||
scalar pRefValue = 0.0;
|
||||
setRefCell
|
||||
(
|
||||
p,
|
||||
mesh.solutionDict().subDict("SIMPLE"),
|
||||
pRefCell,
|
||||
pRefValue
|
||||
);
|
||||
|
||||
|
||||
// Kinematic density for buoyancy force
|
||||
volScalarField rhok
|
||||
(
|
||||
@ -77,3 +63,47 @@
|
||||
),
|
||||
1.0 - beta*(T - TRef)
|
||||
);
|
||||
|
||||
Info<< "Calculating field g.h\n" << endl;
|
||||
volScalarField gh("gh", g & mesh.C());
|
||||
surfaceScalarField ghf("ghf", g & mesh.Cf());
|
||||
|
||||
volScalarField p
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"p",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
p_rgh + rhok*gh
|
||||
);
|
||||
|
||||
label p_rghRefCell = 0;
|
||||
scalar p_rghRefValue = 0.0;
|
||||
setRefCell
|
||||
(
|
||||
p_rgh,
|
||||
mesh.solutionDict().subDict("SIMPLE"),
|
||||
p_rghRefCell,
|
||||
p_rghRefValue
|
||||
);
|
||||
|
||||
scalar pRefValue = 0.0;
|
||||
|
||||
if (p_rgh.needReference())
|
||||
{
|
||||
pRefValue = readScalar
|
||||
(
|
||||
mesh.solutionDict().subDict("SIMPLE").lookup("pRefValue")
|
||||
);
|
||||
|
||||
p += dimensionedScalar
|
||||
(
|
||||
"p",
|
||||
p.dimensions(),
|
||||
pRefValue - getRefCellValue(p, p_rghRefCell)
|
||||
);
|
||||
}
|
||||
|
||||
@ -6,45 +6,56 @@
|
||||
UEqn.clear();
|
||||
|
||||
phi = fvc::interpolate(U) & mesh.Sf();
|
||||
adjustPhi(phi, U, p);
|
||||
adjustPhi(phi, U, p_rgh);
|
||||
|
||||
surfaceScalarField buoyancyPhi =
|
||||
rUAf*fvc::interpolate(rhok)*(g & mesh.Sf());
|
||||
phi += buoyancyPhi;
|
||||
surfaceScalarField buoyancyPhi = rUAf*ghf*fvc::snGrad(rhok)*mesh.magSf();
|
||||
phi -= buoyancyPhi;
|
||||
|
||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||
{
|
||||
fvScalarMatrix pEqn
|
||||
fvScalarMatrix p_rghEqn
|
||||
(
|
||||
fvm::laplacian(rUAf, p) == fvc::div(phi)
|
||||
fvm::laplacian(rUAf, p_rgh) == fvc::div(phi)
|
||||
);
|
||||
|
||||
pEqn.setReference(pRefCell, pRefValue);
|
||||
p_rghEqn.setReference(p_rghRefCell, p_rghRefValue);
|
||||
|
||||
// retain the residual from the first iteration
|
||||
if (nonOrth == 0)
|
||||
{
|
||||
pEqn.solve();
|
||||
p_rghEqn.solve();
|
||||
}
|
||||
else
|
||||
{
|
||||
pEqn.solve();
|
||||
p_rghEqn.solve();
|
||||
}
|
||||
|
||||
if (nonOrth == nNonOrthCorr)
|
||||
{
|
||||
// Calculate the conservative fluxes
|
||||
phi -= pEqn.flux();
|
||||
phi -= p_rghEqn.flux();
|
||||
|
||||
// Explicitly relax pressure for momentum corrector
|
||||
p.relax();
|
||||
p_rgh.relax();
|
||||
|
||||
// Correct the momentum source with the pressure gradient flux
|
||||
// calculated from the relaxed pressure
|
||||
U += rUA*fvc::reconstruct((buoyancyPhi - pEqn.flux())/rUAf);
|
||||
U -= rUA*fvc::reconstruct((buoyancyPhi + p_rghEqn.flux())/rUAf);
|
||||
U.correctBoundaryConditions();
|
||||
}
|
||||
}
|
||||
|
||||
#include "continuityErrs.H"
|
||||
|
||||
p = p_rgh + rhok*gh;
|
||||
|
||||
if (p_rgh.needReference())
|
||||
{
|
||||
p += dimensionedScalar
|
||||
(
|
||||
"p",
|
||||
p.dimensions(),
|
||||
pRefValue - getRefCellValue(p, p_rghRefCell)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,13 +8,18 @@
|
||||
|
||||
UEqn().relax();
|
||||
|
||||
solve
|
||||
(
|
||||
UEqn()
|
||||
==
|
||||
fvc::reconstruct
|
||||
if (momentumPredictor)
|
||||
{
|
||||
solve
|
||||
(
|
||||
fvc::interpolate(rho)*(g & mesh.Sf())
|
||||
- fvc::snGrad(p)*mesh.magSf()
|
||||
)
|
||||
);
|
||||
UEqn()
|
||||
==
|
||||
fvc::reconstruct
|
||||
(
|
||||
(
|
||||
- ghf*fvc::snGrad(rho)
|
||||
- fvc::snGrad(p_rgh)
|
||||
)*mesh.magSf()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@ -55,14 +55,17 @@ int main(int argc, char *argv[])
|
||||
|
||||
#include "readSIMPLEControls.H"
|
||||
|
||||
p.storePrevIter();
|
||||
p_rgh.storePrevIter();
|
||||
rho.storePrevIter();
|
||||
|
||||
// Pressure-velocity SIMPLE corrector
|
||||
{
|
||||
#include "UEqn.H"
|
||||
#include "hEqn.H"
|
||||
for (int i=0; i<3; i++)
|
||||
{
|
||||
#include "pEqn.H"
|
||||
}
|
||||
}
|
||||
|
||||
turbulence->correct();
|
||||
|
||||
@ -23,6 +23,19 @@
|
||||
volScalarField& h = thermo.h();
|
||||
const volScalarField& psi = thermo.psi();
|
||||
|
||||
Info<< "Reading field p_rgh\n" << endl;
|
||||
volScalarField p_rgh
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"p_rgh",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
Info<< "Reading field U\n" << endl;
|
||||
volVectorField U
|
||||
@ -53,17 +66,40 @@
|
||||
)
|
||||
);
|
||||
|
||||
thermo.correct();
|
||||
Info<< "Calculating field g.h\n" << endl;
|
||||
volScalarField gh("gh", g & mesh.C());
|
||||
surfaceScalarField ghf("ghf", g & mesh.Cf());
|
||||
|
||||
label pRefCell = 0;
|
||||
scalar pRefValue = 0.0;
|
||||
p = p_rgh + rho*gh;
|
||||
thermo.correct();
|
||||
rho = thermo.rho();
|
||||
p_rgh = p - rho*gh;
|
||||
|
||||
label p_rghRefCell = 0;
|
||||
scalar p_rghRefValue = 0.0;
|
||||
setRefCell
|
||||
(
|
||||
p,
|
||||
p_rgh,
|
||||
mesh.solutionDict().subDict("SIMPLE"),
|
||||
pRefCell,
|
||||
pRefValue
|
||||
p_rghRefCell,
|
||||
p_rghRefValue
|
||||
);
|
||||
|
||||
scalar pRefValue = 0.0;
|
||||
|
||||
if (p_rgh.needReference())
|
||||
{
|
||||
pRefValue = readScalar
|
||||
(
|
||||
mesh.solutionDict().subDict("SIMPLE").lookup("pRefValue")
|
||||
);
|
||||
|
||||
p += dimensionedScalar
|
||||
(
|
||||
"p",
|
||||
p.dimensions(),
|
||||
pRefValue - getRefCellValue(p, p_rghRefCell)
|
||||
);
|
||||
}
|
||||
|
||||
dimensionedScalar initialMass = fvc::domainIntegrate(rho);
|
||||
|
||||
@ -10,7 +10,6 @@
|
||||
);
|
||||
|
||||
hEqn.relax();
|
||||
|
||||
hEqn.solve();
|
||||
|
||||
thermo.correct();
|
||||
|
||||
@ -5,50 +5,52 @@
|
||||
surfaceScalarField rhorUAf("(rho*(1|A(U)))", fvc::interpolate(rho*rUA));
|
||||
|
||||
U = rUA*UEqn().H();
|
||||
UEqn.clear();
|
||||
//UEqn.clear();
|
||||
|
||||
phi = fvc::interpolate(rho)*(fvc::interpolate(U) & mesh.Sf());
|
||||
bool closedVolume = adjustPhi(phi, U, p);
|
||||
bool closedVolume = adjustPhi(phi, U, p_rgh);
|
||||
|
||||
surfaceScalarField buoyancyPhi =
|
||||
rhorUAf*fvc::interpolate(rho)*(g & mesh.Sf());
|
||||
phi += buoyancyPhi;
|
||||
surfaceScalarField buoyancyPhi = rhorUAf*ghf*fvc::snGrad(rho)*mesh.magSf();
|
||||
phi -= buoyancyPhi;
|
||||
|
||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||
{
|
||||
fvScalarMatrix pEqn
|
||||
fvScalarMatrix p_rghEqn
|
||||
(
|
||||
fvm::laplacian(rhorUAf, p) == fvc::div(phi)
|
||||
fvm::laplacian(rhorUAf, p_rgh) == fvc::div(phi)
|
||||
);
|
||||
|
||||
pEqn.setReference(pRefCell, pRefValue);
|
||||
pEqn.solve();
|
||||
p_rghEqn.setReference(p_rghRefCell, p_rghRefValue);
|
||||
p_rghEqn.solve();
|
||||
|
||||
if (nonOrth == nNonOrthCorr)
|
||||
{
|
||||
// For closed-volume cases adjust the pressure and density levels
|
||||
// to obey overall mass continuity
|
||||
if (closedVolume)
|
||||
{
|
||||
p += (initialMass - fvc::domainIntegrate(psi*p))
|
||||
/fvc::domainIntegrate(psi);
|
||||
}
|
||||
|
||||
// Calculate the conservative fluxes
|
||||
phi -= pEqn.flux();
|
||||
phi -= p_rghEqn.flux();
|
||||
|
||||
// Explicitly relax pressure for momentum corrector
|
||||
p.relax();
|
||||
p_rgh.relax();
|
||||
|
||||
// Correct the momentum source with the pressure gradient flux
|
||||
// calculated from the relaxed pressure
|
||||
U += rUA*fvc::reconstruct((buoyancyPhi - pEqn.flux())/rhorUAf);
|
||||
U -= rUA*fvc::reconstruct((buoyancyPhi + p_rghEqn.flux())/rhorUAf);
|
||||
U.correctBoundaryConditions();
|
||||
}
|
||||
}
|
||||
|
||||
#include "continuityErrs.H"
|
||||
|
||||
p = p_rgh + rho*gh;
|
||||
|
||||
// For closed-volume cases adjust the pressure and density levels
|
||||
// to obey overall mass continuity
|
||||
if (closedVolume)
|
||||
{
|
||||
p += (initialMass - fvc::domainIntegrate(psi*p))
|
||||
/fvc::domainIntegrate(psi);
|
||||
p_rgh == p - rho*gh;
|
||||
}
|
||||
|
||||
rho = thermo.rho();
|
||||
rho.relax();
|
||||
Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value()
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
EXE_INC = \
|
||||
EXE_INC = -ggdb3 \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
||||
|
||||
@ -22,7 +22,7 @@ License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Application
|
||||
compressibleLesInterFoam
|
||||
compressibleInterFoam
|
||||
|
||||
Description
|
||||
Solver for 2 compressible, isothermal immiscible fluids using a VOF
|
||||
|
||||
@ -75,8 +75,8 @@
|
||||
alpha1,
|
||||
phiAlpha1BD,
|
||||
phiAlpha1,
|
||||
zero(),
|
||||
zero(),
|
||||
zeroField(),
|
||||
zeroField(),
|
||||
1,
|
||||
0,
|
||||
3
|
||||
@ -112,8 +112,8 @@
|
||||
alpha2,
|
||||
phiAlpha2BD,
|
||||
phiAlpha2,
|
||||
zero(),
|
||||
zero(),
|
||||
zeroField(),
|
||||
zeroField(),
|
||||
1,
|
||||
0,
|
||||
3
|
||||
|
||||
Reference in New Issue
Block a user