Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
3be86aa7
Commit
3be86aa7
authored
Nov 08, 2011
by
mattijs
Browse files
Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev
Conflicts: src/lagrangian/dieselSpray/spray/findInjectorCell.H
parents
ca4b8c34
8968d1d0
Changes
212
Hide whitespace changes
Inline
Side-by-side
applications/solvers/combustion/dieselEngineFoam/Make/files
deleted
100644 → 0
View file @
ca4b8c34
dieselEngineFoam.C
EXE = $(FOAM_APPBIN)/dieselEngineFoam
applications/solvers/combustion/dieselEngineFoam/UEqn.H
deleted
100644 → 0
View file @
ca4b8c34
fvVectorMatrix
UEqn
(
fvm
::
ddt
(
rho
,
U
)
+
fvm
::
div
(
phi
,
U
)
+
turbulence
->
divDevRhoReff
(
U
)
==
rho
*
g
+
dieselSpray
.
momentumSource
()
);
if
(
pimple
.
momentumPredictor
())
{
solve
(
UEqn
==
-
fvc
::
grad
(
p
));
}
applications/solvers/combustion/dieselEngineFoam/YEqn.H
deleted
100644 → 0
View file @
ca4b8c34
tmp
<
fv
::
convectionScheme
<
scalar
>
>
mvConvection
(
fv
::
convectionScheme
<
scalar
>::
New
(
mesh
,
fields
,
phi
,
mesh
.
divScheme
(
"div(phi,Yi_h)"
)
)
);
{
combustion
->
correct
();
dQ
=
combustion
->
dQ
();
label
inertIndex
=
-
1
;
volScalarField
Yt
(
0
.
0
*
Y
[
0
]);
forAll
(
Y
,
i
)
{
if
(
Y
[
i
].
name
()
!=
inertSpecie
)
{
volScalarField
&
Yi
=
Y
[
i
];
fvScalarMatrix
YiEqn
(
fvm
::
ddt
(
rho
,
Yi
)
+
mvConvection
->
fvmDiv
(
phi
,
Yi
)
-
fvm
::
laplacian
(
turbulence
->
muEff
(),
Yi
)
==
dieselSpray
.
evaporationSource
(
i
)
+
combustion
->
R
(
Yi
)
);
YiEqn
.
relax
();
YiEqn
.
solve
(
mesh
.
solver
(
"Yi"
));
Yi
.
max
(
0
.
0
);
Yt
+=
Yi
;
}
else
{
inertIndex
=
i
;
}
}
Y
[
inertIndex
]
=
scalar
(
1
)
-
Yt
;
Y
[
inertIndex
].
max
(
0
.
0
);
}
applications/solvers/combustion/dieselEngineFoam/createFields.H
deleted
100644 → 0
View file @
ca4b8c34
Info
<<
"Creating combustion model
\n
"
<<
endl
;
autoPtr
<
combustionModels
::
psiChemistryCombustionModel
>
combustion
(
combustionModels
::
psiChemistryCombustionModel
::
New
(
mesh
)
);
psiChemistryModel
&
chemistry
=
combustion
->
pChemistry
();
hsCombustionThermo
&
thermo
=
chemistry
.
thermo
();
basicMultiComponentMixture
&
composition
=
thermo
.
composition
();
PtrList
<
volScalarField
>&
Y
=
composition
.
Y
();
word
inertSpecie
(
thermo
.
lookup
(
"inertSpecie"
));
if
(
!
composition
.
contains
(
inertSpecie
))
{
FatalErrorIn
(
args
.
executable
())
<<
"Specified inert specie '"
<<
inertSpecie
<<
"' not found in "
<<
"species list. Available species:"
<<
composition
.
species
()
<<
exit
(
FatalError
);
}
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
();
volScalarField
&
hs
=
thermo
.
hs
();
#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 combustion model
combustion
->
setTurbulence
(
turbulence
());
Info
<<
"Creating field DpDt
\n
"
<<
endl
;
volScalarField
DpDt
(
fvc
::
DDt
(
surfaceScalarField
(
"phiU"
,
phi
/
fvc
::
interpolate
(
rho
)),
p
)
);
multivariateSurfaceInterpolationScheme
<
scalar
>::
fieldTable
fields
;
forAll
(
Y
,
i
)
{
fields
.
add
(
Y
[
i
]);
}
fields
.
add
(
hs
);
volScalarField
dQ
(
IOobject
(
"dQ"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
NO_READ
,
IOobject
::
AUTO_WRITE
),
mesh
,
dimensionedScalar
(
"dQ"
,
dimEnergy
/
dimTime
,
0
.
0
)
);
applications/solvers/combustion/dieselEngineFoam/createSpray.H
deleted
100644 → 0
View file @
ca4b8c34
Info
<<
"Constructing Spray"
<<
endl
;
PtrList
<
gasThermoPhysics
>
gasProperties
(
Y
.
size
());
forAll
(
gasProperties
,
i
)
{
gasProperties
.
set
(
i
,
new
gasThermoPhysics
(
dynamic_cast
<
const
reactingMixture
<
gasThermoPhysics
>&>
(
thermo
).
speciesData
()[
i
]
)
);
}
spray
dieselSpray
(
U
,
rho
,
p
,
T
,
composition
,
gasProperties
,
thermo
,
g
);
scalar
gasMass0
=
fvc
::
domainIntegrate
(
rho
).
value
();
if
(
dieselSpray
.
twoD
())
{
gasMass0
*=
constant
::
mathematical
::
twoPi
/
dieselSpray
.
angleOfWedge
();
}
gasMass0
-=
dieselSpray
.
injectedMass
(
runTime
.
value
())
-
dieselSpray
.
liquidMass
();
applications/solvers/combustion/dieselEngineFoam/hsEqn.H
deleted
100644 → 0
View file @
ca4b8c34
{
fvScalarMatrix
hsEqn
(
fvm
::
ddt
(
rho
,
hs
)
+
mvConvection
->
fvmDiv
(
phi
,
hs
)
-
fvm
::
laplacian
(
turbulence
->
alphaEff
(),
hs
)
==
DpDt
+
combustion
->
Sh
()
+
dieselSpray
.
heatTransferSource
()()
);
hsEqn
.
relax
();
hsEqn
.
solve
();
thermo
.
correct
();
Info
<<
"min/max(T) = "
<<
min
(
T
).
value
()
<<
", "
<<
max
(
T
).
value
()
<<
endl
;
}
applications/solvers/combustion/dieselEngineFoam/pEqn.H
deleted
100644 → 0
View file @
ca4b8c34
rho
=
thermo
.
rho
();
volScalarField
A
(
UEqn
.
A
());
U
=
UEqn
.
H
()
/
A
;
if
(
pimple
.
transonic
())
{
surfaceScalarField
phid
(
"phid"
,
fvc
::
interpolate
(
psi
)
*
((
fvc
::
interpolate
(
U
)
&
mesh
.
Sf
())
-
fvc
::
meshPhi
(
rho
,
U
))
);
while
(
pimple
.
correctNonOrthogonal
())
{
fvScalarMatrix
pEqn
(
fvm
::
ddt
(
psi
,
p
)
+
fvm
::
div
(
phid
,
p
)
-
fvm
::
laplacian
(
rho
/
A
,
p
)
==
Sevap
);
pEqn
.
solve
(
mesh
.
solver
(
p
.
select
(
pimple
.
finalInnerIter
())));
if
(
pimple
.
finalNonOrthogonalIter
())
{
phi
==
pEqn
.
flux
();
}
}
}
else
{
phi
=
fvc
::
interpolate
(
rho
)
*
((
fvc
::
interpolate
(
U
)
&
mesh
.
Sf
())
-
fvc
::
meshPhi
(
rho
,
U
));
while
(
pimple
.
correctNonOrthogonal
())
{
fvScalarMatrix
pEqn
(
fvm
::
ddt
(
psi
,
p
)
+
fvc
::
div
(
phi
)
-
fvm
::
laplacian
(
rho
/
A
,
p
)
==
Sevap
);
pEqn
.
solve
(
mesh
.
solver
(
p
.
select
(
pimple
.
finalInnerIter
())));
if
(
pimple
.
finalNonOrthogonalIter
())
{
phi
+=
pEqn
.
flux
();
}
}
}
#include "rhoEqn.H"
#include "compressibleContinuityErrs.H"
U
-=
fvc
::
grad
(
p
)
/
A
;
U
.
correctBoundaryConditions
();
DpDt
=
fvc
::
DDt
(
surfaceScalarField
(
"phiU"
,
phi
/
fvc
::
interpolate
(
rho
)),
p
);
applications/solvers/combustion/dieselEngineFoam/rhoEqn.H
deleted
100644 → 0
View file @
ca4b8c34
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 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/>.
Global
rhoEqn
Description
Solve the continuity for density.
\*---------------------------------------------------------------------------*/
volScalarField
Sevap
(
IOobject
(
"Sevap"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
NO_READ
,
IOobject
::
NO_WRITE
),
mesh
,
dimensionedScalar
(
"zero"
,
dimensionSet
(
1
,
-
3
,
-
1
,
0
,
0
),
0
.
0
)
);
forAll
(
Y
,
i
)
{
if
(
dieselSpray
.
isLiquidFuel
()[
i
])
{
Sevap
+=
dieselSpray
.
evaporationSource
(
i
);
}
}
{
solve
(
fvm
::
ddt
(
rho
)
+
fvc
::
div
(
phi
)
==
Sevap
);
}
// ************************************************************************* //
applications/solvers/combustion/dieselEngineFoam/spraySummary.H
deleted
100644 → 0
View file @
ca4b8c34
label
Nparcels
=
dieselSpray
.
size
();
reduce
(
Nparcels
,
sumOp
<
label
>
());
Info
<<
"
\n
Number of parcels in system.... | "
<<
Nparcels
<<
endl
<<
"Injected liquid mass........... | "
<<
1e6
*
dieselSpray
.
injectedMass
(
runTime
.
value
())
<<
" mg"
<<
endl
<<
"Liquid Mass in system.......... | "
<<
1e6
*
dieselSpray
.
liquidMass
()
<<
" mg"
<<
endl
<<
"SMD, Dmax...................... | "
<<
dieselSpray
.
smd
()
*
1e6
<<
" mu, "
<<
dieselSpray
.
maxD
()
*
1e6
<<
" mu"
<<
endl
;
scalar
evapMass
=
dieselSpray
.
injectedMass
(
runTime
.
value
())
-
dieselSpray
.
liquidMass
();
scalar
gasMass
=
fvc
::
domainIntegrate
(
rho
).
value
();
if
(
dieselSpray
.
twoD
())
{
gasMass
*=
constant
::
mathematical
::
twoPi
/
dieselSpray
.
angleOfWedge
();
}
scalar
addedMass
=
gasMass
-
gasMass0
;
Info
<<
"Added gas mass................. | "
<<
1e6
*
addedMass
<<
" mg"
<<
nl
<<
"Evaporation Continuity Error... | "
<<
1e6
*
(
addedMass
-
evapMass
)
<<
" mg"
<<
endl
;
applications/solvers/combustion/dieselFoam/Make/files
deleted
100644 → 0
View file @
ca4b8c34
dieselFoam.C
EXE = $(FOAM_APPBIN)/dieselFoam
applications/solvers/combustion/dieselFoam/Make/options
deleted
100644 → 0
View file @
ca4b8c34
EXE_INC = \
-I../dieselEngineFoam \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/lagrangian/dieselSpray/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude \
-I$(LIB_SRC)/../applications/solvers/reactionThermo/XiFoam \
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
-I$(LIB_SRC)/ODE/lnInclude \
-I$(LIB_SRC)/combustionModels/lnInclude
EXE_LIBS = \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lcompressibleLESModels \
-lreactionThermophysicalModels \
-llagrangian \
-lmeshTools \
-ldieselSpray \
-lliquidProperties \
-lliquidMixtureProperties \
-lthermophysicalFunctions \
-lspecie \
-lbasicThermophysicalModels \
-llaminarFlameSpeedModels \
-lchemistryModel \
-lODE \
-ldistributionModels \
-lfiniteVolume \
-lcombustionModels
applications/solvers/combustion/dieselFoam/dieselFoam.C
deleted
100644 → 0
View file @
ca4b8c34
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 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
dieselFoam
Description
Solver for diesel spray and combustion.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "psiChemistryCombustionModel.H"
#include "turbulenceModel.H"
#include "psiChemistryModel.H"
#include "chemistrySolver.H"
#include "spray.H"
#include "multivariateScheme.H"
#include "IFstream.H"
#include "OFstream.H"
#include "Switch.H"
#include "mathematicalConstants.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int
main
(
int
argc
,
char
*
argv
[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"
#include "readGravitationalAcceleration.H"
#include "createSpray.H"
#include "initContinuityErrs.H"
#include "readTimeControls.H"
#include "compressibleCourantNo.H"
#include "setInitialDeltaT.H"
pimpleControl
pimple
(
mesh
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info
<<
"
\n
Starting time loop
\n
"
<<
endl
;
while
(
runTime
.
run
())
{
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
runTime
++
;
Info
<<
"Time = "
<<
runTime
.
timeName
()
<<
nl
<<
endl
;
Info
<<
"Evolving Spray"
<<
endl
;
dieselSpray
.
evolve
();
Info
<<
"Solving chemistry"
<<
endl
;
#include "rhoEqn.H"
// --- Pressure-velocity PIMPLE corrector loop
while
(
pimple
.
loop
())
{
#include "UEqn.H"
#include "YEqn.H"
#include "hsEqn.H"
// --- Pressure corrector loop
while
(
pimple
.
correct
())
{
#include "pEqn.H"
}
if
(
pimple
.
turbCorr
())
{
turbulence
->
correct
();
}
}
#include "spraySummary.H"
rho
=
thermo
.
rho
();
runTime
.
write
();
Info
<<
"ExecutionTime = "
<<
runTime
.
elapsedCpuTime
()
<<
" s"
<<
" ClockTime = "
<<
runTime
.
elapsedClockTime
()
<<
" s"
<<
nl
<<
endl
;
}
Info
<<
"End
\n
"
<<
endl
;
return
0
;
}
// ************************************************************************* //
applications/solvers/combustion/dieselFoam/pEqn.H
deleted
100644 → 0
View file @
ca4b8c34
rho
=
thermo
.
rho
();
volScalarField
rAU
(
1
.
0
/
UEqn
.
A
());
U
=
rAU
*
UEqn
.
H
();
if
(
pimple
.
transonic
())
{
surfaceScalarField
phid
(
"phid"
,
fvc
::
interpolate
(
psi
)
*
(
(
fvc
::
interpolate
(
U
)
&
mesh
.
Sf
())
+
fvc
::
ddtPhiCorr
(
rAU
,
rho
,
U
,
phi
)
)
);
while
(
pimple
.
correctNonOrthogonal
())
{
fvScalarMatrix
pEqn
(
fvm
::
ddt
(
psi
,
p
)
+
fvm
::
div
(
phid
,
p
)
-
fvm
::
laplacian
(
rho
*
rAU
,
p
)
==
Sevap
);
pEqn
.
solve
(
mesh
.
solver
(
p
.
select
(
pimple
.
finalInnerIter
())));
if
(
pimple
.
finalNonOrthogonalIter
())
{
phi
==
pEqn
.
flux
();
}
}
}
else
{
phi
=
fvc
::
interpolate
(
rho
)
*
(
(
fvc
::
interpolate
(
U
)
&
mesh
.
Sf
())