Commit a67f9d70 authored by sergio's avatar sergio
Browse files

Merge branch 'master' into thermalBuffles

parents f8c08689 a44a993d
......@@ -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
......@@ -30,6 +30,7 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "simpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -41,17 +42,17 @@ int main(int argc, char *argv[])
#include "createMesh.H"
#include "createFields.H"
simpleControl simple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nCalculating temperature distribution\n" << endl;
while (runTime.loop())
while (simple.loop())
{
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "readSIMPLEControls.H"
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++)
{
solve
(
......
......@@ -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
......@@ -30,32 +30,30 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "simpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"
# include "setRootCase.H"
simpleControl simple(mesh);
# include "createTime.H"
# include "createMesh.H"
# include "createFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nCalculating scalar transport\n" << endl;
# include "CourantNo.H"
#include "CourantNo.H"
while (runTime.loop())
while (simple.loop())
{
Info<< "Time = " << runTime.timeName() << nl << endl;
# include "readSIMPLEControls.H"
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++)
{
solve
(
......
......@@ -53,6 +53,18 @@ Description
PDR (porosity/distributed resistance) modelling is included to handle
regions containing blockages which cannot be resolved by the mesh.
The fields used by this solver are:
betav: Volume porosity
Lobs: Average diameter of obstacle in cell (m)
Aw: Obstacle surface area per unit volume (1/m)
CR: Drag tensor (1/m)
CT: Turbulence generation parameter (1/m)
Nv: Number of obstacles in cell per unit volume (m^-2)
nsv: Tensor whose diagonal indicates the number to substract from
Nv to get the number of obstacles crossing the flow in each
direction.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
......@@ -64,6 +76,7 @@ Description
#include "ignition.H"
#include "Switch.H"
#include "bound.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -81,6 +94,8 @@ int main(int argc, char *argv[])
#include "compressibleCourantNo.H"
#include "setInitialDeltaT.H"
pimpleControl pimple(mesh);
scalar StCoNum = 0.0;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -90,7 +105,6 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "readTimeControls.H"
#include "readPISOControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
......@@ -98,26 +112,34 @@ int main(int argc, char *argv[])
Info<< "\n\nTime = " << runTime.timeName() << endl;
#include "rhoEqn.H"
#include "UEqn.H"
// --- PISO loop
for (int corr=1; corr<=nCorr; corr++)
// --- Pressure-velocity PIMPLE corrector loop
for (pimple.start(); pimple.loop(); pimple++)
{
#include "bEqn.H"
#include "ftEqn.H"
#include "huEqn.H"
#include "hEqn.H"
#include "UEqn.H"
if (!ign.ignited())
// --- PISO loop
for (int corr=1; corr<=pimple.nCorr(); corr++)
{
hu == h;
#include "bEqn.H"
#include "ftEqn.H"
#include "huEqn.H"
#include "hEqn.H"
if (!ign.ignited())
{
hu == h;
}
#include "pEqn.H"
}
#include "pEqn.H"
if (pimple.turbCorr())
{
turbulence->correct();
}
}
turbulence->correct();
runTime.write();
Info<< "\nExecutionTime = "
......
......@@ -9,7 +9,7 @@
volSymmTensorField invA(inv(I*UEqn.A() + drag->Dcu()));
if (momentumPredictor)
if (pimple.momentumPredictor())
{
U = invA & (UEqn.H() - betav*fvc::grad(p));
U.correctBoundaryConditions();
......
......@@ -3,7 +3,7 @@ rho = thermo.rho();
volScalarField rAU(1.0/UEqn.A());
U = invA & UEqn.H();
if (transonic)
if (pimple.transonic())
{
surfaceScalarField phid
(
......@@ -15,7 +15,7 @@ if (transonic)
)
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix pEqn
(
......@@ -24,9 +24,12 @@ if (transonic)
- fvm::laplacian(rho*invA, p)
);
pEqn.solve();
pEqn.solve
(
mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
);
if (nonOrth == nNonOrthCorr)
if (nonOrth == pimple.nNonOrthCorr())
{
phi == pEqn.flux();
}
......@@ -41,7 +44,7 @@ else
+ fvc::ddtPhiCorr(rAU, rho, U, phi)
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix pEqn
(
......@@ -50,9 +53,12 @@ else
- fvm::laplacian(rho*invA, p)
);
pEqn.solve();
pEqn.solve
(
mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
);
if (nonOrth == nNonOrthCorr)
if (nonOrth == pimple.nNonOrthCorr())
{
phi += pEqn.flux();
}
......
......@@ -9,7 +9,7 @@
UEqn.relax();
if (momentumPredictor)
if (pimple.momentumPredictor())
{
solve(UEqn == -fvc::grad(p));
}
......@@ -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
......@@ -55,6 +55,7 @@ Description
#include "laminarFlameSpeed.H"
#include "ignition.H"
#include "Switch.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -72,6 +73,8 @@ int main(int argc, char *argv[])
#include "compressibleCourantNo.H"
#include "setInitialDeltaT.H"
pimpleControl pimple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
......@@ -79,17 +82,17 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "readTimeControls.H"
#include "readPISOControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "rhoEqn.H"
// --- Pressure-velocity PIMPLE corrector loop
for (int oCorr=0; oCorr<nOuterCorr; oCorr++)
for (pimple.start(); pimple.loop(); pimple++)
{
#include "rhoEqn.H"
#include "UEqn.H"
#include "ftEqn.H"
......@@ -103,12 +106,15 @@ int main(int argc, char *argv[])
}
// --- PISO loop
for (int corr=1; corr<=nCorr; corr++)
for (int corr=0; corr<pimple.nCorr(); corr++)
{
#include "pEqn.H"
}
turbulence->correct();
if (pimple.turbCorr())
{
turbulence->correct();
}
}
rho = thermo.rho();
......
......@@ -3,7 +3,7 @@ rho = thermo.rho();
volScalarField rAU(1.0/UEqn.A());
U = rAU*UEqn.H();
if (transonic)
if (pimple.transonic())
{
surfaceScalarField phid
(
......@@ -15,7 +15,7 @@ if (transonic)
)
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix pEqn
(
......@@ -24,9 +24,12 @@ if (transonic)
- fvm::laplacian(rho*rAU, p)
);
pEqn.solve();
pEqn.solve
(
mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
);
if (nonOrth == nNonOrthCorr)
if (nonOrth == pimple.nNonOrthCorr())
{
phi == pEqn.flux();
}
......@@ -41,7 +44,7 @@ else
+ fvc::ddtPhiCorr(rAU, rho, U, phi)
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix pEqn
(
......@@ -50,9 +53,12 @@ else
- fvm::laplacian(rho*rAU, p)
);
pEqn.solve();
pEqn.solve
(
mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
);
if (nonOrth == nNonOrthCorr)
if (nonOrth == pimple.nNonOrthCorr())
{
phi += pEqn.flux();
}
......
......@@ -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
......@@ -35,6 +35,7 @@ Description
#include "basicPsiThermo.H"
#include "turbulenceModel.H"
#include "OFstream.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -51,13 +52,14 @@ int main(int argc, char *argv[])
#include "setInitialDeltaT.H"
#include "startSummary.H"
pimpleControl pimple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
{
#include "readPISOControls.H"
#include "readEngineTimeControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
......@@ -71,17 +73,24 @@ int main(int argc, char *argv[])
#include "rhoEqn.H"
#include "UEqn.H"
// --- PISO loop
for (int corr=1; corr<=nCorr; corr++)
// --- Pressure-velocity PIMPLE corrector loop
for (pimple.start(); pimple.loop(); pimple++)
{
#include "hEqn.H"
#include "pEqn.H"
#include "UEqn.H"
// --- PISO loop
for (int corr=1; corr<=pimple.nCorr(); corr++)
{
#include "hEqn.H"
#include "pEqn.H"
}
if (pimple.turbCorr())
{
turbulence->correct();
}
}
turbulence->correct();
runTime.write();
#include "logSummary.H"
......
......@@ -8,7 +8,7 @@
+ dieselSpray.momentumSource()
);
if (momentumPredictor)
if (pimple.momentumPredictor())
{
solve(UEqn == -fvc::grad(p));
}
......@@ -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 @@ Description
#include "volPointInterpolation.H"
#include "thermoPhysicsTypes.H"
#include "mathematicalConstants.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -61,13 +62,14 @@ int main(int argc, char *argv[])
#include "setInitialDeltaT.H"
#include "startSummary.H"
pimpleControl pimple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
{
#include "readPISOControls.H"
#include "readEngineTimeControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
......@@ -77,10 +79,6 @@ int main(int argc, char *argv[])
Info<< "Crank angle = " << runTime.theta() << " CA-deg" << endl;
mesh.move();
const_cast<volPointInterpolation&>
(
volPointInterpolation::New(mesh)
).updateMesh();
dieselSpray.evolve();
......@@ -106,22 +104,26 @@ int main(int argc, char *argv[])
chemistrySh = kappa*chemistry.Sh()();
#include "rhoEqn.H"
#include "UEqn.H"
for (label ocorr=1; ocorr <= nOuterCorr; ocorr++)
for (pimple.start(); pimple.loop(); pimple++)
{
#include "UEqn.H"
#include "YEqn.H"
#include "hsEqn.H"
// --- PISO loop
for (int corr=1; corr<=nCorr; corr++)
for (int corr=1; corr<=pimple.nCorr(); corr++)
{
#include "pEqn.H"
}
}
turbulence->correct();
if (pimple.turbCorr())
{
turbulence->correct();
}
}
#include "logSummary.H"
#include "spraySummary.H"
......
......@@ -3,7 +3,7 @@ rho = thermo.rho();
volScalarField A(UEqn.A());
U = UEqn.H()/A;
if (transonic)
if (pimple.transonic())
{
surfaceScalarField phid
(
......@@ -12,7 +12,7 @@ if (transonic)
*((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U))
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix pEqn
(
......@@ -23,9 +23,12 @@ if (transonic)
Sevap
);
pEqn.solve();
pEqn.solve
(
mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
);
if (nonOrth == nNonOrthCorr)
if (nonOrth == pimple.nNonOrthCorr())
{
phi == pEqn.flux();
}
......@@ -36,7 +39,7 @@ else
phi = fvc::interpolate(rho)
*((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U));
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix pEqn
(
......@@ -47,9 +50,12 @@ else
Sevap
);
pEqn.solve();
pEqn.solve
(
mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
);
if (nonOrth == nNonOrthCorr)
if (nonOrth == pimple.nNonOrthCorr())
{
phi += pEqn.flux();
}
......
......@@ -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
......@@ -41,6 +41,7 @@ Description
#include "OFstream.H"
#include "Switch.H"
#include "mathematicalConstants.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -58,13 +59,14 @@ int main(int argc, char *argv[])
#include "compressibleCourantNo.H"
#include "setInitialDeltaT.H"
pimpleControl pimple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
{
#include "readPISOControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
......@@ -98,21 +100,25 @@ int main(int argc, char *argv[])
chemistrySh = kappa*chemistry.Sh()();
#include "rhoEqn.H"