Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev

Conflicts:
	src/thermophysicalModels/reactionThermo/Make/options
	src/thermophysicalModels/solidChemistryModel/ODESolidChemistryModel/ODESolidChemistryModel.C
	src/thermophysicalModels/solidSpecie/solidSpecie/solidSpecie.C
	tutorials/combustion/fireFoam/les/oppositeBurningPanels/constant/panelRegion/chemistryProperties
	tutorials/combustion/fireFoam/les/oppositeBurningPanels/constant/panelRegion/thermophysicalProperties
	tutorials/compressible/rhoPorousMRFSimpleFoam/angledDuctExplicitFixedCoeff/constant/MRFZones
	tutorials/compressible/rhoPorousMRFSimpleFoam/angledDuctExplicitFixedCoeff/constant/RASProperties
	tutorials/compressible/rhoPorousMRFSimpleFoam/angledDuctExplicitFixedCoeff/constant/polyMesh/boundary
This commit is contained in:
sergio
2012-10-31 17:34:12 +00:00
545 changed files with 12684 additions and 6086 deletions

View File

@ -7,7 +7,12 @@
+ betav*fvc::ddt(rho, K) + fvc::div(phi, K)
+ (
hea.name() == "ea"
? fvc::div(phi, volScalarField("Ep", p/rho))
? fvc::div
(
phi/fvc::interpolate(rho),
p,
"div(phiv,p)"
)
: -betav*dpdt
)
- fvm::laplacian(Db, hea)

View File

@ -8,7 +8,12 @@ if (ign.ignited())
+ (betav*fvc::ddt(rho, K) + fvc::div(phi, K))*rho/thermo.rhou()
+ (
heau.name() == "eau"
? fvc::div(phi, volScalarField("Ep", p/rho))*rho/thermo.rhou()
? fvc::div
(
phi/fvc::interpolate(rho),
p,
"div(phiv,p)"
)*rho/thermo.rhou()
: -betav*dpdt*rho/thermo.rhou()
)
- fvm::laplacian(Db, heau)

View File

@ -116,7 +116,7 @@ void PDRkEpsilon::correct()
}
tmp<volTensorField> tgradU = fvc::grad(U_);
volScalarField G("RASModel::G", mut_*(tgradU() && dev(twoSymm(tgradU()))));
volScalarField G("RASModel.G", mut_*(tgradU() && dev(twoSymm(tgradU()))));
tgradU.clear();
// Update espsilon and G at the wall

View File

@ -7,7 +7,12 @@
+ fvc::ddt(rho, K) + fvc::div(phi, K)
+ (
hea.name() == "ea"
? fvc::div(phi, volScalarField("Ep", p/rho))
? fvc::div
(
fvc::absolute(phi/fvc::interpolate(rho), U),
p,
"div(phiv,p)"
)
: -dpdt
)
- fvm::laplacian(turbulence->alphaEff(), hea)

View File

@ -8,7 +8,12 @@ if (ign.ignited())
+ (fvc::ddt(rho, K) + fvc::div(phi, K))*rho/thermo.rhou()
+ (
heau.name() == "eau"
? fvc::div(phi, volScalarField("Ep", p/rho))*rho/thermo.rhou()
? fvc::div
(
fvc::absolute(phi/fvc::interpolate(rho), U),
p,
"div(phiv,p)"
)*rho/thermo.rhou()
: -dpdt*rho/thermo.rhou()
)
- fvm::laplacian(turbulence->alphaEff(), heau)

View File

@ -7,7 +7,10 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/finiteVolume/lnInclude
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/fieldSources/lnInclude
EXE_LIBS = \
-lengine \
@ -16,4 +19,7 @@ EXE_LIBS = \
-lcompressibleLESModels \
-lfluidThermophysicalModels \
-lspecie \
-lfiniteVolume
-lfiniteVolume \
-lsampling \
-lmeshTools \
-lfieldSources

View File

@ -35,6 +35,7 @@ Description
#include "psiThermo.H"
#include "turbulenceModel.H"
#include "OFstream.H"
#include "IObasicSourceList.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -69,3 +69,6 @@
Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));
Info<< "Creating sources\n" << endl;
IObasicSourceList sources(mesh);

View File

@ -66,5 +66,5 @@ K = 0.5*magSqr(U);
if (thermo.dpdt())
{
dpdt = fvc::ddt(p);
dpdt = fvc::ddt(p) - fvc::div(fvc::meshPhi(rho, U), p);
}

View File

@ -55,7 +55,12 @@ tmp<fv::convectionScheme<scalar> > mvConvection
+ fvc::ddt(rho, K) + fvc::div(phi, K)
+ (
he.name() == "e"
? fvc::div(phi, volScalarField("Ep", p/rho))
? fvc::div
(
fvc::absolute(phi/fvc::interpolate(rho), U),
p,
"div(phiv,p)"
)
: -dpdt
)
- fvm::laplacian(turbulence->alphaEff(), he)

View File

@ -7,7 +7,12 @@
+ fvc::ddt(rho, K) + fvc::div(phi, K)
+ (
he.name() == "e"
? fvc::div(phi, volScalarField("Ep", p/rho))
? fvc::div
(
fvc::absolute(phi/fvc::interpolate(rho), U),
p,
"div(phiv,p)"
)
: -dpdt
)
- fvm::laplacian(turbulence->alphaEff(), he)

View File

@ -2,8 +2,6 @@
cd ${0%/*} || exit 1 # run from this directory
set -x
wmake libso BCs
wmake
wmake rhoCentralDyMFoam
(wmake libso BCs && wmake && wmake rhoCentralDyMFoam)
# ----------------------------------------------------------------- end-of-file

View File

@ -228,13 +228,10 @@ int main(int argc, char *argv[])
if (!inviscid)
{
volScalarField k("k", thermo.Cp()*muEff/Pr);
solve
(
fvm::ddt(rho, e) - fvc::ddt(rho, e)
- fvm::laplacian(turbulence->alphaEff(), e)
+ fvc::laplacian(turbulence->alpha(), e)
- fvc::laplacian(k, T)
);
thermo.correct();
rhoE = rho*(e + 0.5*magSqr(U));

View File

@ -7,13 +7,21 @@
+ fvc::ddt(rho, K) + fvc::div(phi, K)
+ (
he.name() == "e"
? fvc::div(phi, volScalarField("Ep", p/rho))
? fvc::div
(
fvc::absolute(phi/fvc::interpolate(rho), U),
p,
"div(phiv,p)"
)
: -dpdt
)
- fvm::laplacian(turbulence->alphaEff(), he)
==
sources(rho, he)
);
EEqn.relax();
sources.constrain(EEqn);
EEqn.solve();
thermo.correct();

View File

@ -2,7 +2,10 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/finiteVolume/cfdTools \
-I$(LIB_SRC)/finiteVolume/lnInclude
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/fieldSources/lnInclude
EXE_LIBS = \
-lfluidThermophysicalModels \
@ -11,4 +14,6 @@ EXE_LIBS = \
-lcompressibleRASModels \
-lcompressibleLESModels \
-lfiniteVolume \
-lmeshTools
-lmeshTools \
-lsampling \
-lfieldSources

View File

@ -9,8 +9,10 @@ tmp<fvVectorMatrix> UEqn
UEqn().relax();
sources.constrain(UEqn());
if (pimple.momentumPredictor())
{
solve(UEqn() == -fvc::grad(p));
solve(UEqn() == -fvc::grad(p) + sources(rho, U));
K = 0.5*magSqr(U);
}

View File

@ -69,3 +69,6 @@
Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));
Info<< "Creating sources\n" << endl;
IObasicSourceList sources(mesh);

View File

@ -5,7 +5,7 @@ rho.relax();
volScalarField rAU(1.0/UEqn().A());
volVectorField HbyA("HbyA", U);
HbyA = rAU*UEqn().H();
HbyA = rAU*(UEqn() == sources(rho, U))().H();
if (pimple.nCorrPISO() <= 1)
{
@ -33,8 +33,12 @@ if (pimple.transonic())
fvm::ddt(psi, p)
+ fvm::div(phid, p)
- fvm::laplacian(Dp, p)
==
sources(psi, p, rho.name())
);
sources.constrain(pEqn, rho.name());
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
if (pimple.finalNonOrthogonalIter())
@ -65,8 +69,12 @@ else
fvm::ddt(psi, p)
+ fvc::div(phiHbyA)
- fvm::laplacian(Dp, p)
==
sources(psi, p, rho.name())
);
sources.constrain(pEqn, rho.name());
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
if (pimple.finalNonOrthogonalIter())
@ -92,6 +100,7 @@ Info<< "rho max/min : " << max(rho).value()
U = HbyA - rAU*fvc::grad(p);
U.correctBoundaryConditions();
sources.correct(U);
K = 0.5*magSqr(U);
if (thermo.dpdt())

View File

@ -38,6 +38,7 @@ Description
#include "turbulenceModel.H"
#include "bound.H"
#include "pimpleControl.H"
#include "IObasicSourceList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -3,7 +3,10 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/finiteVolume/cfdTools \
-I$(LIB_SRC)/finiteVolume/lnInclude
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/fieldSources/lnInclude
EXE_LIBS = \
-lfluidThermophysicalModels \
@ -12,4 +15,6 @@ EXE_LIBS = \
-lcompressibleRASModels \
-lcompressibleLESModels \
-lfiniteVolume \
-lmeshTools
-lmeshTools \
-lsampling \
-lfieldSources

View File

@ -7,7 +7,7 @@ volScalarField rAU(1.0/UEqn().A());
volScalarField rAtU(1.0/(1.0/rAU - UEqn().H1()));
volVectorField HbyA("HbyA", U);
HbyA = rAU*UEqn().H();
HbyA = rAU*(UEqn() == sources(rho, U))().H();
if (pimple.nCorrPIMPLE() <= 1)
{
@ -44,11 +44,15 @@ if (pimple.transonic())
+ fvm::div(phid, p)
+ fvc::div(phic)
- fvm::laplacian(Dp, p)
==
sources(psi, p, rho.name())
);
// Relax the pressure equation to maintain diagonal dominance
pEqn.relax();
sources.constrain(pEqn, rho.name());
pEqn.solve();
if (pimple.finalNonOrthogonalIter())
@ -81,8 +85,12 @@ else
fvm::ddt(psi, p)
+ fvc::div(phiHbyA)
- fvm::laplacian(Dp, p)
==
sources(psi, p, rho.name())
);
sources.constrain(pEqn, rho.name());
pEqn.solve();
if (pimple.finalNonOrthogonalIter())
@ -100,6 +108,7 @@ p.relax();
U = HbyA - rAtU*fvc::grad(p);
U.correctBoundaryConditions();
sources.correct(U);
K = 0.5*magSqr(U);
if (thermo.dpdt())

View File

@ -38,6 +38,7 @@ Description
#include "turbulenceModel.H"
#include "bound.H"
#include "pimpleControl.H"
#include "IObasicSourceList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -5,7 +5,9 @@ EXE_INC = \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/finiteVolume/cfdTools \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/fieldSources/lnInclude
EXE_LIBS = \
-lfluidThermophysicalModels \
@ -14,4 +16,6 @@ EXE_LIBS = \
-lcompressibleRASModels \
-lcompressibleLESModels \
-lfiniteVolume \
-lmeshTools
-lmeshTools \
-lsampling \
-lfieldSources

View File

@ -38,7 +38,8 @@ Description
#include "psiThermo.H"
#include "turbulenceModel.H"
#include "MRFZones.H"
#include "porousZones.H"
#include "IOporosityModelList.H"
#include "IObasicSourceList.H"
#include "fvcSmooth.H"
#include "pimpleControl.H"
#include "bound.H"

View File

@ -4,7 +4,9 @@ EXE_INC = \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/finiteVolume/cfdTools \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/fieldSources/lnInclude
EXE_LIBS = \
-lfluidThermophysicalModels \
@ -13,4 +15,6 @@ EXE_LIBS = \
-lcompressibleRASModels \
-lcompressibleLESModels \
-lfiniteVolume \
-lmeshTools
-lmeshTools \
-lsampling \
-lfieldSources

View File

@ -11,9 +11,12 @@ tmp<fvVectorMatrix> UEqn
UEqn().relax();
mrfZones.addCoriolis(rho, UEqn());
pZones.addResistance(UEqn());
sources.constrain(UEqn());
if (pimple.momentumPredictor())
{
solve(UEqn() == -fvc::grad(p));
solve(UEqn() == -fvc::grad(p) + sources(rho, U));
}

View File

@ -1,5 +1,5 @@
MRFZones mrfZones(mesh);
mrfZones.correctBoundaryVelocity(U);
porousZones pZones(mesh);
IOporosityModelList pZones(mesh);
Switch pressureImplicitPorosity(false);

View File

@ -5,7 +5,7 @@ rho.relax();
volScalarField rAU(1.0/UEqn().A());
volVectorField HbyA("HbyA", U);
HbyA = rAU*UEqn().H();
HbyA = rAU*(UEqn() == sources(rho, U))().H();
if (pimple.nCorrPISO() <= 1)
{
@ -34,8 +34,12 @@ if (pimple.transonic())
fvm::ddt(psi, p)
+ fvm::div(phid, p)
- fvm::laplacian(Dp, p)
==
sources(psi, p, rho.name())
);
sources.constrain(pEqn, rho.name());
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
if (pimple.finalNonOrthogonalIter())
@ -68,8 +72,12 @@ else
fvm::ddt(psi, p)
+ fvc::div(phiHbyA)
- fvm::laplacian(Dp, p)
==
sources(psi, p, rho.name())
);
sources.constrain(pEqn, rho.name());
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
if (pimple.finalNonOrthogonalIter())
@ -94,6 +102,7 @@ Info<< "rho max/min : " << max(rho).value()
U = HbyA - rAU*fvc::grad(p);
U.correctBoundaryConditions();
sources.correct(U);
K = 0.5*magSqr(U);
if (thermo.dpdt())

View File

@ -38,7 +38,8 @@ Description
#include "turbulenceModel.H"
#include "bound.H"
#include "MRFZones.H"
#include "porousZones.H"
#include "IOporosityModelList.H"
#include "IObasicSourceList.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -10,9 +10,12 @@
: fvc::div(phi, volScalarField("K", 0.5*magSqr(U)))
)
- fvm::laplacian(turbulence->alphaEff(), he)
==
sources(rho, he)
);
EEqn.relax();
sources.constrain(EEqn);
EEqn.solve();
thermo.correct();

View File

@ -3,7 +3,10 @@ EXE_INC = \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/RASModel \
-I$(LIB_SRC)/finiteVolume/cfdTools \
-I$(LIB_SRC)/finiteVolume/lnInclude
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/fieldSources/lnInclude
EXE_LIBS = \
-lfluidThermophysicalModels \
@ -11,4 +14,6 @@ EXE_LIBS = \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lfiniteVolume \
-lmeshTools
-lsampling \
-lmeshTools \
-lfieldSources

View File

@ -60,3 +60,6 @@
);
dimensionedScalar initialMass = fvc::domainIntegrate(rho);
Info<< "Creating sources\n" << endl;
IObasicSourceList sources(mesh);

View File

@ -6,7 +6,7 @@
volScalarField rAU(1.0/UEqn().A());
volVectorField HbyA("HbyA", U);
HbyA = rAU*UEqn().H();
HbyA = rAU*(UEqn() == sources(rho, U))().H();
UEqn.clear();
@ -26,11 +26,15 @@
(
fvm::div(phid, p)
- fvm::laplacian(rho*rAU, p)
==
sources(psi, p, rho.name())
);
// Relax the pressure equation to ensure diagonal-dominance
pEqn.relax();
sources.constrain(pEqn, rho.name());
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve();
@ -57,10 +61,14 @@
(
fvc::div(phiHbyA)
- fvm::laplacian(rho*rAU, p)
==
sources(psi, p, rho.name())
);
pEqn.setReference(pRefCell, pRefValue);
sources.constrain(pEqn, rho.name());
pEqn.solve();
if (simple.finalNonOrthogonalIter())
@ -78,6 +86,7 @@
U = HbyA - rAU*fvc::grad(p);
U.correctBoundaryConditions();
sources.correct(U);
// For closed-volume cases adjust the pressure and density levels
// to obey overall mass continuity

View File

@ -10,11 +10,12 @@
: fvc::div(phi, volScalarField("K", 0.5*magSqr(U)))
)
- fvm::laplacian(turbulence->alphaEff(), he)
==
sources(rho, he)
);
pZones.addEnergySource(thermo, rho, EEqn);
EEqn.relax();
sources.constrain(EEqn);
EEqn.solve();
thermo.correct();

View File

@ -1,18 +1,20 @@
EXE_INC = \
-I.. \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermalPorousZone/lnInclude \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/RASModel \
-I$(LIB_SRC)/finiteVolume/cfdTools \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/fieldSources/lnInclude
EXE_LIBS = \
-lfluidThermophysicalModels \
-lthermalPorousZone \
-lspecie \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lfiniteVolume \
-lmeshTools
-lsampling \
-lmeshTools \
-lfieldSources

View File

@ -24,11 +24,13 @@
trTU = inv(tTU());
trTU().rename("rAU");
sources.constrain(UEqn());
volVectorField gradp(fvc::grad(p));
for (int UCorr=0; UCorr<nUCorr; UCorr++)
{
U = trTU() & (UEqn().H() - gradp);
U = trTU() & ((UEqn() == sources(rho, U))().H() - gradp);
}
U.correctBoundaryConditions();
}
@ -36,7 +38,9 @@
{
pZones.addResistance(UEqn());
solve(UEqn() == -fvc::grad(p));
sources.constrain(UEqn());
solve(UEqn() == -fvc::grad(p) + sources(rho, U));
trAU = 1.0/UEqn().A();
trAU().rename("rAU");

View File

@ -59,3 +59,6 @@
);
dimensionedScalar initialMass = fvc::domainIntegrate(rho);
Info<< "Creating sources\n" << endl;
IObasicSourceList sources(mesh);

View File

@ -1,12 +1,12 @@
MRFZones mrfZones(mesh);
mrfZones.correctBoundaryVelocity(U);
thermalPorousZones pZones(mesh);
IOporosityModelList pZones(mesh);
Switch pressureImplicitPorosity(false);
// nUCorrectors used for pressureImplicitPorosity
int nUCorr = 0;
if (pZones.size())
if (pZones.active())
{
// nUCorrectors for pressureImplicitPorosity
simple.dict().readIfPresent("nUCorrectors", nUCorr);

View File

@ -4,15 +4,17 @@
rho = min(rho, rhoMax);
rho.relax();
const volScalarField& psi = thermo.psi();
volVectorField HbyA("HbyA", U);
if (pressureImplicitPorosity)
{
HbyA = trTU() & UEqn().H();
HbyA = trTU() & (UEqn() == sources(rho, U))().H();
}
else
{
HbyA = trAU()*UEqn().H();
HbyA = trAU()*(UEqn() == sources(rho, U))().H();
}
UEqn.clear();
@ -35,15 +37,29 @@
if (pressureImplicitPorosity)
{
tpEqn = (fvm::laplacian(rho*trTU(), p) == fvc::div(phiHbyA));
tpEqn =
(
fvm::laplacian(rho*trTU(), p)
+ sources(psi, p, rho.name())
==
fvc::div(phiHbyA)
);
}
else
{
tpEqn = (fvm::laplacian(rho*trAU(), p) == fvc::div(phiHbyA));
tpEqn =
(
fvm::laplacian(rho*trAU(), p)
+ sources(psi, p, rho.name())
==
fvc::div(phiHbyA)
);
}
tpEqn().setReference(pRefCell, pRefValue);
sources.constrain(tpEqn(), rho.name());
tpEqn().solve();
if (simple.finalNonOrthogonalIter())
@ -67,12 +83,12 @@
}
U.correctBoundaryConditions();
sources.correct(U);
// For closed-volume cases adjust the pressure and density levels
// to obey overall mass continuity
if (closedVolume)
{
const volScalarField& psi = thermo.psi();
p += (initialMass - fvc::domainIntegrate(psi*p))
/fvc::domainIntegrate(psi);
}

View File

@ -35,7 +35,8 @@ Description
#include "rhoThermo.H"
#include "RASModel.H"
#include "MRFZones.H"
#include "thermalPorousZones.H"
#include "IObasicSourceList.H"
#include "IOporosityModelList.H"
#include "simpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -34,6 +34,7 @@ Description
#include "psiThermo.H"
#include "RASModel.H"
#include "simpleControl.H"
#include "IObasicSourceList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -4,11 +4,16 @@ EXE_INC = \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/RASModel \
-I$(LIB_SRC)/finiteVolume/cfdTools \
-I$(LIB_SRC)/finiteVolume/lnInclude
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/fieldSources/lnInclude
EXE_LIBS = \
-lfluidThermophysicalModels \
-lspecie \
-lcompressibleRASModels \
-lfiniteVolume \
-lmeshTools
-lsampling \
-lmeshTools \
-lfieldSources

View File

@ -7,7 +7,7 @@ volScalarField rAU(1.0/UEqn().A());
volScalarField rAtU(1.0/(1.0/rAU - UEqn().H1()));
volVectorField HbyA("HbyA", U);
HbyA = rAU*UEqn().H();
HbyA = rAU*(UEqn() == sources(rho, U))().H();
UEqn.clear();
@ -38,11 +38,15 @@ if (simple.transonic())
fvm::div(phid, p)
+ fvc::div(phic)
- fvm::laplacian(Dp, p)
==
sources(psi, p, rho.name())
);
// Relax the pressure equation to maintain diagonal dominance
pEqn.relax();
sources.constrain(pEqn, rho.name());
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve();
@ -74,8 +78,12 @@ else
(
fvc::div(phiHbyA)
- fvm::laplacian(Dp, p)
==
sources(psi, p, rho.name())
);
sources.constrain(pEqn, rho.name());
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve();
@ -96,6 +104,7 @@ p.relax();
U = HbyA - rAtU*fvc::grad(p);
U.correctBoundaryConditions();
sources.correct(U);
// For closed-volume cases adjust the pressure and density levels
// to obey overall mass continuity

View File

@ -36,6 +36,7 @@ Description
#include "mixedFvPatchFields.H"
#include "bound.H"
#include "simpleControl.H"
#include "IObasicSourceList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,8 @@
solve
(
fvm::ddt(rho, e) + fvm::div(phi, e)
+ fvc::ddt(rho, K) + fvc::div(phi, volScalarField("Ekp", K + p/rho))
+ fvc::ddt(rho, K) + fvc::div(phi, K)
+ fvc::div(fvc::absolute(phi/fvc::interpolate(rho), U), p, "div(phiv,p)")
- fvm::laplacian(turbulence->alphaEff(), e)
);

View File

@ -1,11 +0,0 @@
{
solve
(
fvm::ddt(rho, e) + fvm::div(phi, e)
+ fvc::ddt(rho, K) + fvc::div(phi, K)
+ fvc::div(phi/fvc::interpolate(rho) + mesh.phi(), p, "div(phiv,p)")
- fvm::laplacian(turbulence->alphaEff(), e)
);
thermo.correct();
}

View File

@ -2,7 +2,10 @@ EXE_INC = \
-I../../compressible/rhoPimpleFoam \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/finiteVolume/lnInclude
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/fieldSources/lnInclude \
EXE_LIBS = \
-lmeshTools \
@ -11,4 +14,8 @@ EXE_LIBS = \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lcompressibleLESModels \
-lfiniteVolume
-lfiniteVolume \
-lsampling \
-lmeshTools \
-lfieldSources

View File

@ -22,6 +22,7 @@
- fvc::snGrad(p_rgh)
)*mesh.magSf()
)
+ sources(rho, U)
);
K = 0.5*magSqr(U);
}

View File

@ -37,6 +37,7 @@ Description
#include "rhoThermo.H"
#include "turbulenceModel.H"
#include "fixedGradientFvPatchFields.H"
#include "IObasicSourceList.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -89,3 +89,6 @@
Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));
Info<< "Creating sources\n" << endl;
IObasicSourceList sources(mesh);

View File

@ -9,7 +9,7 @@
surfaceScalarField rhorAUf("Dp", fvc::interpolate(rho*rAU));
volVectorField HbyA("HbyA", U);
HbyA = rAU*UEqn.H();
HbyA = rAU*(UEqn == sources(rho, U))().H();
surfaceScalarField phig(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf());
@ -28,6 +28,8 @@
(
fvc::ddt(rho) + psi*correction(fvm::ddt(p_rgh))
+ fvc::div(phiHbyA)
==
sources(psi, p_rgh, rho.name())
);
while (pimple.correctNonOrthogonal())
@ -38,6 +40,8 @@
- fvm::laplacian(rhorAUf, p_rgh)
);
sources.constrain(p_rghEqn, rho.name());
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
if (pimple.finalNonOrthogonalIter())
@ -52,6 +56,7 @@
// calculated from the relaxed pressure
U = HbyA + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/rhorAUf);
U.correctBoundaryConditions();
sources.correct(U);
K = 0.5*magSqr(U);
}
}

View File

@ -45,7 +45,7 @@ Description
#include "solidRegionDiffNo.H"
#include "solidThermo.H"
#include "radiationModel.H"
#include "porousZones.H"
#include "IOporosityModelList.H"
#include "IObasicSourceList.H"

View File

@ -36,7 +36,7 @@ Description
#include "regionProperties.H"
#include "solidThermo.H"
#include "radiationModel.H"
#include "porousZones.H"
#include "IOporosityModelList.H"
#include "IObasicSourceList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -18,7 +18,7 @@
PtrList<dimensionedScalar> rhoMin(fluidRegions.size());
PtrList<IObasicSourceList> heatSources(fluidRegions.size());
PtrList<porousZones> porousZonesFluid(fluidRegions.size());
PtrList<IOporosityModelList> porousZonesFluid(fluidRegions.size());
// Populate fluid field pointer lists
forAll(fluidRegions, i)
@ -205,7 +205,7 @@
porousZonesFluid.set
(
i,
new porousZones(fluidRegions[i])
new IOporosityModelList(fluidRegions[i])
);
}

View File

@ -14,7 +14,7 @@
IObasicSourceList& sources = heatSources[i];
const porousZones& pZones = porousZonesFluid[i];
const IOporosityModelList& pZones = porousZonesFluid[i];
const dimensionedScalar initialMass
(

View File

@ -7,7 +7,12 @@
+ fvc::ddt(rho, K) + fvc::div(phi, K)
+ (
he.name() == "e"
? fvc::div(phi, volScalarField("Ep", p/rho))
? fvc::div
(
fvc::absolute(phi/fvc::interpolate(rho), U),
p,
"div(phiv,p)"
)
: -dpdt
)
- fvm::laplacian(turb.alphaEff(), he)

View File

@ -15,7 +15,7 @@
List<scalar> initialMassFluid(fluidRegions.size());
PtrList<IObasicSourceList> heatSources(fluidRegions.size());
PtrList<porousZones> porousZonesFluid(fluidRegions.size());
PtrList<IOporosityModelList> porousZonesFluid(fluidRegions.size());
// Populate fluid field pointer lists
forAll(fluidRegions, i)
@ -202,6 +202,6 @@
porousZonesFluid.set
(
i,
new porousZones(fluidRegions[i])
new IOporosityModelList(fluidRegions[i])
);
}

View File

@ -22,7 +22,7 @@
IObasicSourceList& sources = heatSources[i];
const porousZones& pZones = porousZonesFluid[i];
const IOporosityModelList& pZones = porousZonesFluid[i];
const dimensionedScalar initialMass
(

View File

@ -1,9 +1,9 @@
porousZones pZones(mesh);
IOporosityModelList pZones(mesh);
Switch pressureImplicitPorosity(false);
// nUCorrectors used for pressureImplicitPorosity
int nUCorr = 0;
if (pZones.size())
if (pZones.active())
{
// nUCorrectors for pressureImplicitPorosity
nUCorr = simple.dict().lookupOrDefault<int>("nUCorrectors", 0);

View File

@ -33,7 +33,7 @@ Description
#include "fvCFD.H"
#include "singlePhaseTransportModel.H"
#include "RASModel.H"
#include "porousZones.H"
#include "IOporosityModelList.H"
#include "simpleControl.H"
#include "IObasicSourceList.H"

View File

@ -7,7 +7,12 @@
+ fvc::ddt(rho, K) + fvc::div(phi, K)
+ (
he.name() == "e"
? fvc::div(phi, volScalarField("Ep", p/rho))
? fvc::div
(
fvc::absolute(phi/fvc::interpolate(rho), U),
p,
"div(phiv,p)"
)
: -dpdt
)
- fvm::laplacian(turbulence->alphaEff(), he)

View File

@ -7,7 +7,12 @@
+ fvc::ddt(rho, K) + fvc::div(phi, K)
+ (
he.name() == "e"
? fvc::div(phi, volScalarField("Ep", p/rho))
? fvc::div
(
fvc::absolute(phi/fvc::interpolate(rho), U),
p,
"div(phiv,p)"
)
: -dpdt
)
- fvm::laplacian(turbulence->alphaEff(), he)

View File

@ -7,7 +7,12 @@
+ fvc::ddt(rho, K) + fvc::div(phi, K)
+ (
he.name() == "e"
? fvc::div(phi, volScalarField("Ep", p/rho))
? fvc::div
(
fvc::absolute(phi/fvc::interpolate(rho), U),
p,
"div(phiv,p)"
)
: -dpdt
)
- fvm::laplacian(turbulence->alphaEff(), he)

View File

@ -40,7 +40,7 @@ Description
#include "basicReactingMultiphaseCloud.H"
#include "rhoCombustionModel.H"
#include "radiationModel.H"
#include "porousZones.H"
#include "IOporosityModelList.H"
#include "IObasicSourceList.H"
#include "SLGThermo.H"
#include "fvcSmooth.H"

View File

@ -1,3 +1,3 @@
Info<< "Creating porous zones" << nl << endl;
porousZones pZones(mesh);
IOporosityModelList pZones(mesh);

View File

@ -10,7 +10,7 @@
HbyA = rAU*(UEqn == sources(rho, U))().H();
surfaceScalarField phiHbyA("phiHbyA", fvc::interpolate(HbyA) & mesh.Sf());
if (pZones.size() == 0)
if (!pZones.active())
{
// ddtPhiCorr only used without porosity
phiHbyA += fvc::ddtPhiCorr(rAU, rho, U, phi);

View File

@ -44,7 +44,7 @@ Description
#include "basicReactingMultiphaseCloud.H"
#include "rhoCombustionModel.H"
#include "radiationModel.H"
#include "porousZones.H"
#include "IOporosityModelList.H"
#include "IObasicSourceList.H"
#include "SLGThermo.H"
#include "pimpleControl.H"

View File

@ -79,5 +79,5 @@ K = 0.5*magSqr(U);
if (thermo.dpdt())
{
dpdt = fvc::ddt(p);
dpdt = fvc::ddt(p) - fvc::div(fvc::meshPhi(rho, U), p);
}

View File

@ -0,0 +1,8 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
set -x
wclean
wclean cavitatingDyMFoam
# ----------------------------------------------------------------- end-of-file

View File

@ -0,0 +1,8 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
set -x
wmake
wmake cavitatingDyMFoam
# ----------------------------------------------------------------- end-of-file

View File

@ -0,0 +1,3 @@
cavitatingDyMFoam.C
EXE = $(FOAM_APPBIN)/cavitatingDyMFoam

View File

@ -0,0 +1,22 @@
EXE_INC = \
-I.. \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
-I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
-I$(LIB_SRC)/thermophysicalModels/barotropicCompressibilityModel/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude
EXE_LIBS = \
-lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \
-lincompressibleLESModels \
-lfiniteVolume \
-lbarotropicCompressibilityModel \
-ldynamicMesh \
-lmeshTools \
-ldynamicFvMesh

View File

@ -0,0 +1,132 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 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/>.
Application
cavitatingFoam
Description
Transient cavitation code based on the homogeneous equilibrium model
from which the compressibility of the liquid/vapour "mixture" is obtained.
Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "barotropicCompressibilityModel.H"
#include "twoPhaseMixture.H"
#include "turbulenceModel.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
#include "readThermodynamicProperties.H"
#include "readControls.H"
#include "createFields.H"
#include "initContinuityErrs.H"
pimpleControl pimple(mesh);
surfaceScalarField phivAbs("phivAbs", phiv);
fvc::makeAbsolute(phivAbs, U);
#include "compressibleCourantNo.H"
#include "setInitialDeltaT.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
{
#include "readControls.H"
#include "CourantNo.H"
#include "setDeltaT.H"
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime();
{
// Calculate the relative velocity used to map relative flux phiv
volVectorField Urel("Urel", U);
if (mesh.moving())
{
Urel -= fvc::reconstruct(fvc::meshPhi(U));
}
// Do any mesh changes
mesh.update();
}
if (mesh.changing())
{
Info<< "Execution time for mesh.update() = "
<< runTime.elapsedCpuTime() - timeBeforeMeshUpdate
<< " s" << endl;
#include "correctPhi.H"
}
// --- Pressure-velocity PIMPLE corrector loop
while (pimple.loop())
{
#include "rhoEqn.H"
#include "gammaPsi.H"
#include "UEqn.H"
// --- Pressure corrector loop
while (pimple.correct())
{
#include "pEqn.H"
}
if (pimple.turbCorr())
{
turbulence->correct();
}
}
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
}
Info<< "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,48 @@
{
wordList pcorrTypes
(
p.boundaryField().size(),
zeroGradientFvPatchScalarField::typeName
);
forAll (p.boundaryField(), i)
{
if (p.boundaryField()[i].fixesValue())
{
pcorrTypes[i] = fixedValueFvPatchScalarField::typeName;
}
}
volScalarField pcorr
(
IOobject
(
"pcorr",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar("pcorr", p.dimensions(), 0.0),
pcorrTypes
);
surfaceScalarField rhof(fvc::interpolate(rho, "div(phiv,rho)"));
dimensionedScalar rAUf("(1|A(U))", dimTime, 1.0);
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix pcorrEqn
(
fvm::laplacian(rAUf, pcorr) == fvc::ddt(rho) + fvc::div(phiv*rhof)
);
pcorrEqn.solve();
if (pimple.finalNonOrthogonalIter())
{
phiv -= pcorrEqn.flux()/rhof;
}
}
}

View File

@ -0,0 +1,85 @@
{
if (pimple.nCorrPIMPLE() == 1)
{
p =
(
rho
- (1.0 - gamma)*rhol0
- ((gamma*psiv + (1.0 - gamma)*psil) - psi)*pSat
)/psi;
}
surfaceScalarField rhof("rhof", fvc::interpolate(rho));
volScalarField rAU(1.0/UEqn.A());
surfaceScalarField rAUf("Dp", rhof*fvc::interpolate(rAU));
volVectorField HbyA("HbyA", U);
HbyA = rAU*UEqn.H();
phiv = (fvc::interpolate(HbyA) & mesh.Sf())
+ fvc::ddtPhiCorr(rAU, rho, U, phivAbs);
fvc::makeRelative(phiv, U);
surfaceScalarField phiGradp(rAUf*mesh.magSf()*fvc::snGrad(p));
phiv -= phiGradp/rhof;
volScalarField rho0(rho - psi*p);
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix pEqn
(
fvc::ddt(rho)
+ psi*correction(fvm::ddt(p))
+ fvc::div(phiv, rho)
+ fvc::div(phiGradp)
- fvm::laplacian(rAUf, p)
);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
if (pimple.finalNonOrthogonalIter())
{
phiv += (phiGradp + pEqn.flux())/rhof;
phivAbs = fvc::absolute(phiv, U);
}
}
Info<< "Predicted p max-min : " << max(p).value()
<< " " << min(p).value() << endl;
rho == max(rho0 + psi*p, rhoMin);
#include "gammaPsi.H"
p =
(
rho
- (1.0 - gamma)*rhol0
- ((gamma*psiv + (1.0 - gamma)*psil) - psi)*pSat
)/psi;
p.correctBoundaryConditions();
Info<< "Phase-change corrected p max-min : " << max(p).value()
<< " " << min(p).value() << endl;
// Correct velocity
U = HbyA - rAU*fvc::grad(p);
// Remove the swirl component of velocity for "wedge" cases
if (pimple.dict().found("removeSwirl"))
{
label swirlCmpt(readLabel(pimple.dict().lookup("removeSwirl")));
Info<< "Removing swirl component-" << swirlCmpt << " of U" << endl;
U.field().replace(swirlCmpt, 0.0);
}
U.correctBoundaryConditions();
Info<< "max(U) " << max(mag(U)).value() << endl;
}

View File

@ -6,7 +6,7 @@
surfaceScalarField phic(mag(phi/mesh.magSf()));
phic = min(interface.cAlpha()*phic, max(phic));
volScalarField divU(fvc::div(phi));
volScalarField divU(fvc::div(fvc::absolute(phi, U)));
if (nAlphaSubCycles > 1)
{
@ -29,10 +29,4 @@
{
#include "alphaEqns.H"
}
// correct interface on first PIMPLE corrector
if (pimple.corr() == 1)
{
interface.correct();
}
}

View File

@ -1,40 +0,0 @@
{
label nAlphaCorr(readLabel(pimple.dict().lookup("nAlphaCorr")));
label nAlphaSubCycles(readLabel(pimple.dict().lookup("nAlphaSubCycles")));
surfaceScalarField phic(mag(phi/mesh.magSf()));
phic = min(interface.cAlpha()*phic, max(phic));
fvc::makeAbsolute(phi, U);
volScalarField divU(fvc::div(phi));
fvc::makeRelative(phi, U);
if (nAlphaSubCycles > 1)
{
dimensionedScalar totalDeltaT = runTime.deltaT();
surfaceScalarField rhoPhiSum(0.0*rhoPhi);
for
(
subCycle<volScalarField> alphaSubCycle(alpha1, nAlphaSubCycles);
!(++alphaSubCycle).end();
)
{
#include "alphaEqns.H"
rhoPhiSum += (runTime.deltaT()/totalDeltaT)*rhoPhi;
}
rhoPhi = rhoPhiSum;
}
else
{
#include "alphaEqns.H"
}
// correct interface on first PIMPLE corrector
if (pimple.corr() == 1)
{
interface.correct();
}
}

View File

@ -122,6 +122,12 @@ int main(int argc, char *argv[])
{
#include "alphaEqnsSubCycle.H"
// correct interface on first PIMPLE corrector
if (pimple.corr() == 1)
{
interface.correct();
}
solve(fvm::ddt(rho) + fvc::div(rhoPhi));
#include "UEqn.H"

View File

@ -80,6 +80,12 @@ int main(int argc, char *argv[])
{
#include "alphaEqnsSubCycle.H"
// correct interface on first PIMPLE corrector
if (pimple.corr() == 1)
{
interface.correct();
}
solve(fvm::ddt(rho) + fvc::div(rhoPhi));
#include "UEqn.H"

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -77,6 +77,7 @@ int main(int argc, char *argv[])
twoPhaseProperties.correct();
#include "alphaEqnSubCycle.H"
interface.correct();
turbulence->correct();

View File

@ -30,8 +30,8 @@
rhoPhi = phiAlpha*(rho1 - rho2) + phi*rho2;
}
Info<< "Liquid phase volume fraction = "
<< alpha1.weightedAverage(mesh.V()).value()
Info<< "Phase-1 volume fraction = "
<< alpha1.weightedAverage(mesh.Vsc()).value()
<< " Min(alpha1) = " << min(alpha1).value()
<< " Max(alpha1) = " << max(alpha1).value()
<< endl;

View File

@ -1,8 +1,5 @@
const dictionary& pimpleDict = pimple.dict();
label nAlphaCorr(readLabel(pimpleDict.lookup("nAlphaCorr")));
label nAlphaSubCycles(readLabel(pimpleDict.lookup("nAlphaSubCycles")));
label nAlphaCorr(readLabel(pimple.dict().lookup("nAlphaCorr")));
label nAlphaSubCycles(readLabel(pimple.dict().lookup("nAlphaSubCycles")));
if (nAlphaSubCycles > 1)
{
@ -26,6 +23,4 @@ else
#include "alphaEqn.H"
}
interface.correct();
rho == alpha1*rho1 + (scalar(1) - alpha1)*rho2;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -81,6 +81,7 @@ int main(int argc, char *argv[])
twoPhaseProperties.correct();
#include "alphaEqnSubCycle.H"
interface.correct();
#include "zonePhaseVolumes.H"
// --- Pressure-velocity PIMPLE corrector loop

View File

@ -23,6 +23,4 @@ else
#include "alphaEqn.H"
}
interface.correct();
rho == alpha1*rho1 + (scalar(1) - alpha1)*rho2;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -114,6 +114,7 @@ int main(int argc, char *argv[])
twoPhaseProperties.correct();
#include "alphaEqnSubCycle.H"
interface.correct();
// --- Pressure-velocity PIMPLE corrector loop
while (pimple.loop())

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -43,7 +43,6 @@ Description
#include "interfaceProperties.H"
#include "twoPhaseMixture.H"
#include "turbulenceModel.H"
#include "interpolationTable.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -82,6 +81,7 @@ int main(int argc, char *argv[])
twoPhaseProperties.correct();
#include "alphaEqnSubCycle.H"
interface.correct();
// --- Pressure-velocity PIMPLE corrector loop
while (pimple.loop())

View File

@ -1 +1 @@
porousZones pZones(mesh);
IOporosityModelList pZones(mesh);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -44,7 +44,7 @@ Description
#include "interfaceProperties.H"
#include "twoPhaseMixture.H"
#include "turbulenceModel.H"
#include "porousZones.H"
#include "IOporosityModelList.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -83,6 +83,7 @@ int main(int argc, char *argv[])
twoPhaseProperties.correct();
#include "alphaEqnSubCycle.H"
interface.correct();
// --- Pressure-velocity PIMPLE corrector loop
while (pimple.loop())

View File

@ -24,8 +24,6 @@ else
#include "alphaEqns.H"
}
interface.correct();
{
volScalarField rhoNew(alpha1*rho1 + alpha2*rho2 + alpha3*rho3);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -74,6 +74,7 @@ int main(int argc, char *argv[])
threePhaseProperties.correct();
#include "alphaEqnsSubCycle.H"
interface.correct();
#define twoPhaseProperties threePhaseProperties

View File

@ -40,10 +40,5 @@ surfaceScalarField rhoPhi
#include "alphaEqn.H"
}
if (pimple.nCorrPIMPLE() == 1)
{
interface.correct();
}
rho == alpha1*rho1 + (scalar(1) - alpha1)*rho2;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -82,6 +82,11 @@ int main(int argc, char *argv[])
#include "alphaEqnSubCycle.H"
if (pimple.nCorrPIMPLE() == 1)
{
interface.correct();
}
turbulence->correct();
// --- Pressure-velocity PIMPLE corrector loop

View File

@ -1,4 +1,5 @@
EXE_INC = \
-I../interFoam \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \

View File

@ -0,0 +1,18 @@
{
fvScalarMatrix alpha1Eqn
(
fvm::ddt(alpha1)
- fvc::ddt(alpha1)
- fvm::laplacian
(
volScalarField("Dab", Dab + alphatab*turbulence->nut()),
alpha1
)
);
alpha1Eqn.solve();
rhoPhi += alpha1Eqn.flux()*(rho1 - rho2);
}
rho = alpha1*rho1 + (scalar(1) - alpha1)*rho2;

View File

@ -1,22 +1,22 @@
{
fvScalarMatrix alpha1Eqn
word alphaScheme("div(phi,alpha1)");
surfaceScalarField phiAlpha
(
fvm::ddt(alpha1)
+ fvm::div(phi, alpha1)
- fvm::laplacian
fvc::flux
(
Dab + alphatab*turbulence->nut(), alpha1,
"laplacian(Dab,alpha1)"
phi,
alpha1,
alphaScheme
)
);
alpha1Eqn.solve();
MULES::explicitSolve(alpha1, phi, phiAlpha, 1, 0);
rhoPhi = alpha1Eqn.flux()*(rho1 - rho2) + phi*rho2;
rho = alpha1*rho1 + (scalar(1) - alpha1)*rho2;
rhoPhi = phiAlpha*(rho1 - rho2) + phi*rho2;
Info<< "Phase 1 volume fraction = "
<< alpha1.weightedAverage(mesh.V()).value()
Info<< "Phase-1 volume fraction = "
<< alpha1.weightedAverage(mesh.Vsc()).value()
<< " Min(alpha1) = " << min(alpha1).value()
<< " Max(alpha1) = " << max(alpha1).value()
<< endl;

View File

@ -0,0 +1,26 @@
label nAlphaCorr(readLabel(pimple.dict().lookup("nAlphaCorr")));
label nAlphaSubCycles(readLabel(pimple.dict().lookup("nAlphaSubCycles")));
if (nAlphaSubCycles > 1)
{
dimensionedScalar totalDeltaT = runTime.deltaT();
surfaceScalarField rhoPhiSum(0.0*rhoPhi);
for
(
subCycle<volScalarField> alphaSubCycle(alpha1, nAlphaSubCycles);
!(++alphaSubCycle).end();
)
{
#include "alphaEqn.H"
rhoPhiSum += (runTime.deltaT()/totalDeltaT)*rhoPhi;
}
rhoPhi = rhoPhiSum;
}
else
{
#include "alphaEqn.H"
}
rho == alpha1*rho1 + (scalar(1) - alpha1)*rho2;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -32,6 +32,8 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "MULES.H"
#include "subCycle.H"
#include "twoPhaseMixture.H"
#include "turbulenceModel.H"
#include "pimpleControl.H"
@ -60,19 +62,21 @@ int main(int argc, char *argv[])
{
#include "readTimeControls.H"
#include "CourantNo.H"
#include "alphaCourantNo.H"
#include "setDeltaT.H"
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
twoPhaseProperties.correct();
#include "alphaEqnSubCycle.H"
#include "alphaDiffusionEqn.H"
// --- Pressure-velocity PIMPLE corrector loop
while (pimple.loop())
{
twoPhaseProperties.correct();
#include "alphaEqn.H"
#include "UEqn.H"
// --- Pressure corrector loop

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -33,6 +33,7 @@ Description
#include "IOobject.H"
#include "IFstream.H"
#include "dictionary.H"
#include "stringOps.H"
using namespace Foam;
@ -45,6 +46,16 @@ int main(int argc, char *argv[])
argList::validArgs.insert("dict .. dictN");
argList args(argc, argv, false, true);
{
dictionary dict;
dict.add("aaOPENMPIcc", 1);
string s("DDD${aa${WM_MPLIB}cc}EEE");
stringOps::inplaceExpand(s, dict, true, false);
Info<< "variable expansion:" << s << endl;
}
Info<< nl
<< "FOAM_CASE=" << getEnv("FOAM_CASE") << nl
<< "FOAM_CASENAME=" << getEnv("FOAM_CASENAME") << nl

View File

@ -38,6 +38,15 @@ inactive
type zeroGradient;
}
// Indirection
varType active;
// Indirection of values
x 5;
varName x;
boundaryField
{
Default_Boundary_Region
@ -52,7 +61,7 @@ boundaryField
inlet_5 "a primitiveEntry is squashed by a directory entry";
inlet_5 { $inactive }
inlet_6 { $.inactive } // Test scoping
inlet_7 { $inactive }
inlet_7 { ${inactive}} // Test variable expansion
inlet_8 { $inactive }
#include "testDictInc"
@ -63,14 +72,14 @@ boundaryField
inletValue $internalField;
value #include "value";
// error #remove self;
x 5;
x ${${varName}}; // Test indirection/recursive expansion
y 6;
}
// this should have no effect
#remove inactive
inlet_7 { $active }
inlet_7 { ${${varType}}} // Test indirection/recursive expansion
#inputMode overwrite
inlet_8 { $active }
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -41,6 +41,45 @@ int main(int argc, char *argv[])
Info<< ds*dt << " " << dt*ds << endl;
// dimensionSet
{
Pout<< "dimensionSet construct from is:"
<< dimensionSet(IStringStream("[Pa m^2 s^-2]")())
<< endl;
IStringStream is("[Pa m^2 s^-2]");
dimensionSet dset(dimless);
is >> dset;
Pout<< "dimensionSet read:" << dset << endl;
}
// dimensionedType
{
Pout<< "construct from is:"
<< dimensionedScalar(IStringStream("bla [Pa mm^2 s^-2] 3.0")())
<< endl;
Pout<< "construct from name,is:"
<< dimensionedScalar
(
"ABC",
IStringStream("[Pa mm^2 s^-2] 3.0")()
) << endl;
Pout<< "construct from name,dimensionSet,is:"
<< dimensionedScalar
(
"ABC",
dimLength,
IStringStream("bla [mm] 3.0")()
) << endl;
{
IStringStream is("bla [mm] 3.0");
dimensionedScalar ds;
is >> ds;
Pout<< "read:" << ds << endl;
}
}
Info<< "End\n" << endl;
return 0;

Some files were not shown because too many files have changed in this diff Show More