Skip to content
Snippets Groups Projects
Commit 69c93be1 authored by andy's avatar andy
Browse files

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

parent c6c1fdbe
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,10 @@ EXE_INC = \ ...@@ -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 = \ ...@@ -16,4 +19,7 @@ EXE_LIBS = \
-lcompressibleLESModels \ -lcompressibleLESModels \
-lfluidThermophysicalModels \ -lfluidThermophysicalModels \
-lspecie \ -lspecie \
-lfiniteVolume -lfiniteVolume \
-lsampling \
-lmeshTools \
-lfieldSources
...@@ -35,6 +35,7 @@ Description ...@@ -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"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
...@@ -69,3 +69,6 @@ ...@@ -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);
...@@ -2,7 +2,10 @@ EXE_INC = \ ...@@ -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 = \ ...@@ -11,4 +14,8 @@ EXE_LIBS = \
-lcompressibleTurbulenceModel \ -lcompressibleTurbulenceModel \
-lcompressibleRASModels \ -lcompressibleRASModels \
-lcompressibleLESModels \ -lcompressibleLESModels \
-lfiniteVolume -lfiniteVolume \
-lsampling \
-lmeshTools \
-lfieldSources
...@@ -22,6 +22,7 @@ ...@@ -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);
} }
...@@ -37,6 +37,7 @@ Description ...@@ -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"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
...@@ -89,3 +89,6 @@ ...@@ -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);
...@@ -9,7 +9,7 @@ ...@@ -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 @@ ...@@ -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 @@ ...@@ -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 @@ ...@@ -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);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment