Commit 76981e87 authored by Henry's avatar Henry
Browse files

rhoPorousMRFSimpleFoam: Added MRF support to rhoPorousSimpleFoam

parent a302f063
......@@ -19,7 +19,7 @@ if (transonic)
fvc::interpolate(psi)
*(
(fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rAU, rho, U, phi)
//+ fvc::ddtPhiCorr(rAU, rho, U, phi)
)
);
mrfZones.relativeFlux(fvc::interpolate(psi), phid);
......
......@@ -3,6 +3,6 @@ cd ${0%/*} || exit 1 # run from this directory
set -x
wmake
wmake rhoPorousSimpleFoam
wmake rhoPorousMRFSimpleFoam
# ----------------------------------------------------------------- end-of-file
rhoPorousMRFSimpleFoam.C
EXE = $(FOAM_APPBIN)/rhoPorousMRFSimpleFoam
......@@ -8,6 +8,8 @@
UEqn().relax();
mrfZones.addCoriolis(rho, UEqn());
// Include the porous media resistance and solve the momentum equation
// either implicit in the tensorial resistance or transport using by
// including the spherical part of the resistance in the momentum diagonal
......
MRFZones mrfZones(mesh);
mrfZones.correctBoundaryVelocity(U);
thermalPorousZones pZones(mesh);
Switch pressureImplicitPorosity(false);
......@@ -24,4 +27,3 @@
Info<< "Using pressure explicit porosity" << endl;
}
}
......@@ -9,36 +9,68 @@ else
UEqn.clear();
phi = fvc::interpolate(rho*U) & mesh.Sf();
bool closedVolume = adjustPhi(phi, U, p);
bool closedVolume = false;
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
if (transonic)
{
tmp<fvScalarMatrix> tpEqn;
surfaceScalarField phid
(
"phid",
fvc::interpolate(psi)*(fvc::interpolate(U) & mesh.Sf())
);
mrfZones.relativeFlux(fvc::interpolate(psi), phid);
if (pressureImplicitPorosity)
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
tpEqn = (fvm::laplacian(rho*trTU(), p) == fvc::div(phi));
}
else
{
tpEqn = (fvm::laplacian(rho*trAU(), p) == fvc::div(phi));
}
tmp<fvScalarMatrix> tpEqn;
if (pressureImplicitPorosity)
{
tpEqn = (fvc::div(phid, p) - fvm::laplacian(rho*trTU(), p));
}
else
{
tpEqn = (fvc::div(phid, p) - fvm::laplacian(rho*trAU(), p));
}
tpEqn().setReference(pRefCell, pRefValue);
tpEqn().setReference(pRefCell, pRefValue);
// retain the residual from the first iteration
if (nonOrth == 0)
{
tpEqn().solve();
if (nonOrth == nNonOrthCorr)
{
phi == tpEqn().flux();
}
}
else
}
else
{
phi = fvc::interpolate(rho*U) & mesh.Sf();
mrfZones.relativeFlux(fvc::interpolate(rho), phi);
closedVolume = adjustPhi(phi, U, p);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
tmp<fvScalarMatrix> tpEqn;
if (pressureImplicitPorosity)
{
tpEqn = (fvm::laplacian(rho*trTU(), p) == fvc::div(phi));
}
else
{
tpEqn = (fvm::laplacian(rho*trAU(), p) == fvc::div(phi));
}
tpEqn().setReference(pRefCell, pRefValue);
tpEqn().solve();
}
if (nonOrth == nNonOrthCorr)
{
phi -= tpEqn().flux();
if (nonOrth == nNonOrthCorr)
{
phi -= tpEqn().flux();
}
}
}
......
......@@ -26,13 +26,15 @@ Application
Description
Steady-state solver for turbulent flow of compressible fluids with
RANS turbulence modelling, and implicit or explicit porosity treatment
RANS turbulence modelling, implicit or explicit porosity treatment
and MRF for HVAC and similar applications.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "basicPsiThermo.H"
#include "RASModel.H"
#include "MRFZones.H"
#include "thermalPorousZones.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -43,7 +45,7 @@ int main(int argc, char *argv[])
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"
#include "createPorousZones.H"
#include "createZones.H"
#include "initContinuityErrs.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
rhoPorousSimpleFoam.C
EXE = $(FOAM_APPBIN)/rhoPorousSimpleFoam
......@@ -15,7 +15,7 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application rhoPorousSimpleFoam;
application rhoPorousMRFSimpleFoam;
startFrom startTime;
......
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