Commit da6239c9 authored by mattijs's avatar mattijs
Browse files

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

parents 57d7a3be de393576
......@@ -3,6 +3,10 @@ cd ${0%/*} || exit 1 # run from this directory
set -x
wmake
wmake SRFSimpleFoam
wmake MRFSimpleFoam
wmake windSimpleFoam
wmake porousSimpleFoam
# ----------------------------------------------------------------- end-of-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
......@@ -22,19 +22,19 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
rhoPisoTwinParcelFoam
MRFSimpleFoam
Description
Transient solver for compressible, turbulent flow with two thermo-clouds.
Steady-state solver for incompressible, turbulent flow of non-Newtonian
fluids with MRF regions.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "basicPsiThermo.H"
#include "turbulenceModel.H"
#include "basicThermoCloud.H"
#include "basicKinematicCloud.H"
#include "singlePhaseTransportModel.H"
#include "RASModel.H"
#include "MRFZones.H"
#include "simpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -44,54 +44,32 @@ int main(int argc, char *argv[])
#include "createTime.H"
#include "createMesh.H"
#include "readGravitationalAcceleration.H"
#include "createFields.H"
#include "createClouds.H"
#include "readPISOControls.H"
#include "initContinuityErrs.H"
#include "readTimeControls.H"
#include "compressibleCourantNo.H"
#include "setInitialDeltaT.H"
MRFZones mrfZones(mesh);
mrfZones.correctBoundaryVelocity(U);
simpleControl simple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
while (simple.loop())
{
#include "readTimeControls.H"
#include "readPISOControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
thermoCloud1.evolve();
p.storePrevIter();
kinematicCloud1.evolve();
#include "rhoEqn.H"
// --- PIMPLE loop
for (int ocorr=1; ocorr<=nOuterCorr; ocorr++)
// --- Pressure-velocity SIMPLE corrector
{
#include "UEqn.H"
// --- PISO loop
for (int corr=1; corr<=nCorr; corr++)
{
#include "hsEqn.H"
#include "pEqn.H"
}
#include "pEqn.H"
}
turbulence->correct();
rho = thermo.rho();
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
......
MRFSimpleFoam.C
EXE = $(FOAM_APPBIN)/MRFSimpleFoam
EXE_INC = \
-I.. \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/incompressible/RAS/RASModel \
-I$(LIB_SRC)/transportModels \
......
// Momentum predictor
tmp<fvVectorMatrix> UEqn
(
fvm::div(phi, U)
+ turbulence->divDevReff(U)
);
mrfZones.addCoriolis(UEqn());
UEqn().relax();
solve(UEqn() == -fvc::grad(p));
{
p.boundaryField().updateCoeffs();
volScalarField AU = UEqn().A();
U = UEqn().H()/AU;
volScalarField rAU(1.0/UEqn().A());
U = rAU*UEqn().H();
UEqn.clear();
phi = fvc::interpolate(U) & mesh.Sf();
phi = fvc::interpolate(U, "interpolate(HbyA)") & mesh.Sf();
mrfZones.relativeFlux(phi);
adjustPhi(phi, U, p);
// Non-orthogonal pressure corrector loop
......@@ -11,7 +14,7 @@
{
fvScalarMatrix pEqn
(
fvm::laplacian(1.0/AU, p) == fvc::div(phi)
fvm::laplacian(rAU, p) == fvc::div(phi)
);
pEqn.setReference(pRefCell, pRefValue);
......@@ -29,5 +32,6 @@
p.relax();
// Momentum corrector
U -= fvc::grad(p)/AU;
U -= rAU*fvc::grad(p);
U.correctBoundaryConditions();
}
SRFSimpleFoam.C
EXE = $(FOAM_APPBIN)/SRFSimpleFoam
EXE_INC = \
-I.. \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/incompressible/RAS/RASModel \
......
......@@ -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
......@@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
simpleSRFFoam
SRFSimpleFoam
Description
Steady-state solver for incompressible, turbulent flow of non-Newtonian
......@@ -34,6 +34,7 @@ Description
#include "singlePhaseTransportModel.H"
#include "RASModel.H"
#include "SRFModel.H"
#include "simpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -45,20 +46,19 @@ int main(int argc, char *argv[])
#include "createFields.H"
#include "initContinuityErrs.H"
simpleControl simple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.loop())
while (simple.loop())
{
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "readSIMPLEControls.H"
#include "initConvergenceCheck.H"
p.storePrevIter();
// Pressure-velocity SIMPLE corrector
// --- Pressure-velocity SIMPLE corrector
{
#include "UrelEqn.H"
#include "pEqn.H"
......@@ -87,8 +87,6 @@ int main(int argc, char *argv[])
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
#include "convergenceCheck.H"
}
Info<< "End\n" << endl;
......
// Relative momentum predictor
tmp<fvVectorMatrix> UrelEqn
(
fvm::div(phi, Urel)
......@@ -8,9 +9,4 @@
UrelEqn().relax();
eqnResidual = solve
(
UrelEqn() == -fvc::grad(p)
).initialResidual();
maxResidual = max(eqnResidual, maxResidual);
solve(UrelEqn() == -fvc::grad(p));
{
p.boundaryField().updateCoeffs();
volScalarField AUrel = UrelEqn().A();
Urel = UrelEqn().H()/AUrel;
volScalarField rAUrel(1.0/UrelEqn().A());
Urel = rAUrel*UrelEqn().H();
UrelEqn.clear();
phi = fvc::interpolate(Urel) & mesh.Sf();
phi = fvc::interpolate(Urel, "interpolate(HbyA)") & mesh.Sf();
adjustPhi(phi, Urel, p);
// Non-orthogonal pressure corrector loop
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix pEqn
(
fvm::laplacian(1.0/AUrel, p) == fvc::div(phi)
fvm::laplacian(rAUrel, p) == fvc::div(phi)
);
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve();
if (nonOrth == nNonOrthCorr)
if (nonOrth == simple.nNonOrthCorr())
{
phi -= pEqn.flux();
}
}
}
# include "continuityErrs.H"
#include "continuityErrs.H"
// Explicitly relax pressure for momentum corrector
p.relax();
// Momentum corrector
Urel -= fvc::grad(p)/AUrel;
Urel -= rAUrel*fvc::grad(p);
Urel.correctBoundaryConditions();
}
// Solve the Momentum equation
// Momentum predictor
tmp<fvVectorMatrix> UEqn
(
......
{
p.boundaryField().updateCoeffs();
volScalarField AU(UEqn().A());
U = UEqn().H()/AU;
volScalarField rAU(1.0/UEqn().A());
U = rAU*UEqn().H();
UEqn.clear();
phi = fvc::interpolate(U) & mesh.Sf();
phi = fvc::interpolate(U, "interpolate(HbyA)") & mesh.Sf();
adjustPhi(phi, U, p);
// Non-orthogonal pressure corrector loop
......@@ -11,7 +13,7 @@
{
fvScalarMatrix pEqn
(
fvm::laplacian(1.0/AU, p) == fvc::div(phi)
fvm::laplacian(rAU, p) == fvc::div(phi)
);
pEqn.setReference(pRefCell, pRefValue);
......@@ -30,5 +32,6 @@
p.relax();
// Momentum corrector
U -= fvc::grad(p)/AU;
U -= rAU*fvc::grad(p);
U.correctBoundaryConditions();
}
......@@ -56,7 +56,7 @@ int main(int argc, char *argv[])
p.storePrevIter();
// Pressure-velocity SIMPLE corrector
// --- Pressure-velocity SIMPLE corrector
{
#include "UEqn.H"
#include "pEqn.H"
......
windSimpleFoam.C
EXE = $(FOAM_APPBIN)/windSimpleFoam
EXE_INC = \
-I.. \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/incompressible/RAS/RASModel \
-I$(LIB_SRC)/transportModels \
......
......@@ -46,6 +46,8 @@ int main(int argc, char *argv[])
#include "createFields.H"
#include "initContinuityErrs.H"
IObasicSourceList actuationDisks(mesh);
simpleControl simple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
datToFoam.C
EXE = $(FOAM_APPBIN)/datToFoam
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment