ENH: Further addition of run-time selectable sources to solvers

This commit is contained in:
andy
2012-10-19 14:09:27 +01:00
parent c6c1fdbea0
commit 69c93be125
8 changed files with 32 additions and 5 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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