Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
b2252f36
Commit
b2252f36
authored
Dec 06, 2012
by
andy
Browse files
ENH: Added run-time selectable sources to combustion solvers
parent
28c88356
Changes
30
Hide whitespace changes
Inline
Side-by-side
applications/solvers/combustion/XiFoam/EaEqn.H
View file @
b2252f36
...
...
@@ -16,9 +16,13 @@
:
-
dpdt
)
-
fvm
::
laplacian
(
turbulence
->
alphaEff
(),
hea
)
+
sources
(
rho
,
hea
)
);
EaEqn
.
relax
();
sources
.
constrain
(
EaEqn
);
EaEqn
.
solve
();
thermo
.
correct
();
...
...
applications/solvers/combustion/XiFoam/Make/options
View file @
b2252f36
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/fieldSources/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude\
-I$(LIB_SRC)/engine/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude
-I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lfieldSources \
-lsampling \
-lmeshTools \
-lengine \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
...
...
@@ -16,6 +22,4 @@ EXE_LIBS = \
-lfluidThermophysicalModels \
-lreactionThermophysicalModels \
-lspecie \
-llaminarFlameSpeedModels \
-lmeshTools \
-lfiniteVolume
-llaminarFlameSpeedModels
applications/solvers/combustion/XiFoam/UEqn.H
View file @
b2252f36
...
...
@@ -5,10 +5,13 @@
+
turbulence
->
divDevRhoReff
(
U
)
==
rho
*
g
+
sources
(
rho
,
U
)
);
UEqn
.
relax
();
sources
.
constrain
(
UEqn
);
if
(
pimple
.
momentumPredictor
())
{
solve
(
UEqn
==
-
fvc
::
grad
(
p
));
...
...
applications/solvers/combustion/XiFoam/XiFoam.C
View file @
b2252f36
...
...
@@ -56,6 +56,7 @@ Description
#include
"ignition.H"
#include
"Switch.H"
#include
"pimpleControl.H"
#include
"IObasicSourceList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...
...
applications/solvers/combustion/XiFoam/bEqn.H
View file @
b2252f36
...
...
@@ -34,7 +34,7 @@ if (ign.ignited())
// Calculate turbulent flame speed flux
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
surfaceScalarField
phiSt
(
fvc
::
interpolate
(
rhou
*
StCorr
*
Su
*
Xi
)
*
nf
);
surfaceScalarField
phiSt
(
"phiSt"
,
fvc
::
interpolate
(
rhou
*
StCorr
*
Su
*
Xi
)
*
nf
);
scalar
StCoNum
=
max
(
...
...
@@ -50,9 +50,11 @@ if (ign.ignited())
(
fvm
::
ddt
(
rho
,
b
)
+
mvConvection
->
fvmDiv
(
phi
,
b
)
+
fvm
::
div
(
phiSt
,
b
,
"div(phiSt,b)"
)
+
fvm
::
div
(
phiSt
,
b
)
-
fvm
::
Sp
(
fvc
::
div
(
phiSt
),
b
)
-
fvm
::
laplacian
(
turbulence
->
alphaEff
(),
b
)
==
sources
(
rho
,
b
)
);
...
...
@@ -64,6 +66,9 @@ if (ign.ignited())
// Solve for b
// ~~~~~~~~~~~
bEqn
.
relax
();
sources
.
constrain
(
bEqn
);
bEqn
.
solve
();
Info
<<
"min(b) = "
<<
min
(
b
).
value
()
<<
endl
;
...
...
@@ -153,9 +158,13 @@ if (ign.ignited())
==
-
fvm
::
SuSp
(
-
rho
*
Rc
*
Su0
/
Su
,
Su
)
-
fvm
::
SuSp
(
rho
*
(
sigmas
+
Rc
),
Su
)
+
sources
(
rho
,
Su
)
);
SuEqn
.
relax
();
sources
.
constrain
(
SuEqn
);
SuEqn
.
solve
();
// Limit the maximum Su
...
...
@@ -234,9 +243,13 @@ if (ign.ignited())
),
Xi
)
+
sources
(
rho
,
Xi
)
);
XiEqn
.
relax
();
sources
.
constrain
(
XiEqn
);
XiEqn
.
solve
();
// Correct boundedness of Xi
...
...
applications/solvers/combustion/XiFoam/createFields.H
View file @
b2252f36
...
...
@@ -138,3 +138,5 @@
fields
.
add
(
b
);
fields
.
add
(
thermo
.
he
());
fields
.
add
(
thermo
.
heu
());
IObasicSourceList
sources
(
mesh
);
applications/solvers/combustion/XiFoam/ftEqn.H
View file @
b2252f36
...
...
@@ -13,10 +13,16 @@ if (composition.contains("ft"))
{
volScalarField
&
ft
=
composition
.
Y
(
"ft"
);
solve
fvScalarMatrix
ftEqn
(
fvm
::
ddt
(
rho
,
ft
)
+
mvConvection
->
fvmDiv
(
phi
,
ft
)
-
fvm
::
laplacian
(
turbulence
->
alphaEff
(),
ft
)
==
sources
(
rho
,
ft
)
);
sources
.
constrain
(
ftEqn
);
ftEqn
.
solve
();
}
applications/solvers/combustion/XiFoam/pEqn.H
View file @
b2252f36
...
...
@@ -16,6 +16,8 @@ if (pimple.transonic())
)
);
sources
.
relativeFlux
(
fvc
::
interpolate
(
psi
),
phid
);
while
(
pimple
.
correctNonOrthogonal
())
{
fvScalarMatrix
pEqn
...
...
@@ -23,8 +25,12 @@ if (pimple.transonic())
fvm
::
ddt
(
psi
,
p
)
+
fvm
::
div
(
phid
,
p
)
-
fvm
::
laplacian
(
rho
*
rAU
,
p
)
==
sources
(
psi
,
p
,
rho
.
name
())
);
sources
.
constrain
(
pEqn
,
rho
.
name
());
pEqn
.
solve
(
mesh
.
solver
(
p
.
select
(
pimple
.
finalInnerIter
())));
if
(
pimple
.
finalNonOrthogonalIter
())
...
...
@@ -45,6 +51,8 @@ else
)
);
sources
.
relativeFlux
(
phiHbyA
);
while
(
pimple
.
correctNonOrthogonal
())
{
fvScalarMatrix
pEqn
...
...
@@ -52,8 +60,12 @@ else
fvm
::
ddt
(
psi
,
p
)
+
fvc
::
div
(
phiHbyA
)
-
fvm
::
laplacian
(
rho
*
rAU
,
p
)
==
sources
(
psi
,
p
,
rho
.
name
())
);
sources
.
constrain
(
pEqn
,
rho
.
name
());
pEqn
.
solve
(
mesh
.
solver
(
p
.
select
(
pimple
.
finalInnerIter
())));
if
(
pimple
.
finalNonOrthogonalIter
())
...
...
@@ -68,6 +80,7 @@ else
U
=
HbyA
-
rAU
*
fvc
::
grad
(
p
);
U
.
correctBoundaryConditions
();
sources
.
correct
(
U
);
K
=
0
.
5
*
magSqr
(
U
);
if
(
thermo
.
dpdt
())
...
...
applications/solvers/combustion/engineFoam/Make/options
View file @
b2252f36
EXE_INC = \
-I../XiFoam \
-I$(FOAM_SOLVERS)/combustion/XiFoam \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/fieldSources/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/engine/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude
-I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lfieldSources \
-lsampling \
-lmeshTools \
-lengine \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
...
...
@@ -16,5 +23,4 @@ EXE_LIBS = \
-lfluidThermophysicalModels \
-lreactionThermophysicalModels \
-lspecie \
-llaminarFlameSpeedModels \
-lfiniteVolume
-llaminarFlameSpeedModels
applications/solvers/combustion/engineFoam/UEqn.H
View file @
b2252f36
...
...
@@ -3,6 +3,8 @@
fvm
::
ddt
(
rho
,
U
)
+
fvm
::
div
(
phi
,
U
)
+
turbulence
->
divDevRhoReff
(
U
)
==
sources
(
rho
,
U
)
);
if
(
pimple
.
momentumPredictor
())
...
...
applications/solvers/combustion/engineFoam/engineFoam.C
View file @
b2252f36
...
...
@@ -59,6 +59,7 @@ Description
#include
"OFstream.H"
#include
"mathematicalConstants.H"
#include
"pimpleControl.H"
#include
"IObasicSourceList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...
...
applications/solvers/combustion/engineFoam/pEqn.H
View file @
b2252f36
...
...
@@ -13,6 +13,8 @@ if (pimple.transonic())
*
((
fvc
::
interpolate
(
HbyA
)
&
mesh
.
Sf
())
-
fvc
::
meshPhi
(
rho
,
U
))
);
sources
.
relativeFlux
(
fvc
::
interpolate
(
psi
),
phid
);
while
(
pimple
.
correctNonOrthogonal
())
{
fvScalarMatrix
pEqn
...
...
@@ -20,8 +22,12 @@ if (pimple.transonic())
fvm
::
ddt
(
psi
,
p
)
+
fvm
::
div
(
phid
,
p
)
-
fvm
::
laplacian
(
rho
*
rAU
,
p
)
==
sources
(
psi
,
p
,
rho
.
name
())
);
sources
.
constrain
(
pEqn
,
rho
.
name
());
pEqn
.
solve
(
mesh
.
solver
(
p
.
select
(
pimple
.
finalInnerIter
())));
if
(
pimple
.
finalNonOrthogonalIter
())
...
...
@@ -39,6 +45,8 @@ else
*
((
fvc
::
interpolate
(
HbyA
)
&
mesh
.
Sf
())
-
fvc
::
meshPhi
(
rho
,
U
))
);
sources
.
relativeFlux
(
fvc
::
interpolate
(
rho
),
phiHbyA
);
while
(
pimple
.
correctNonOrthogonal
())
{
fvScalarMatrix
pEqn
...
...
@@ -46,8 +54,12 @@ else
fvm
::
ddt
(
psi
,
p
)
+
fvc
::
div
(
phiHbyA
)
-
fvm
::
laplacian
(
rho
*
rAU
,
p
)
==
sources
(
psi
,
p
,
rho
.
name
())
);
sources
.
constrain
(
pEqn
,
rho
.
name
());
pEqn
.
solve
(
mesh
.
solver
(
p
.
select
(
pimple
.
finalInnerIter
())));
if
(
pimple
.
finalNonOrthogonalIter
())
...
...
@@ -62,6 +74,7 @@ else
U
=
HbyA
-
rAU
*
fvc
::
grad
(
p
);
U
.
correctBoundaryConditions
();
sources
.
correct
(
U
);
K
=
0
.
5
*
magSqr
(
U
);
if
(
thermo
.
dpdt
())
...
...
applications/solvers/combustion/fireFoam/Make/options
View file @
b2252f36
EXE_INC = \
-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)/lagrangian/distributionModels/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
...
...
@@ -29,7 +31,9 @@ EXE_INC = \
EXE_LIBS = \
-lfiniteVolume \
-lfieldSources \
-lmeshTools \
-lsampling \
-lcompressibleRASModels \
-lcompressibleLESModels \
-lspecie \
...
...
applications/solvers/combustion/fireFoam/UEqn.H
View file @
b2252f36
...
...
@@ -5,10 +5,13 @@
+
turbulence
->
divDevRhoReff
(
U
)
==
parcels
.
SU
(
U
)
+
sources
(
rho
,
U
)
);
UEqn
.
relax
();
sources
.
constrain
(
UEqn
);
if
(
pimple
.
momentumPredictor
())
{
solve
...
...
applications/solvers/combustion/fireFoam/YEEqn.H
View file @
b2252f36
...
...
@@ -30,9 +30,13 @@ tmp<fv::convectionScheme<scalar> > mvConvection
parcels
.
SYi
(
i
,
Yi
)
+
surfaceFilm
.
Srho
(
i
)
+
combustion
->
R
(
Yi
)
+
sources
(
rho
,
Yi
)
);
YiEqn
.
relax
();
sources
.
constrain
(
YiEqn
);
YiEqn
.
solve
(
mesh
.
solver
(
"Yi"
));
Yi
.
max
(
0
.
0
);
...
...
@@ -69,9 +73,13 @@ tmp<fv::convectionScheme<scalar> > mvConvection
+
radiation
->
Sh
(
thermo
)
+
parcels
.
Sh
(
he
)
+
surfaceFilm
.
Sh
()
+
sources
(
rho
,
he
)
);
EEqn
.
relax
();
sources
.
constrain
(
EEqn
);
EEqn
.
solve
();
thermo
.
correct
();
...
...
applications/solvers/combustion/fireFoam/createFields.H
View file @
b2252f36
...
...
@@ -146,3 +146,6 @@
(
additionalControlsDict
.
lookup
(
"solvePrimaryRegion"
)
);
IObasicSourceList
sources
(
mesh
);
applications/solvers/combustion/fireFoam/fireFoam.C
View file @
b2252f36
...
...
@@ -40,6 +40,7 @@ Description
#include
"solidChemistryModel.H"
#include
"psiCombustionModel.H"
#include
"pimpleControl.H"
#include
"IObasicSourceList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...
...
applications/solvers/combustion/fireFoam/pEqn.H
View file @
b2252f36
...
...
@@ -21,6 +21,7 @@ surfaceScalarField phiHbyA
+
phig
);
sources
.
relativeFlux
(
phiHbyA
);
while
(
pimple
.
correctNonOrthogonal
())
{
...
...
@@ -33,8 +34,11 @@ while (pimple.correctNonOrthogonal())
==
parcels
.
Srho
()
+
surfaceFilm
.
Srho
()
+
sources
(
psi
,
p_rgh
,
rho
.
name
())
);
sources
.
constrain
(
p_rghEqn
,
rho
.
name
());
p_rghEqn
.
solve
(
mesh
.
solver
(
p_rgh
.
select
(
pimple
.
finalInnerIter
())));
if
(
pimple
.
finalNonOrthogonalIter
())
...
...
@@ -42,6 +46,7 @@ while (pimple.correctNonOrthogonal())
phi
=
phiHbyA
+
p_rghEqn
.
flux
();
U
=
HbyA
+
rAU
*
fvc
::
reconstruct
((
p_rghEqn
.
flux
()
+
phig
)
/
rhorAUf
);
U
.
correctBoundaryConditions
();
sources
.
correct
(
U
);
}
}
...
...
applications/solvers/combustion/fireFoam/rhoEqn.H
View file @
b2252f36
...
...
@@ -30,14 +30,19 @@ Description
\*---------------------------------------------------------------------------*/
{
solve
fvScalarMatrix
rhoEqn
(
fvm
::
ddt
(
rho
)
+
fvc
::
div
(
phi
)
==
parcels
.
Srho
(
rho
)
+
surfaceFilm
.
Srho
()
+
sources
(
rho
)
);
sources
.
constrain
(
rhoEqn
);
rhoEqn
.
solve
();
}
// ************************************************************************* //
applications/solvers/combustion/reactingFoam/EEqn.H
View file @
b2252f36
...
...
@@ -19,9 +19,13 @@
// - fvm::laplacian(turbulence->muEff(), he) // unit lewis no.
==
reaction
->
Sh
()
+
sources
(
rho
,
he
)
);
EEqn
.
relax
();
sources
.
constrain
(
EEqn
);
EEqn
.
solve
();
thermo
.
correct
();
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment