Merge remote branch 'OpenCFD/master' into olesenm

This commit is contained in:
Mark Olesen 2011-03-17 16:58:45 +01:00
commit 24e935b19f
79 changed files with 743 additions and 605 deletions

View File

@ -1,11 +1,18 @@
EXE_INC = \
-IBCs/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-IBCs/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lbasicThermophysicalModels \
-lspecie \
-lrhoCentralFoam
-lrhoCentralFoam \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lcompressibleLESModels \
-lmeshTools

View File

@ -96,3 +96,18 @@ surfaceScalarField neg
mesh,
dimensionedScalar("neg", dimless, -1.0)
);
surfaceScalarField phi("phi", mesh.Sf() & fvc::interpolate(rhoU));
Info<< "Creating turbulence model\n" << endl;
autoPtr<compressible::turbulenceModel> turbulence
(
compressible::turbulenceModel::New
(
rho,
U,
phi,
thermo
)
);

View File

@ -1,10 +1,10 @@
EXE_INC = \
-I.. \
-I../BCs/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I../BCs/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
@ -13,5 +13,8 @@ EXE_LIBS = \
-lbasicThermophysicalModels \
-lspecie \
-lrhoCentralFoam \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lcompressibleLESModels \
-ldynamicMesh \
-lmeshTools

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
rhoCentralFoam
rhoCentralDyMFoam
Description
Density-based compressible flow solver based on central-upwind schemes of
@ -32,6 +32,7 @@ Description
#include "fvCFD.H"
#include "basicPsiThermo.H"
#include "turbulenceModel.H"
#include "zeroGradientFvPatchFields.H"
#include "fixedRhoFvPatchScalarField.H"
#include "motionSolver.H"
@ -185,12 +186,11 @@ int main(int argc, char *argv[])
+ aSf*p_pos - aSf*p_neg
);
volTensorField tauMC("tauMC", mu*dev2(Foam::T(fvc::grad(U))));
volScalarField muEff(turbulence->muEff());
volTensorField tauMC("tauMC", muEff*dev2(Foam::T(fvc::grad(U))));
// --- Solve density
Info<< max(rho) << " " << min(rho) << endl;
solve(fvm::ddt(rho) + fvc::div(phi));
Info<< max(rho) << " " << min(rho) << endl;
// --- Solve momentum
solve(fvm::ddt(rhoU) + fvc::div(phiUp));
@ -206,7 +206,7 @@ int main(int argc, char *argv[])
solve
(
fvm::ddt(rho, U) - fvc::ddt(rho, U)
- fvm::laplacian(mu, U)
- fvm::laplacian(muEff, U)
- fvc::div(tauMC)
);
rhoU = rho*U;
@ -216,7 +216,7 @@ int main(int argc, char *argv[])
surfaceScalarField sigmaDotU
(
(
fvc::interpolate(mu)*mesh.magSf()*fvc::snGrad(U)
fvc::interpolate(muEff)*mesh.magSf()*fvc::snGrad(U)
+ (mesh.Sf() & fvc::interpolate(tauMC))
)
& (a_pos*U_pos + a_neg*U_neg)
@ -240,12 +240,12 @@ int main(int argc, char *argv[])
if (!inviscid)
{
volScalarField k("k", thermo.Cp()*mu/Pr);
volScalarField k("k", thermo.Cp()*muEff/Pr);
solve
(
fvm::ddt(rho, e) - fvc::ddt(rho, e)
- fvm::laplacian(thermo.alpha(), e)
+ fvc::laplacian(thermo.alpha(), e)
- fvm::laplacian(turbulence->alphaEff(), e)
+ fvc::laplacian(turbulence->alpha(), e)
- fvc::laplacian(k, T)
);
thermo.correct();
@ -258,6 +258,8 @@ int main(int argc, char *argv[])
p.correctBoundaryConditions();
rho.boundaryField() = psi.boundaryField()*p.boundaryField();
turbulence->correct();
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -32,6 +32,7 @@ Description
#include "fvCFD.H"
#include "basicPsiThermo.H"
#include "turbulenceModel.H"
#include "zeroGradientFvPatchFields.H"
#include "fixedRhoFvPatchScalarField.H"
@ -51,7 +52,7 @@ int main(int argc, char *argv[])
#include "readFluxScheme.H"
dimensionedScalar v_zero("v_zero",dimVolume/dimTime, 0.0);
dimensionedScalar v_zero("v_zero", dimVolume/dimTime, 0.0);
Info<< "\nStarting time loop\n" << endl;
@ -128,14 +129,6 @@ int main(int argc, char *argv[])
surfaceScalarField amaxSf("amaxSf", max(mag(am), mag(ap)));
#include "compressibleCourantNo.H"
#include "readTimeControls.H"
#include "setDeltaT.H"
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
surfaceScalarField aSf(am*a_pos);
if (fluxScheme == "Tadmor")
@ -152,6 +145,18 @@ int main(int argc, char *argv[])
surfaceScalarField aphiv_pos(phiv_pos - aSf);
surfaceScalarField aphiv_neg(phiv_neg + aSf);
// Reuse amaxSf for the maximum positive and negative fluxes
// estimated by the central scheme
amaxSf = max(mag(aphiv_pos), mag(aphiv_neg));
#include "compressibleCourantNo.H"
#include "readTimeControls.H"
#include "setDeltaT.H"
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
surfaceScalarField phi("phi", aphiv_pos*rho_pos + aphiv_neg*rho_neg);
surfaceVectorField phiUp
@ -167,7 +172,8 @@ int main(int argc, char *argv[])
+ aSf*p_pos - aSf*p_neg
);
volTensorField tauMC("tauMC", mu*dev2(Foam::T(fvc::grad(U))));
volScalarField muEff(turbulence->muEff());
volTensorField tauMC("tauMC", muEff*dev2(Foam::T(fvc::grad(U))));
// --- Solve density
solve(fvm::ddt(rho) + fvc::div(phi));
@ -188,7 +194,7 @@ int main(int argc, char *argv[])
solve
(
fvm::ddt(rho, U) - fvc::ddt(rho, U)
- fvm::laplacian(mu, U)
- fvm::laplacian(muEff, U)
- fvc::div(tauMC)
);
rhoU = rho*U;
@ -198,7 +204,7 @@ int main(int argc, char *argv[])
surfaceScalarField sigmaDotU
(
(
fvc::interpolate(mu)*mesh.magSf()*fvc::snGrad(U)
fvc::interpolate(muEff)*mesh.magSf()*fvc::snGrad(U)
+ (mesh.Sf() & fvc::interpolate(tauMC))
)
& (a_pos*U_pos + a_neg*U_neg)
@ -222,12 +228,12 @@ int main(int argc, char *argv[])
if (!inviscid)
{
volScalarField k("k", thermo.Cp()*mu/Pr);
volScalarField k("k", thermo.Cp()*muEff/Pr);
solve
(
fvm::ddt(rho, e) - fvc::ddt(rho, e)
- fvm::laplacian(thermo.alpha(), e)
+ fvc::laplacian(thermo.alpha(), e)
- fvm::laplacian(turbulence->alphaEff(), e)
+ fvc::laplacian(turbulence->alpha(), e)
- fvc::laplacian(k, T)
);
thermo.correct();
@ -240,6 +246,8 @@ int main(int argc, char *argv[])
p.correctBoundaryConditions();
rho.boundaryField() = psi.boundaryField()*p.boundaryField();
turbulence->correct();
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"

View File

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

View File

@ -39,6 +39,16 @@
#include "compressibleCreatePhi.H"
dimensionedScalar rhoMax
(
mesh.solutionDict().subDict("PIMPLE").lookup("rhoMax")
);
dimensionedScalar rhoMin
(
mesh.solutionDict().subDict("PIMPLE").lookup("rhoMin")
);
Info<< "Creating turbulence model\n" << endl;
autoPtr<compressible::turbulenceModel> turbulence
(

View File

@ -1,4 +1,7 @@
rho = thermo.rho();
rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
rho.relax();
U = rAU*UEqn().H();
@ -98,6 +101,9 @@ p.relax();
// Recalculate density from the relaxed pressure
rho = thermo.rho();
rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
rho.relax();
Info<< "rho max/min : " << max(rho).value()
<< " " << min(rho).value() << endl;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -75,6 +75,7 @@ int main(int argc, char *argv[])
if (nOuterCorr != 1)
{
p.storePrevIter();
rho.storePrevIter();
}
#include "UEqn.H"

View File

@ -1,5 +1,5 @@
EXE_INC = \
-I../rhoPimpleFoam \
-I.. \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/finiteVolume/cfdTools \

View File

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

View File

@ -1,4 +1,7 @@
rho = thermo.rho();
rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
rho.relax();
volScalarField rAU(1.0/UEqn().A());
U = rAU*UEqn().H();
@ -96,30 +99,17 @@ else
#include "rhoEqn.H"
#include "compressibleContinuityErrs.H"
//if (oCorr != nOuterCorr-1)
{
// Explicitly relax pressure for momentum corrector
p.relax();
// Explicitly relax pressure for momentum corrector
p.relax();
rho = thermo.rho();
rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
rho.relax();
Info<< "rho max/min : " << max(rho).value()
<< " " << min(rho).value() << endl;
}
rho = thermo.rho();
rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
rho.relax();
Info<< "rho max/min : " << max(rho).value()
<< " " << min(rho).value() << endl;
U -= rAU*fvc::grad(p);
U.correctBoundaryConditions();
DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
// 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);
}
*/

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -48,6 +48,7 @@ int main(int argc, char *argv[])
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"
#include "createZones.H"
#include "initContinuityErrs.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -1,77 +0,0 @@
Info<< "Reading thermophysical properties\n" << endl;
autoPtr<basicPsiThermo> pThermo
(
basicPsiThermo::New(mesh)
);
basicPsiThermo& thermo = pThermo();
volScalarField& p = thermo.p();
volScalarField& h = thermo.h();
const volScalarField& psi = thermo.psi();
volScalarField rho
(
IOobject
(
"rho",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
thermo.rho()
);
Info<< "Reading field U\n" << endl;
volVectorField U
(
IOobject
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
#include "compressibleCreatePhi.H"
dimensionedScalar rhoMax
(
mesh.solutionDict().subDict("PIMPLE").lookup("rhoMax")
);
dimensionedScalar rhoMin
(
mesh.solutionDict().subDict("PIMPLE").lookup("rhoMin")
);
Info<< "Creating turbulence model\n" << endl;
autoPtr<compressible::turbulenceModel> turbulence
(
compressible::turbulenceModel::New
(
rho,
U,
phi,
thermo
)
);
//dimensionedScalar initialMass = fvc::domainIntegrate(rho);
Info<< "Creating field DpDt\n" << endl;
volScalarField DpDt
(
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p)
);
MRFZones mrfZones(mesh);
mrfZones.correctBoundaryVelocity(U);
porousZones pZones(mesh);
Switch pressureImplicitPorosity(false);

View File

@ -1,98 +0,0 @@
Info<< "Reading thermophysical properties\n" << endl;
autoPtr<basicPsiThermo> pThermo
(
basicPsiThermo::New(mesh)
);
basicPsiThermo& thermo = pThermo();
volScalarField rho
(
IOobject
(
"rho",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
thermo.rho()
);
volScalarField& p = thermo.p();
volScalarField& h = thermo.h();
const volScalarField& psi = thermo.psi();
Info<< "Reading field U\n" << endl;
volVectorField U
(
IOobject
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
#include "compressibleCreatePhi.H"
label pRefCell = 0;
scalar pRefValue = 0.0;
setRefCell(p, mesh.solutionDict().subDict("SIMPLE"), pRefCell, pRefValue);
dimensionedScalar rhoMax
(
mesh.solutionDict().subDict("SIMPLE").lookup("rhoMax")
);
dimensionedScalar rhoMin
(
mesh.solutionDict().subDict("SIMPLE").lookup("rhoMin")
);
Info<< "Creating turbulence model\n" << endl;
autoPtr<compressible::RASModel> turbulence
(
compressible::RASModel::New
(
rho,
U,
phi,
thermo
)
);
dimensionedScalar initialMass = fvc::domainIntegrate(rho);
thermalPorousZones pZones(mesh);
Switch pressureImplicitPorosity(false);
// nUCorrectors used for pressureImplicitPorosity
int nUCorr = 0;
if (pZones.size())
{
// nUCorrectors for pressureImplicitPorosity
if (mesh.solutionDict().subDict("SIMPLE").found("nUCorrectors"))
{
nUCorr = readInt
(
mesh.solutionDict().subDict("SIMPLE").lookup("nUCorrectors")
);
}
if (nUCorr > 0)
{
pressureImplicitPorosity = true;
Info<< "Using pressure implicit porosity" << endl;
}
else
{
Info<< "Using pressure explicit porosity" << endl;
}
}

View File

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

View File

@ -1,4 +1,5 @@
EXE_INC = \
-I.. \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermalPorousZone/lnInclude \
-I$(LIB_SRC)/turbulenceModels \

View File

@ -0,0 +1,27 @@
thermalPorousZones pZones(mesh);
Switch pressureImplicitPorosity(false);
// nUCorrectors used for pressureImplicitPorosity
int nUCorr = 0;
if (pZones.size())
{
// nUCorrectors for pressureImplicitPorosity
if (mesh.solutionDict().subDict("SIMPLE").found("nUCorrectors"))
{
nUCorr = readInt
(
mesh.solutionDict().subDict("SIMPLE").lookup("nUCorrectors")
);
}
if (nUCorr > 0)
{
pressureImplicitPorosity = true;
Info<< "Using pressure implicit porosity" << endl;
}
else
{
Info<< "Using pressure explicit porosity" << endl;
}
}

View File

@ -5,8 +5,8 @@
- fvm::Sp(fvc::div(phi), h)
- fvm::laplacian(turbulence->alphaEff(), h)
==
fvc::div(phi/fvc::interpolate(rho)*fvc::interpolate(p, "div(U,p)"))
- p*fvc::div(phi/fvc::interpolate(rho))
fvc::div(phi/fvc::interpolate(rho), rho/psi, "div(U,p)")
- (rho/psi)*fvc::div(phi/fvc::interpolate(rho))
);
pZones.addEnthalpySource(thermo, rho, hEqn);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -43,6 +43,7 @@ int main(int argc, char *argv[])
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"
#include "createPorousZones.H"
#include "initContinuityErrs.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -1,20 +0,0 @@
{
#include "rhoEqn.H"
}
{
scalar sumLocalContErr =
sum
(
mag(rho.internalField() - (psi*p)().internalField())
)/sum(rho.internalField());
scalar globalContErr =
sum(rho.internalField() - (psi*p)().internalField())
/sum(rho.internalField());
cumulativeContErr += globalContErr;
Info<< "time step continuity errors : sum local = " << sumLocalContErr
<< ", global = " << globalContErr
<< ", cumulative = " << cumulativeContErr << endl;
}

View File

@ -1,57 +0,0 @@
Info<< "Reading thermophysical properties\n" << endl;
autoPtr<basicPsiThermo> pThermo
(
basicPsiThermo::New(mesh)
);
basicPsiThermo& thermo = pThermo();
volScalarField& p = thermo.p();
volScalarField& e = thermo.e();
const volScalarField& psi = thermo.psi();
volScalarField rho
(
IOobject
(
"rho",
runTime.timeName(),
mesh
),
thermo.rho()
);
Info<< "Reading field U\n" << endl;
volVectorField U
(
IOobject
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
# include "compressibleCreatePhi.H"
Info<< "Creating turbulence model\n" << endl;
autoPtr<compressible::turbulenceModel> turbulence
(
compressible::turbulenceModel::New
(
rho,
U,
phi,
thermo
)
);
Info<< "Creating field DpDt\n" << endl;
volScalarField DpDt
(
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p)
);

View File

@ -1,23 +0,0 @@
Info<< "Reading thermodynamicProperties\n" << endl;
IOdictionary thermodynamicProperties
(
IOobject
(
"thermodynamicProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
dimensionedScalar R
(
thermodynamicProperties.lookup("R")
);
dimensionedScalar Cv
(
thermodynamicProperties.lookup("Cv")
);

View File

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

View File

@ -1,8 +1,8 @@
fvVectorMatrix UEqn
(
fvm::ddt(rho, U)
+ fvm::div(phi, U)
+ turbulence->divDevRhoReff(U)
+ fvm::div(phi, U)
+ turbulence->divDevRhoReff(U)
);
solve(UEqn == -fvc::grad(p));

View File

@ -1,5 +1,5 @@
EXE_INC = \
-I../sonicFoam \
-I.. \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/finiteVolume/lnInclude \

View File

@ -0,0 +1,33 @@
rho = thermo.rho();
volScalarField rAU(1.0/UEqn.A());
U = UEqn.H()/UEqn.A();
surfaceScalarField phid
(
"phid",
fvc::interpolate(psi)
*(
(fvc::interpolate(U) & mesh.Sf())
- fvc::meshPhi(rho, U)
)
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pEqn
(
fvm::ddt(psi, p)
+ fvm::div(phid, p)
- fvm::laplacian(rho*rAU, p)
);
pEqn.solve();
phi = pEqn.flux();
}
#include "compressibleContinuityErrs.H"
U -= rAU*fvc::grad(p);
U.correctBoundaryConditions();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -62,14 +62,7 @@ int main(int argc, char *argv[])
#include "rhoEqn.H"
fvVectorMatrix UEqn
(
fvm::ddt(rho, U)
+ fvm::div(phi, U)
+ turbulence->divDevRhoReff(U)
);
solve(UEqn == -fvc::grad(p));
#include "UEqn.H"
#include "eEqn.H"
@ -78,50 +71,12 @@ int main(int argc, char *argv[])
for (int corr=0; corr<nCorr; corr++)
{
U = UEqn.H()/UEqn.A();
surfaceScalarField phid
(
"phid",
fvc::interpolate(psi)
*(
(fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U)
)
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pEqn
(
fvm::ddt(psi, p)
+ fvm::div(phid, p)
- fvm::laplacian(rho/UEqn.A(), p)
);
pEqn.solve();
phi = pEqn.flux();
}
#include "compressibleContinuityErrs.H"
U -= fvc::grad(p)/UEqn.A();
U.correctBoundaryConditions();
#include "pEqn.H"
}
DpDt = fvc::DDt
(
surfaceScalarField
(
"phiU",
phi/fvc::interpolate(rho) + fvc::meshPhi(rho, U)
),
p
);
turbulence->correct();
rho = psi*p;
rho = thermo.rho();
runTime.write();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -1,18 +0,0 @@
Info<< "Reading transportProperties\n" << endl;
IOdictionary transportProperties
(
IOobject
(
"transportProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
dimensionedScalar mu
(
transportProperties.lookup("mu")
);

View File

@ -48,6 +48,7 @@ $(RADIATION)/absorptionEmission/cloudAbsorptionEmission/cloudAbsorptionEmission.
$(RADIATION)/scatter/cloudScatter/cloudScatter.C
submodels/Kinematic/PatchInteractionModel/LocalInteraction/patchInteractionData.C
submodels/Kinematic/PatchInteractionModel/LocalInteraction/patchInteractionDataList.C
KINEMATICINJECTION=submodels/Kinematic/InjectionModel
$(KINEMATICINJECTION)/KinematicLookupTableInjection/kinematicParcelInjectionData.C

View File

@ -127,17 +127,19 @@ void Foam::cloudSolution::read()
schemes_.setSize(vars.size());
forAll(vars, i)
{
// read solution variable name
schemes_[i].first() = vars[i];
// set semi-implicit (1) explicit (0) flag
Istream& is = schemesDict.lookup(vars[i]);
const word scheme(is);
if (scheme == "semiImplicit")
{
is >> schemes_[i].second();
schemes_[i].second().first() = true;
}
else if (scheme == "explicit")
{
schemes_[i].second() = -1;
schemes_[i].second().first() = false;
}
else
{
@ -145,6 +147,9 @@ void Foam::cloudSolution::read()
<< "Invalid scheme " << scheme << ". Valid schemes are "
<< "explicit and semiImplicit" << exit(FatalError);
}
// read under-relaxation factor
is >> schemes_[i].second().second();
}
}
@ -155,7 +160,7 @@ Foam::scalar Foam::cloudSolution::relaxCoeff(const word& fieldName) const
{
if (fieldName == schemes_[i].first())
{
return schemes_[i].second();
return schemes_[i].second().second();
}
}
@ -173,7 +178,7 @@ bool Foam::cloudSolution::semiImplicit(const word& fieldName) const
{
if (fieldName == schemes_[i].first())
{
return schemes_[i].second() >= 0;
return schemes_[i].second().first();
}
}

View File

@ -25,7 +25,7 @@ Class
Foam::cloudSolution
Description
- Stores all relevant solution info
Stores all relevant solution info for cloud
SourceFiles
cloudSolutionI.H
@ -100,7 +100,7 @@ class cloudSolution
Switch resetSourcesOnStartup_;
//- List schemes, e.g. U semiImplicit 1
List<Tuple2<word, scalar> > schemes_;
List<Tuple2<word, Tuple2<bool, scalar> > > schemes_;
// Private Member Functions

View File

@ -33,9 +33,9 @@ Foam::label Foam::LocalInteraction<CloudType>::applyToPatch
const label globalPatchI
) const
{
forAll(patchIds_, patchI)
forAll(patchIDs_, patchI)
{
if (patchIds_[patchI] == globalPatchI)
if (patchIDs_[patchI] == globalPatchI)
{
return patchI;
}
@ -130,8 +130,8 @@ Foam::LocalInteraction<CloudType>::LocalInteraction
)
:
PatchInteractionModel<CloudType>(dict, cloud, typeName),
patchData_(this->coeffDict().lookup("patches")),
patchIds_(patchData_.size()),
patchData_(cloud.mesh(), this->coeffDict().lookup("patches")),
patchIDs_(patchData_.size()),
nEscape0_(patchData_.size(), 0),
massEscape0_(patchData_.size(), 0.0),
nStick0_(patchData_.size(), 0),
@ -141,44 +141,6 @@ Foam::LocalInteraction<CloudType>::LocalInteraction
nStick_(patchData_.size(), 0),
massStick_(patchData_.size(), 0.0)
{
const polyMesh& mesh = cloud.mesh();
const polyBoundaryMesh& bMesh = mesh.boundaryMesh();
// check that user patches are valid region patches
forAll(patchData_, patchI)
{
const word& patchName = patchData_[patchI].patchName();
patchIds_[patchI] = bMesh.findPatchID(patchName);
if (patchIds_[patchI] < 0)
{
FatalErrorIn("LocalInteraction(const dictionary&, CloudType&)")
<< "Patch " << patchName << " not found. Available patches "
<< "are: " << bMesh.names() << nl << exit(FatalError);
}
}
// check that all walls are specified
DynamicList<word> badWalls;
forAll(bMesh, patchI)
{
if
(
isA<wallPolyPatch>(bMesh[patchI])
&& applyToPatch(bMesh[patchI].index()) < 0
)
{
badWalls.append(bMesh[patchI].name());
}
}
if (badWalls.size() > 0)
{
FatalErrorIn("LocalInteraction(const dictionary&, CloudType&)")
<< "All wall patches must be specified when employing local patch "
<< "interaction. Please specify data for patches:" << nl
<< badWalls << nl << exit(FatalError);
}
// check that interactions are valid/specified
forAll(patchData_, patchI)
{
@ -211,7 +173,7 @@ Foam::LocalInteraction<CloudType>::LocalInteraction
:
PatchInteractionModel<CloudType>(pim),
patchData_(pim.patchData_),
patchIds_(pim.patchIds_),
patchIDs_(pim.patchIDs_),
nEscape0_(pim.nEscape0_),
massEscape0_(pim.massEscape0_),
nStick0_(pim.nStick0_),

View File

@ -33,7 +33,7 @@ Description
#define LocalInteraction_H
#include "PatchInteractionModel.H"
#include "patchInteractionData.H"
#include "patchInteractionDataList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -51,10 +51,10 @@ class LocalInteraction
// Private data
//- List of participating patches
const List<patchInteractionData> patchData_;
const patchInteractionDataList patchData_;
//- List of participating patch ids
List<label> patchIds_;
List<label> patchIDs_;
// Counters for initial particle fates

View File

@ -0,0 +1,130 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
\\/ 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/>.
\*---------------------------------------------------------------------------*/
#include "patchInteractionDataList.H"
#include "stringListOps.H"
#include "wallPolyPatch.H"
// * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * //
Foam::patchInteractionDataList::patchInteractionDataList()
:
List<patchInteractionData>(),
patchGroupIDs_()
{}
Foam::patchInteractionDataList::patchInteractionDataList
(
const polyMesh& mesh,
const dictionary& dict
)
:
List<patchInteractionData>(dict.lookup("patches")),
patchGroupIDs_(this->size())
{
const polyBoundaryMesh& bMesh = mesh.boundaryMesh();
const wordList allPatchNames = bMesh.names();
const List<patchInteractionData>& items = *this;
forAllReverse(items, i)
{
const word& patchName = items[i].patchName();
labelList patchIDs = findStrings(patchName, allPatchNames);
if (patchIDs.empty())
{
WarningIn
(
"Foam::patchInteractionDataList::patchInteractionDataList"
"("
"const polyMesh&, "
"const dictionary&"
")"
) << "Cannot find any patch names matching " << patchName
<< endl;
}
patchGroupIDs_[i].transfer(patchIDs);
}
// check that all walls are specified
DynamicList<word> badWalls;
forAll(bMesh, patchI)
{
const polyPatch& pp = bMesh[patchI];
if (isA<wallPolyPatch>(pp) && applyToPatch(pp.index()) < 0)
{
badWalls.append(pp.name());
}
}
if (badWalls.size() > 0)
{
FatalErrorIn
(
"Foam::patchInteractionDataList::patchInteractionDataList"
"("
"const polyMesh&, "
"const dictionary&"
")"
) << "All wall patches must be specified when employing local patch "
<< "interaction. Please specify data for patches:" << nl
<< badWalls << nl << exit(FatalError);
}
}
Foam::patchInteractionDataList::patchInteractionDataList
(
const patchInteractionDataList& pidl
)
:
List<patchInteractionData>(pidl),
patchGroupIDs_(pidl.patchGroupIDs_)
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::label Foam::patchInteractionDataList::applyToPatch(const label id) const
{
forAll(patchGroupIDs_, groupI)
{
const labelList& patchIDs = patchGroupIDs_[groupI];
forAll(patchIDs, patchI)
{
if (patchIDs[patchI] == id)
{
return groupI;
}
}
}
return -1;
}
// ************************************************************************* //

View File

@ -0,0 +1,90 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
\\/ 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/>.
Class
Foam::patchInteractionDataList
Description
List container for patchInteractionData class
\*---------------------------------------------------------------------------*/
#ifndef patchInteractionDataList_H
#define patchInteractionDataList_H
#include "patchInteractionData.H"
#include "polyMesh.H"
#include "dictionary.H"
#include "labelList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class patchInteractionDataList Declaration
\*---------------------------------------------------------------------------*/
class patchInteractionDataList
:
public List<patchInteractionData>
{
private:
// Private data
//- List of patch IDs for each patch group
labelListList patchGroupIDs_;
public:
// Constructor
//- Construct null
patchInteractionDataList();
//- Construct copy
patchInteractionDataList(const patchInteractionDataList& pidl);
//- Construct from Istream
patchInteractionDataList(const polyMesh& mesh, const dictionary& dict);
// Member functions
//- Return label of group containing patch id
// Returns -1 if patch id is not present
label applyToPatch(const label id) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,6 +25,7 @@ License
#include "PatchPostProcessing.H"
#include "Pstream.H"
#include "stringListOps.H"
#include "ListListOps.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -35,12 +36,15 @@ Foam::label Foam::PatchPostProcessing<CloudType>::applyToPatch
const label globalPatchI
) const
{
forAll(patchIds_, patchI)
label patchI = 0;
forAllConstIter(labelHashSet, patchIDs_, iter)
{
if (patchIds_[patchI] == globalPatchI)
if (iter.key() == globalPatchI)
{
return patchI;
}
patchI++;
}
return -1;
@ -52,16 +56,18 @@ Foam::label Foam::PatchPostProcessing<CloudType>::applyToPatch
template<class CloudType>
void Foam::PatchPostProcessing<CloudType>::write()
{
forAll(patchData_, patchI)
forAll(patchData_, i)
{
List<List<string> > procData(Pstream::nProcs());
procData[Pstream::myProcNo()] = patchData_[patchI];
procData[Pstream::myProcNo()] = patchData_[i];
Pstream::gatherList(procData);
if (Pstream::master())
{
fileName outputDir = this->owner().time().path();
const fvMesh& mesh = this->owner().mesh();
fileName outputDir = mesh.time().path();
if (Pstream::parRun())
{
@ -69,24 +75,26 @@ void Foam::PatchPostProcessing<CloudType>::write()
// distributed data running)
outputDir =
outputDir/".."/"postProcessing"/cloud::prefix/
this->owner().name()/this->owner().time().timeName();
this->owner().name()/mesh.time().timeName();
}
else
{
outputDir =
outputDir/"postProcessing"/cloud::prefix/
this->owner().name()/this->owner().time().timeName();
this->owner().name()/mesh.time().timeName();
}
// Create directory if it doesn't exist
mkDir(outputDir);
const word& patchName = mesh.boundaryMesh()[patchIDs_[i]].name();
OFstream patchOutFile
(
outputDir/patchNames_[patchI] + ".post",
outputDir/patchName + ".post",
IOstream::ASCII,
IOstream::currentVersion,
this->owner().time().writeCompression()
mesh.time().writeCompression()
);
List<string> globalData;
@ -99,13 +107,13 @@ void Foam::PatchPostProcessing<CloudType>::write()
patchOutFile<< "# Time " + parcelType::propHeader << nl;
forAll(globalData, i)
forAll(globalData, dataI)
{
patchOutFile<< globalData[i].c_str() << nl;
patchOutFile<< globalData[dataI].c_str() << nl;
}
}
patchData_[patchI].clearStorage();
patchData_[i].clearStorage();
}
}
@ -121,29 +129,36 @@ Foam::PatchPostProcessing<CloudType>::PatchPostProcessing
:
PostProcessingModel<CloudType>(dict, owner, typeName),
maxStoredParcels_(readLabel(this->coeffDict().lookup("maxStoredParcels"))),
patchNames_(this->coeffDict().lookup("patches")),
patchData_(patchNames_.size()),
patchIds_(patchNames_.size())
patchIDs_(),
patchData_()
{
const polyBoundaryMesh& bMesh = this->owner().mesh().boundaryMesh();
forAll(patchNames_, patchI)
const wordList allPatchNames = owner.mesh().boundaryMesh().names();
wordList patchName(this->coeffDict().lookup("patches"));
forAllReverse(patchName, i)
{
const label id = bMesh.findPatchID(patchNames_[patchI]);
if (id < 0)
labelList patchIDs = findStrings(patchName[i], allPatchNames);
if (patchIDs.empty())
{
FatalErrorIn
WarningIn
(
"PatchPostProcessing<CloudType>::PatchPostProcessing"
"Foam::PatchPostProcessing<CloudType>::PatchPostProcessing"
"("
"const dictionary&, "
"CloudType& owner"
"CloudType& "
")"
)<< "Requested patch " << patchNames_[patchI] << " not found" << nl
<< "Available patches are: " << bMesh.names() << nl
<< exit(FatalError);
) << "Cannot find any patch names matching " << patchName[i]
<< endl;
}
forAll(patchIDs, j)
{
patchIDs_.insert(patchIDs[j]);
}
patchIds_[patchI] = id;
}
patchData_.setSize(patchIDs_.size());
}
@ -155,9 +170,8 @@ Foam::PatchPostProcessing<CloudType>::PatchPostProcessing
:
PostProcessingModel<CloudType>(ppm),
maxStoredParcels_(ppm.maxStoredParcels_),
patchNames_(ppm.patchNames_),
patchData_(ppm.patchData_),
patchIds_(ppm.patchIds_)
patchIDs_(ppm.patchIDs_),
patchData_(ppm.patchData_)
{}
@ -177,8 +191,8 @@ void Foam::PatchPostProcessing<CloudType>::postPatch
const label patchI
)
{
label localPatchI = applyToPatch(patchI);
if (localPatchI >= 0 && patchData_[localPatchI].size() < maxStoredParcels_)
const label localPatchI = applyToPatch(patchI);
if (localPatchI != -1 && patchData_[localPatchI].size() < maxStoredParcels_)
{
OStringStream data;
data<< this->owner().time().timeName() << ' ' << p;

View File

@ -58,15 +58,12 @@ class PatchPostProcessing
//- Maximum number of parcels to store
label maxStoredParcels_;
//- List of patch names
wordList patchNames_;
//- List of patch indices to post-process
labelHashSet patchIDs_;
//- List of output data per patch
List<DynamicList<string> > patchData_;
//- Mapping from local to global patch ids
labelList patchIds_;
// Private Member Functions
@ -117,11 +114,8 @@ public:
//- Return maximum number of parcels to store per patch
inline label maxStoredParcels() const;
//- Return const access to the list of patch names
inline const wordList& patchNames() const;
//- Return const mapping from local to global patch ids
inline const labelList& patchIds() const;
inline const labelList& patchIDs() const;
// Evaluation

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -31,17 +31,9 @@ Foam::label Foam::PatchPostProcessing<CloudType>::maxStoredParcels() const
template<class CloudType>
const Foam::wordList& Foam::PatchPostProcessing<CloudType>::patchNames() const
const Foam::labelList& Foam::PatchPostProcessing<CloudType>::patchIDs() const
{
return patchNames_;
}
template<class CloudType>
const Foam::labelList&
Foam::PatchPostProcessing<CloudType>::patchIds() const
{
return patchIds_;
return patchIDs_;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -231,28 +231,43 @@ void Foam::sampledSets::write()
void Foam::sampledSets::read(const dictionary& dict)
{
dict_ = dict;
dict_.lookup("fields") >> fieldSelection_;
clearFieldGroups();
dict.lookup("interpolationScheme") >> interpolationScheme_;
dict.lookup("setFormat") >> writeFormat_;
bool setsFound = dict_.found("sets");
if (setsFound)
{
dict_.lookup("fields") >> fieldSelection_;
clearFieldGroups();
PtrList<sampledSet> newList
(
dict_.lookup("sets"),
sampledSet::iNew(mesh_, searchEngine_)
);
transfer(newList);
combineSampledSets(masterSampledSets_, indexSets_);
dict.lookup("interpolationScheme") >> interpolationScheme_;
dict.lookup("setFormat") >> writeFormat_;
PtrList<sampledSet> newList
(
dict_.lookup("sets"),
sampledSet::iNew(mesh_, searchEngine_)
);
transfer(newList);
combineSampledSets(masterSampledSets_, indexSets_);
if (this->size())
{
Info<< "Reading set description:" << nl;
forAll(*this, setI)
{
Info<< " " << operator[](setI).name() << nl;
}
Info<< endl;
}
}
if (Pstream::master() && debug)
{
Pout<< "sample fields:" << fieldSelection_ << nl
<< "sample sets:" << nl << "(" << nl;
forAll(*this, si)
forAll(*this, setI)
{
Pout<< " " << operator[](si) << endl;
Pout<< " " << operator[](setI) << endl;
}
Pout<< ")" << endl;
}
@ -261,19 +276,23 @@ void Foam::sampledSets::read(const dictionary& dict)
void Foam::sampledSets::correct()
{
// reset interpolation
pointMesh::Delete(mesh_);
volPointInterpolation::Delete(mesh_);
bool setsFound = dict_.found("sets");
if (setsFound)
{
// reset interpolation
pointMesh::Delete(mesh_);
volPointInterpolation::Delete(mesh_);
searchEngine_.correct();
searchEngine_.correct();
PtrList<sampledSet> newList
(
dict_.lookup("sets"),
sampledSet::iNew(mesh_, searchEngine_)
);
transfer(newList);
combineSampledSets(masterSampledSets_, indexSets_);
PtrList<sampledSet> newList
(
dict_.lookup("sets"),
sampledSet::iNew(mesh_, searchEngine_)
);
transfer(newList);
combineSampledSets(masterSampledSets_, indexSets_);
}
}

View File

@ -216,34 +216,49 @@ void Foam::sampledSurfaces::write()
void Foam::sampledSurfaces::read(const dictionary& dict)
{
dict.lookup("fields") >> fieldSelection_;
clearFieldGroups();
bool surfacesFound = dict.found("surfaces");
dict.lookup("interpolationScheme") >> interpolationScheme_;
const word writeType(dict.lookup("surfaceFormat"));
// define the surface formatter
// optionally defined extra controls for the output formats
formatter_ = surfaceWriter::New
(
writeType,
dict.subOrEmptyDict("formatOptions").subOrEmptyDict(writeType)
);
PtrList<sampledSurface> newList
(
dict.lookup("surfaces"),
sampledSurface::iNew(mesh_)
);
transfer(newList);
if (Pstream::parRun())
if (surfacesFound)
{
mergeList_.setSize(size());
}
dict.lookup("fields") >> fieldSelection_;
clearFieldGroups();
// ensure all surfaces and merge information are expired
expire();
dict.lookup("interpolationScheme") >> interpolationScheme_;
const word writeType(dict.lookup("surfaceFormat"));
// define the surface formatter
// optionally defined extra controls for the output formats
formatter_ = surfaceWriter::New
(
writeType,
dict.subOrEmptyDict("formatOptions").subOrEmptyDict(writeType)
);
PtrList<sampledSurface> newList
(
dict.lookup("surfaces"),
sampledSurface::iNew(mesh_)
);
transfer(newList);
if (Pstream::parRun())
{
mergeList_.setSize(size());
}
// ensure all surfaces and merge information are expired
expire();
if (this->size())
{
Info<< "Reading surface description:" << nl;
forAll(*this, surfI)
{
Info<< " " << operator[](surfI).name() << nl;
}
Info<< endl;
}
}
if (Pstream::master() && debug)
{

View File

@ -24,12 +24,17 @@ boundaryField
outlet
{
type buoyantPressure;
value uniform 101325;
value $internalField;
}
sides
{
type fixedValue;
type totalPressure;
p0 $internalField;
U U;
phi phi;
rho none;
psi none;
gamma 1;
value $internalField;
}
base

View File

@ -26,10 +26,15 @@ boundaryField
type buoyantPressure;
value $internalField;
}
sides
{
type fixedValue;
type totalPressure;
p0 $internalField;
U U;
phi phi;
rho none;
psi none;
gamma 1;
value $internalField;
}
base

View File

@ -18,18 +18,11 @@ FoamFile
solvers
{
rho
"(rho|rhoFinal)"
{
solver PCG;
preconditioner DIC;
tolerance 1e-7;
relTol 0.1;
};
rhoFinal
{
$rho;
tolerance 1e-7;
relTol 0;
};
@ -69,7 +62,6 @@ solvers
relTol 0;
};
Ii
{
solver GAMG;

View File

@ -0,0 +1,21 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType laminar;
// ************************************************************************* //

View File

@ -0,0 +1,21 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType laminar;
// ************************************************************************* //

View File

@ -19,8 +19,6 @@ interpolationScheme cellPointFace;
setFormat raw;
surfaceFormat vtk;
sets
(
cone25
@ -49,8 +47,6 @@ sets
}
);
surfaces ( );
fields ( p wallHeatTransRate );

View File

@ -0,0 +1,21 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType laminar;
// ************************************************************************* //

View File

@ -0,0 +1,21 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType laminar;
// ************************************************************************* //

View File

@ -0,0 +1,21 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType laminar;
// ************************************************************************* //

View File

@ -19,8 +19,6 @@ interpolationScheme cellPoint;
setFormat raw;
surfaceFormat vtk;
sets
(
line
@ -33,8 +31,6 @@ sets
}
);
surfaces ();
fields ( p U.component(0) T rho );

View File

@ -0,0 +1,21 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType laminar;
// ************************************************************************* //

View File

@ -52,6 +52,8 @@ PIMPLE
nOuterCorrectors 2;
nCorrectors 1;
nNonOrthogonalCorrectors 0;
rhoMin rhoMin [ 1 -3 0 0 0 ] 0.5;
rhoMax rhoMax [ 1 -3 0 0 0 ] 2.0;
}
relaxationFactors

View File

@ -55,6 +55,8 @@ PIMPLE
nOuterCorrectors 50;
nCorrectors 1;
nNonOrthogonalCorrectors 0;
rhoMin rhoMin [ 1 -3 0 0 0 ] 0.5;
rhoMax rhoMax [ 1 -3 0 0 0 ] 2.0;
}
relaxationFactors

View File

@ -59,6 +59,8 @@ PIMPLE
nOuterCorrectors 1;
nCorrectors 2;
nNonOrthogonalCorrectors 0;
rhoMin rhoMin [ 1 -3 0 0 0 ] 0.5;
rhoMax rhoMax [ 1 -3 0 0 0 ] 2.0;
}

View File

@ -23,8 +23,6 @@ ddtSchemes
gradSchemes
{
default Gauss linear;
grad(U) Gauss linear;
grad(p) Gauss linear;
}
divSchemes
@ -34,6 +32,7 @@ divSchemes
div(phi,h) Gauss upwind;
div(phi,epsilon) Gauss upwind;
div(phi,k) Gauss upwind;
div(U,p) Gauss upwind;
}
laplacianSchemes
@ -50,7 +49,6 @@ laplacianSchemes
interpolationSchemes
{
default linear;
div(U,p) upwind phi;
}
snGradSchemes

View File

@ -57,7 +57,7 @@ solvers
SIMPLE
{
nNonOrthogonalCorrectors 0;
rhoMin rhoMin [ 1 -3 0 0 0 ] 1.0;
rhoMin rhoMin [ 1 -3 0 0 0 ] 0.5;
rhoMax rhoMax [ 1 -3 0 0 0 ] 1.5;
}

View File

@ -8,7 +8,7 @@
FoamFile
{
version 2.0;
format ascii;
format binary;
class polyBoundaryMesh;
location "constant/polyMesh";
object boundary;

View File

@ -23,8 +23,6 @@ ddtSchemes
gradSchemes
{
default Gauss linear;
grad(U) Gauss linear;
grad(p) Gauss linear;
}
divSchemes
@ -34,6 +32,7 @@ divSchemes
div(phi,h) Gauss upwind;
div(phi,epsilon) Gauss upwind;
div(phi,k) Gauss upwind;
div(U,p) Gauss upwind;
}
laplacianSchemes
@ -49,7 +48,6 @@ laplacianSchemes
interpolationSchemes
{
default linear;
div(U,p) upwind phi;
}
snGradSchemes

View File

@ -25,15 +25,12 @@ sets
{
type uniform;
axis x;
start ( -4.995 0 0 );
end ( 4.995 0 0 );
start (-4.995 0 0);
end (4.995 0 0);
nPoints 1000;
}
);
surfaces ();
fields ( T magU p );
fields (T magU p);
// ************************************************************************* //

View File

@ -31,8 +31,6 @@ sets
}
);
surfaces ();
fields ( Ux );

View File

@ -87,8 +87,6 @@ sets
}
);
surfaces ();
fields
(
T

View File

@ -17,8 +17,6 @@ FoamFile
interpolationScheme cellPoint;
setFormat raw;
sets
(
leftPatch
@ -31,8 +29,6 @@ sets
}
);
surfaces ();
fields ( sigmaxx );

View File

@ -19,7 +19,15 @@ interpolationScheme cellPoint;
surfaceFormat dx;
surfaces ( constantPlane { name plate ; basePoint ( 0 0 0.25 ) ; normalVector ( 0 0 1 ) ; } );
surfaces
(
constantPlane
{
name plate;
basePoint ( 0 0 0.25 );
normalVector ( 0 0 1 );
}
);
fields ( sigmaxx );