Resolve the green

This commit is contained in:
Henry
2012-12-13 16:27:00 +00:00
556 changed files with 24766 additions and 10285 deletions

View File

@ -1,4 +1,11 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/fieldSources/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude
EXE_LIBS = -lfiniteVolume
EXE_LIBS = \
-lfiniteVolume \
-lfieldSources \
-lmeshTools \
-lsampling

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
@ -30,6 +30,7 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "IObasicSourceList.H"
#include "simpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -40,6 +41,7 @@ int main(int argc, char *argv[])
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"
#include "createSources.H"
simpleControl simple(mesh);
@ -60,6 +62,8 @@ int main(int argc, char *argv[])
fvm::ddt(T)
+ fvm::div(phi, T)
- fvm::laplacian(DT, T)
==
sources(T)
);
}

View File

@ -25,5 +25,7 @@
EaEqn.solve();
sources.correct(hea);
thermo.correct();
}

View File

@ -2,7 +2,7 @@ if (ign.ignited())
{
volScalarField& heau = thermo.heu();
solve
fvScalarMatrix heauEqn
(
fvm::ddt(rho, heau) + mvConvection->fvmDiv(phi, heau)
+ (fvc::ddt(rho, K) + fvc::div(phi, K))*rho/thermo.rhou()
@ -23,5 +23,14 @@ if (ign.ignited())
// A possible solution would be to solve for ftu as well as ft.
//- fvm::div(muEff*fvc::grad(b)/(b + 0.001), heau)
//+ fvm::Sp(fvc::div(muEff*fvc::grad(b)/(b + 0.001)), heau)
==
sources(rho, heau)
);
sources.constrain(heauEqn);
heauEqn.solve();
sources.correct(heau);
}

View File

@ -15,5 +15,7 @@
if (pimple.momentumPredictor())
{
solve(UEqn == -fvc::grad(p));
sources.correct(U);
K = 0.5*magSqr(U);
}

View File

@ -69,6 +69,7 @@ int main(int argc, char *argv[])
#include "readCombustionProperties.H"
#include "readGravitationalAcceleration.H"
#include "createFields.H"
#include "createSources.H"
#include "initContinuityErrs.H"
#include "readTimeControls.H"
#include "compressibleCourantNo.H"

View File

@ -71,6 +71,8 @@ if (ign.ignited())
bEqn.solve();
sources.correct(b);
Info<< "min(b) = " << min(b).value() << endl;
@ -167,6 +169,8 @@ if (ign.ignited())
SuEqn.solve();
sources.correct(Su);
// Limit the maximum Su
// ~~~~~~~~~~~~~~~~~~~~
Su.min(SuMax);
@ -252,6 +256,8 @@ if (ign.ignited())
XiEqn.solve();
sources.correct(Xi);
// Correct boundedness of Xi
// ~~~~~~~~~~~~~~~~~~~~~~~~~
Xi.max(1.0);

View File

@ -138,5 +138,3 @@
fields.add(b);
fields.add(thermo.he());
fields.add(thermo.heu());
IObasicSourceList sources(mesh);

View File

@ -25,4 +25,6 @@ if (composition.contains("ft"))
sources.constrain(ftEqn);
ftEqn.solve();
sources.correct(ft);
}

View File

@ -12,6 +12,7 @@ EXE_INC = \
EXE_LIBS = \
-lfiniteVolume \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lreactionThermophysicalModels \
-lfluidThermophysicalModels \

View File

@ -47,6 +47,7 @@ int main(int argc, char *argv[])
#include "createEngineTime.H"
#include "createEngineMesh.H"
#include "createFields.H"
#include "createSources.H"
#include "initContinuityErrs.H"
#include "readEngineTimeControls.H"
#include "compressibleCourantNo.H"

View File

@ -69,6 +69,3 @@
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

@ -10,5 +10,7 @@
if (pimple.momentumPredictor())
{
solve(UEqn == -fvc::grad(p));
sources.correct(U);
K = 0.5*magSqr(U);
}

View File

@ -71,6 +71,7 @@ int main(int argc, char *argv[])
#include "createEngineMesh.H"
#include "readCombustionProperties.H"
#include "createFields.H"
#include "createSources.H"
#include "initContinuityErrs.H"
#include "readEngineTimeControls.H"
#include "compressibleCourantNo.H"

View File

@ -27,5 +27,6 @@
)
);
sources.correct(U);
K = 0.5*magSqr(U);
}

View File

@ -39,6 +39,8 @@ tmp<fv::convectionScheme<scalar> > mvConvection
YiEqn.solve(mesh.solver("Yi"));
sources.correct(Yi);
Yi.max(0.0);
Yt += Yi;
}
@ -82,6 +84,8 @@ tmp<fv::convectionScheme<scalar> > mvConvection
EEqn.solve();
sources.correct(he);
thermo.correct();
Info<< "min/max(T) = "

View File

@ -52,6 +52,7 @@ int main(int argc, char *argv[])
#include "createMesh.H"
#include "readGravitationalAcceleration.H"
#include "createFields.H"
#include "createSources.H"
#include "createClouds.H"
#include "createSurfaceFilmModel.H"
#include "createPyrolysisModel.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
@ -43,6 +43,8 @@ Description
sources.constrain(rhoEqn);
rhoEqn.solve();
sources.correct(rho);
}
// ************************************************************************* //

View File

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

View File

@ -28,6 +28,8 @@
EEqn.solve();
sources.correct(he);
thermo.correct();
Info<< "min/max(T) = "

View File

@ -15,5 +15,7 @@
if (pimple.momentumPredictor())
{
solve(UEqn == -fvc::grad(p));
sources.correct(U);
K = 0.5*magSqr(U);
}

View File

@ -37,6 +37,8 @@ tmp<fv::convectionScheme<scalar> > mvConvection
YiEqn.solve(mesh.solver("Yi"));
sources.correct(Yi);
Yi.max(0.0);
Yt += Yi;
}

View File

@ -99,5 +99,3 @@ volScalarField dQ
mesh,
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0)
);
IObasicSourceList sources(mesh);

View File

@ -45,6 +45,7 @@ int main(int argc, char *argv[])
#include "createMesh.H"
#include "readGravitationalAcceleration.H"
#include "createFields.H"
#include "createSources.H"
#include "initContinuityErrs.H"
#include "readTimeControls.H"
#include "compressibleCourantNo.H"

View File

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

View File

@ -0,0 +1,31 @@
fvVectorMatrix UEqn
(
fvm::ddt(rho, U)
+ fvm::div(phi, U)
+ turbulence->divDevRhoReff(U)
==
sources(rho, U)
);
UEqn.relax();
sources.constrain(UEqn);
if (pimple.momentumPredictor())
{
solve
(
UEqn
==
fvc::reconstruct
(
(
- ghf*fvc::snGrad(rho)
- fvc::snGrad(p_rgh)
)*mesh.magSf()
)
);
sources.correct(U);
K = 0.5*magSqr(U);
}

View File

@ -0,0 +1,124 @@
Info<< "Creating reaction model\n" << endl;
autoPtr<combustionModels::rhoCombustionModel> reaction
(
combustionModels::rhoCombustionModel::New(mesh)
);
rhoReactionThermo& thermo = reaction->thermo();
thermo.validate(args.executable(), "h", "e");
basicMultiComponentMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y();
word inertSpecie(thermo.lookup("inertSpecie"));
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
);
volScalarField& p = thermo.p();
const volScalarField& psi = thermo.psi();
const volScalarField& T = thermo.T();
#include "compressibleCreatePhi.H"
Info << "Creating turbulence model.\n" << nl;
autoPtr<compressible::turbulenceModel> turbulence
(
compressible::turbulenceModel::New
(
rho,
U,
phi,
thermo
)
);
// Set the turbulence into the reaction model
reaction->setTurbulence(turbulence());
Info<< "Calculating field g.h\n" << endl;
volScalarField gh("gh", g & mesh.C());
surfaceScalarField ghf("ghf", g & mesh.Cf());
Info<< "Reading field p_rgh\n" << endl;
volScalarField p_rgh
(
IOobject
(
"p_rgh",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
// Force p_rgh to be consistent with p
p_rgh = p - rho*gh;
Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt
(
IOobject
(
"dpdt",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
);
Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
forAll(Y, i)
{
fields.add(Y[i]);
}
fields.add(thermo.he());
volScalarField dQ
(
IOobject
(
"dQ",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0)
);

View File

@ -0,0 +1,78 @@
{
rho = thermo.rho();
// Thermodynamic density needs to be updated by psi*d(p) after the
// pressure solution - done in 2 parts. Part 1:
thermo.rho() -= psi*p;
volScalarField rAU(1.0/UEqn.A());
surfaceScalarField rhorAUf("Dp", fvc::interpolate(rho*rAU));
volVectorField HbyA("HbyA", U);
HbyA = rAU*UEqn.H();
surfaceScalarField phig(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf());
surfaceScalarField phiHbyA
(
"phiHbyA",
fvc::interpolate(rho)
*(
(fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rAU, rho, U, phi)
)
+ phig
);
sources.relativeFlux(fvc::interpolate(rho), phiHbyA);
fvScalarMatrix p_rghDDtEqn
(
fvc::ddt(rho) + psi*correction(fvm::ddt(p_rgh))
+ fvc::div(phiHbyA)
==
sources(psi, p_rgh, rho.name())
);
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix p_rghEqn
(
p_rghDDtEqn
- fvm::laplacian(rhorAUf, p_rgh)
);
sources.constrain(p_rghEqn);
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
if (pimple.finalNonOrthogonalIter())
{
// Calculate the conservative fluxes
phi = phiHbyA + p_rghEqn.flux();
// Explicitly relax pressure for momentum corrector
p_rgh.relax();
// Correct the momentum source with the pressure gradient flux
// 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);
}
}
p = p_rgh + rho*gh;
// Second part of thermodynamic density update
thermo.rho() += psi*p;
if (thermo.dpdt())
{
dpdt = fvc::ddt(p);
}
#include "rhoEqn.H"
#include "compressibleContinuityErrs.H"
}

View File

@ -0,0 +1,106 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
rhoReactingBuoyantFoam
Description
Solver for combustion with chemical reactions using density based
thermodynamics package, using enahanced buoyancy treatment.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "rhoCombustionModel.H"
#include "turbulenceModel.H"
#include "multivariateScheme.H"
#include "pimpleControl.H"
#include "IObasicSourceList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "readGravitationalAcceleration.H"
#include "createFields.H"
#include "createSources.H"
#include "initContinuityErrs.H"
#include "readTimeControls.H"
#include "compressibleCourantNo.H"
#include "setInitialDeltaT.H"
pimpleControl pimple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
{
#include "readTimeControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "rhoEqn.H"
// --- Pressure-velocity PIMPLE corrector loop
while (pimple.loop())
{
#include "UEqn.H"
#include "YEqn.H"
#include "EEqn.H"
// --- Pressure corrector loop
while (pimple.correct())
{
#include "pEqn.H"
}
if (pimple.turbCorr())
{
turbulence->correct();
}
}
rho = thermo.rho();
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
}
Info<< "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,29 @@
EXE_INC = \
-I$(FOAM_SOLVERS)/combustion/reactingFoam \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/fieldSources/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
-I$(LIB_SRC)/ODE/lnInclude \
-I$(LIB_SRC)/combustionModels/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lfieldSources \
-lmeshTools \
-lsampling \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lcompressibleLESModels \
-lreactionThermophysicalModels \
-lspecie \
-lfluidThermophysicalModels \
-lchemistryModel \
-lODE \
-lcombustionModels

View File

@ -101,5 +101,3 @@ volScalarField dQ
mesh,
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0)
);
IObasicSourceList sources(mesh);

View File

@ -46,6 +46,7 @@ int main(int argc, char *argv[])
#include "createMesh.H"
#include "readGravitationalAcceleration.H"
#include "createFields.H"
#include "createSources.H"
#include "initContinuityErrs.H"
#include "readTimeControls.H"
#include "compressibleCourantNo.H"

View File

@ -21,8 +21,12 @@
);
EEqn.relax();
sources.constrain(EEqn);
EEqn.solve();
sources.correct(he);
thermo.correct();
}

View File

@ -16,5 +16,7 @@ sources.constrain(UEqn());
if (pimple.momentumPredictor())
{
solve(UEqn() == -fvc::grad(p));
sources.correct(U);
K = 0.5*magSqr(U);
}

View File

@ -69,6 +69,3 @@
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

@ -54,6 +54,7 @@ int main(int argc, char *argv[])
#include "setInitialrDeltaT.H"
#include "createFields.H"
#include "createSources.H"
#include "initContinuityErrs.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -51,6 +51,7 @@ int main(int argc, char *argv[])
pimpleControl pimple(mesh);
#include "createFields.H"
#include "createSources.H"
#include "initContinuityErrs.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -51,6 +51,7 @@ int main(int argc, char *argv[])
pimpleControl pimple(mesh);
#include "createFields.H"
#include "createSources.H"
#include "initContinuityErrs.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -3,7 +3,7 @@ cd ${0%/*} || exit 1 # run from this directory
set -x
wclean
wclean rhoPorousMRFSimpleFoam
wclean rhoPorousSimpleFoam
wclean rhoSimplecFoam
# ----------------------------------------------------------------- end-of-file

View File

@ -3,7 +3,7 @@ cd ${0%/*} || exit 1 # run from this directory
set -x
wmake
wmake rhoPorousMRFSimpleFoam
wmake rhoPorousSimpleFoam
wmake rhoSimplecFoam
# ----------------------------------------------------------------- end-of-file

View File

@ -15,8 +15,12 @@
);
EEqn.relax();
sources.constrain(EEqn);
EEqn.solve();
sources.correct(he);
thermo.correct();
}

View File

@ -10,4 +10,8 @@
UEqn().relax();
sources.constrain(UEqn());
solve(UEqn() == -fvc::grad(p));
sources.correct(U);

View File

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

View File

@ -15,8 +15,12 @@
);
EEqn.relax();
sources.constrain(EEqn);
EEqn.solve();
sources.correct(he);
thermo.correct();
}

View File

@ -33,6 +33,8 @@
U = trTU() & ((UEqn() == sources(rho, U))().H() - gradp);
}
U.correctBoundaryConditions();
sources.correct(U);
}
else
{
@ -42,6 +44,8 @@
solve(UEqn() == -fvc::grad(p) + sources(rho, U));
sources.correct(U);
trAU = 1.0/UEqn().A();
trAU().rename("rAU");
}

View File

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

View File

@ -50,6 +50,7 @@ int main(int argc, char *argv[])
simpleControl simple(mesh);
#include "createFields.H"
#include "createSources.H"
#include "createZones.H"
#include "initContinuityErrs.H"

View File

@ -47,6 +47,7 @@ int main(int argc, char *argv[])
simpleControl simple(mesh);
#include "createFields.H"
#include "createSources.H"
#include "initContinuityErrs.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -49,6 +49,7 @@ int main(int argc, char *argv[])
simpleControl simple(mesh);
#include "createFields.H"
#include "createSources.H"
#include "initContinuityErrs.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -21,8 +21,12 @@
);
EEqn.relax();
sources.constrain(EEqn);
EEqn.solve();
sources.correct(he);
thermo.correct();
}

View File

@ -27,5 +27,7 @@
)*mesh.magSf()
)
);
sources.correct(U);
K = 0.5*magSqr(U);
}

View File

@ -49,6 +49,7 @@ int main(int argc, char *argv[])
#include "createMesh.H"
#include "readGravitationalAcceleration.H"
#include "createFields.H"
#include "createSources.H"
#include "createRadiationModel.H"
#include "initContinuityErrs.H"
#include "readTimeControls.H"

View File

@ -86,6 +86,3 @@
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

@ -21,6 +21,8 @@
EEqn.solve();
sources.correct(he);
thermo.correct();
radiation->correct();
}

View File

@ -26,4 +26,6 @@
)*mesh.magSf()
)
);
sources.correct(U);
}

View File

@ -46,6 +46,7 @@ int main(int argc, char *argv[])
#include "createMesh.H"
#include "readGravitationalAcceleration.H"
#include "createFields.H"
#include "createSources.H"
#include "createRadiationModel.H"
#include "initContinuityErrs.H"

View File

@ -87,5 +87,3 @@
dimensionedScalar initialMass = fvc::domainIntegrate(rho);
dimensionedScalar totalVolume = sum(mesh.V());
IObasicSourceList sources(mesh);

View File

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

View File

@ -21,6 +21,8 @@
EEqn.solve();
sources.correct(he);
thermo.correct();
rad.correct();

View File

@ -23,3 +23,5 @@
)*mesh.magSf()
)
);
sources.correct(U);

View File

@ -17,7 +17,7 @@
PtrList<dimensionedScalar> rhoMax(fluidRegions.size());
PtrList<dimensionedScalar> rhoMin(fluidRegions.size());
PtrList<IObasicSourceList> heatSources(fluidRegions.size());
PtrList<IObasicSourceList> fluidSources(fluidRegions.size());
// Populate fluid field pointer lists
forAll(fluidRegions, i)
@ -194,7 +194,7 @@
);
Info<< " Adding sources\n" << endl;
heatSources.set
fluidSources.set
(
i,
new IObasicSourceList(fluidRegions[i])

View File

@ -12,7 +12,7 @@
volScalarField& p = thermo.p();
const volScalarField& psi = thermo.psi();
IObasicSourceList& sources = heatSources[i];
IObasicSourceList& sources = fluidSources[i];
const dimensionedScalar initialMass
(

View File

@ -6,8 +6,14 @@
- fvm::laplacian(betav*alpha, h, "laplacian(alpha,h)")
+ sources(rho, h)
);
hEqn.relax();
sources.constrain(hEqn);
hEqn.solve();
sources.correct(h);
}
}

View File

@ -22,8 +22,13 @@
);
EEqn.relax();
sources.constrain(EEqn);
EEqn.solve(mesh.solver(he.select(finalIter)));
sources.correct(he);
thermo.correct();
rad.correct();

View File

@ -9,8 +9,7 @@
UEqn().relax();
// Add porous resistance
pZones.addResistance(UEqn());
sources.constrain(UEqn());
if (momentumPredictor)
{
@ -21,11 +20,13 @@
fvc::reconstruct
(
(
- ghf*fvc::snGrad(rho)
- fvc::snGrad(p_rgh)
- ghf*fvc::snGrad(rho)
- fvc::snGrad(p_rgh)
)*mesh.magSf()
),
mesh.solver(U.select(finalIter))
);
sources.correct(U);
K = 0.5*magSqr(U);
}

View File

@ -14,8 +14,7 @@
List<scalar> initialMassFluid(fluidRegions.size());
PtrList<IObasicSourceList> heatSources(fluidRegions.size());
PtrList<IOporosityModelList> porousZonesFluid(fluidRegions.size());
PtrList<IObasicSourceList> fluidSources(fluidRegions.size());
// Populate fluid field pointer lists
forAll(fluidRegions, i)
@ -192,16 +191,9 @@
);
Info<< " Adding sources\n" << endl;
heatSources.set
fluidSources.set
(
i,
new IObasicSourceList(fluidRegions[i])
);
Info<< " Adding porous zones\n" << endl;
porousZonesFluid.set
(
i,
new IOporosityModelList(fluidRegions[i])
);
}

View File

@ -20,9 +20,7 @@
radiation::radiationModel& rad = radiation[i];
IObasicSourceList& sources = heatSources[i];
const IOporosityModelList& pZones = porousZonesFluid[i];
IObasicSourceList& sources = fluidSources[i];
const dimensionedScalar initialMass
(

View File

@ -19,6 +19,8 @@ if (finalIter)
sources.constrain(hEqn());
hEqn().solve(mesh.solver(h.select(finalIter)));
sources.correct(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
@ -47,6 +47,7 @@ int main(int argc, char *argv[])
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"
#include "createSources.H"
#include "initContinuityErrs.H"
pimpleControl pimple(mesh);

View File

@ -12,3 +12,5 @@
sources.constrain(UrelEqn());
solve(UrelEqn() == -fvc::grad(p) + sources(Urel));
sources.correct(Urel);

View File

@ -70,6 +70,3 @@ volVectorField U
),
Urel + SRF->U()
);
IObasicSourceList sources(mesh);

View File

@ -18,4 +18,6 @@ volScalarField rAU(1.0/UEqn().A());
if (pimple.momentumPredictor())
{
solve(UEqn() == -fvc::grad(p));
sources.correct(U);
}

View File

@ -40,6 +40,3 @@ autoPtr<incompressible::turbulenceModel> turbulence
(
incompressible::turbulenceModel::New(U, phi, laminarTransport)
);
IObasicSourceList sources(mesh);

View File

@ -17,6 +17,7 @@ EXE_LIBS = \
-ldynamicMesh \
-lmeshTools \
-lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \
-lincompressibleLESModels \
-lfiniteVolume \

View File

@ -16,4 +16,6 @@ rAU = 1.0/UEqn().A();
if (pimple.momentumPredictor())
{
solve(UEqn() == -fvc::grad(p) + sources(U));
sources.correct(U);
}

View File

@ -56,6 +56,3 @@
runTime.deltaT(),
zeroGradientFvPatchScalarField::typeName
);
IObasicSourceList sources(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
@ -49,6 +49,7 @@ int main(int argc, char *argv[])
#include "createDynamicFvMesh.H"
#include "initContinuityErrs.H"
#include "createFields.H"
#include "createSources.H"
#include "readTimeControls.H"
pimpleControl pimple(mesh);

View File

@ -50,6 +50,7 @@ int main(int argc, char *argv[])
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"
#include "createSources.H"
#include "initContinuityErrs.H"
pimpleControl pimple(mesh);

View File

@ -13,4 +13,6 @@ sources.constrain(UEqn());
if (pimple.momentumPredictor())
{
solve(UEqn() == -fvc::grad(p_gh) + sources(U));
sources.correct(U);
}

View File

@ -74,6 +74,3 @@
label p_ghRefCell = 0;
scalar p_ghRefValue = 0.0;
setRefCell(p_gh, pimple.dict(), p_ghRefCell, p_ghRefValue);
IObasicSourceList sources(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
@ -52,6 +52,7 @@ int main(int argc, char *argv[])
pimpleControl pimple(mesh);
#include "createFields.H"
#include "createSources.H"
#include "initContinuityErrs.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
@ -45,6 +45,7 @@ int main(int argc, char *argv[])
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"
#include "createSources.H"
#include "initContinuityErrs.H"
simpleControl simple(mesh);

View File

@ -14,3 +14,5 @@
sources.constrain(UrelEqn());
solve(UrelEqn() == -fvc::grad(p));
sources.correct(Urel);

View File

@ -52,9 +52,4 @@
);
Info<< "Creating SRF model\n" << endl;
autoPtr<SRF::SRFModel> SRF
(
SRF::SRFModel::New(Urel)
);
IObasicSourceList sources(mesh);
autoPtr<SRF::SRFModel> SRF(SRF::SRFModel::New(Urel));

View File

@ -13,3 +13,5 @@
sources.constrain(UEqn());
solve(UEqn() == -fvc::grad(p));
sources.correct(U);

View File

@ -39,5 +39,3 @@
(
incompressible::RASModel::New(U, phi, laminarTransport)
);
IObasicSourceList sources(mesh);

View File

@ -12,8 +12,6 @@
UEqn().relax();
sources.constrain(UEqn());
// Include the porous media resistance and solve the momentum equation
// either implicit in the tensorial resistance or transport using by
// including the spherical part of the resistance in the momentum diagonal
@ -28,6 +26,8 @@
trTU = inv(tTU());
trTU().rename("rAU");
sources.constrain(UEqn());
volVectorField gradp(fvc::grad(p));
for (int UCorr=0; UCorr<nUCorr; UCorr++)
@ -35,13 +35,19 @@
U = trTU() & (UEqn().H() - gradp);
}
U.correctBoundaryConditions();
sources.correct(U);
}
else
{
pZones.addResistance(UEqn());
sources.constrain(UEqn());
solve(UEqn() == -fvc::grad(p));
sources.correct(U);
trAU = 1.0/UEqn().A();
trAU().rename("rAU");
}

View File

@ -50,6 +50,7 @@ int main(int argc, char *argv[])
simpleControl simple(mesh);
#include "createFields.H"
#include "createSources.H"
#include "createZones.H"
#include "initContinuityErrs.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
@ -43,6 +43,7 @@ int main(int argc, char *argv[])
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"
#include "createSources.H"
#include "initContinuityErrs.H"
simpleControl simple(mesh);

View File

@ -25,9 +25,13 @@
);
EEqn.relax();
sources.constrain(EEqn);
EEqn.solve();
sources.correct(he);
thermo.correct();
radiation->correct();

View File

@ -17,5 +17,7 @@
if (pimple.momentumPredictor())
{
solve(UEqn == -fvc::grad(p));
sources.correct(U);
K = 0.5*magSqr(U);
}

View File

@ -39,6 +39,8 @@ tmp<fv::convectionScheme<scalar> > mvConvection
YiEqn.solve(mesh.solver("Yi"));
sources.correct(Yi);
Yi.max(0.0);
Yt += Yi;
}

View File

@ -55,6 +55,7 @@ int main(int argc, char *argv[])
#include "createMesh.H"
#include "readGravitationalAcceleration.H"
#include "createFields.H"
#include "createSources.H"
#include "createClouds.H"
#include "createRadiationModel.H"
#include "initContinuityErrs.H"

View File

@ -126,9 +126,6 @@
Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));
Info<< "\nConstructing sources" << endl;
IObasicSourceList sources(mesh);
volScalarField dQ
(
IOobject

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
@ -42,6 +42,8 @@ Description
sources.constrain(rhoEqn);
rhoEqn.solve();
sources.correct(rho);
}
// ************************************************************************* //

View File

@ -25,9 +25,13 @@
);
EEqn.relax();
sources.constrain(EEqn);
EEqn.solve();
sources.correct(he);
thermo.correct();
radiation->correct();

View File

@ -26,5 +26,7 @@
)*mesh.magSf()
)
);
sources.correct(U);
K = 0.5*magSqr(U);
}

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