Compare commits

..

3 commits

15 changed files with 467 additions and 81 deletions

17
.gitignore vendored
View file

@ -82,3 +82,20 @@ doc/Doxygen/DTAGS
# Ignore the test directory
/tutorialsTest
.*.swp
*.gz
log.*
postProcessing
*~
processor*
[0-9]*
[0-9]*.[0-9]*
!0.org
constant/extendedFeatureEdgeMesh
*.eMesh
constant/polyMesh/*
!constant/polyMesh/blockMeshDict
constant/cellToRegion
*.OpenFOAM
*.foam

View file

@ -1,11 +0,0 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
targetType=libso
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
libs/Allwmake $targetType $*
solvers_post/Allwmake $targetType $*
#------------------------------------------------------------------------------

View file

@ -21,7 +21,7 @@ thermoType
mixture reactingMixture;
transport sutherland;
thermo janaf;
energy sensibleEnthalpy;
energy absoluteEnthalpy;
equationOfState perfectGas;
specie specie;
}

View file

@ -33,7 +33,7 @@ divSchemes
div(phi,U) Gauss linearUpwindV cellLimited Gauss linear 1;
div(phi,Yi_h) Gauss multivariateSelection
{
h linearUpwind cellLimited Gauss linear 1;
ha linearUpwind cellLimited Gauss linear 1;
H2 linearUpwind cellLimited Gauss linear 1;
H linearUpwind cellLimited Gauss linear 1;
O linearUpwind cellLimited Gauss linear 1;

View file

@ -46,14 +46,14 @@ solvers
relTol 0.0;
}
"(U|Yi|h|k|epsilon|mf|mfVar|Fk)"
"(U|Yi|ha|k|epsilon|mf|mfVar|Fk)"
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-08;
relTol 0;
}
"(U|Yi|h|k|epsilon|mf|mfVar|Fk)Final"
"(U|Yi|ha|k|epsilon|mf|mfVar|Fk)Final"
{
solver PBiCG;
preconditioner DILU;

View file

@ -1,10 +0,0 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
targetType=libso
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
wmake $targetType chemistryModel_POSTECH
wmake $targetType combustionModels_POSTECH
#------------------------------------------------------------------------------

3
libs/thermos/Make/files Normal file
View file

@ -0,0 +1,3 @@
thermoAdd.C
LIB = $(FOAM_USER_LIBBIN)/libthermoAdd

29
libs/thermos/Make/options Normal file
View file

@ -0,0 +1,29 @@
OFP_LIB_SRC = ../
EXE_INC = \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(OFP_LIB_SRC)//chemistryModel_POSTECH/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/functions/Polynomial \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/ODE/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidSpecie/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude
LIB_LIBS = \
-lcompressibleTransportModels \
-lfluidThermophysicalModels \
-lreactionThermophysicalModels \
-lspecie \
-lthermophysicalFunctions \
-lODE \
-lfiniteVolume \
-lcompressibleTransportModels \
-lfluidThermophysicalModels \
-lspecie \
-lsolidSpecie \
-lfiniteVolume \
-lOpenFOAM

384
libs/thermos/thermoAdd.C Normal file
View file

@ -0,0 +1,384 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 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/>.
Typedefs
Foam::thermoPhysicsTypes
Description
Type definitions for thermo-physics models
\*---------------------------------------------------------------------------*/
#include "specie.H"
#include "perfectGas.H"
#include "janafThermo.H"
#include "absoluteEnthalpy.H"
#include "absoluteInternalEnergy.H"
#include "thermo.H"
#include "sutherlandTransport.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// thermo physics types based on absoluteEnthalpy
typedef
sutherlandTransport
<
species::thermo
<
janafThermo
<
perfectGas<specie>
>,
absoluteEnthalpy
>
> gasHaThermoPhysics;
// thermo physics types based on absoluteInternalEnergy
typedef
sutherlandTransport
<
species::thermo
<
janafThermo
<
perfectGas<specie>
>,
absoluteInternalEnergy
>
> gasEaThermoPhysics;
} // End namespace Foam
/*---------------------------------------------------------------------------*\
Typedefs
Foam::reactionTypes
Description
Type definitions for reactions
\*---------------------------------------------------------------------------*/
#include "Reaction.H"
namespace Foam
{
// absolute enthalpy based reactions
typedef Reaction<gasHaThermoPhysics> gasHaReaction;
// absolute internal ennergy based reactions
typedef Reaction<gasEaThermoPhysics> gasEaReaction;
}
// ************************************************************************* //
#include "makeReactionThermo.H"
#include "chemistryReader.H"
#include "foamChemistryReader.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Gas chemistry readers based on absoluteEnthalpy
makeChemistryReader(gasHaThermoPhysics);
makeChemistryReaderType(foamChemistryReader, gasHaThermoPhysics);
// Gas chemistry readers based on absoluteInternalEnergy
makeChemistryReader(gasEaThermoPhysics);
makeChemistryReaderType(foamChemistryReader, gasEaThermoPhysics);
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "makeReaction.H"
#include "ArrheniusReactionRate.H"
#include "infiniteReactionRate.H"
#include "LandauTellerReactionRate.H"
#include "thirdBodyArrheniusReactionRate.H"
#include "ChemicallyActivatedReactionRate.H"
#include "JanevReactionRate.H"
#include "powerSeriesReactionRate.H"
#include "FallOffReactionRate.H"
#include "LindemannFallOffFunction.H"
#include "SRIFallOffFunction.H"
#include "TroeFallOffFunction.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define makeReactions(Thermo, Reaction) \
\
defineTemplateTypeNameAndDebug(Reaction, 0); \
defineTemplateRunTimeSelectionTable(Reaction, Istream); \
defineTemplateRunTimeSelectionTable(Reaction, dictionary); \
\
makeIRNReactions(Thermo, ArrheniusReactionRate) \
makeIRNReactions(Thermo, infiniteReactionRate) \
makeIRNReactions(Thermo, LandauTellerReactionRate) \
makeIRNReactions(Thermo, thirdBodyArrheniusReactionRate) \
\
makeIRReactions(Thermo, JanevReactionRate) \
makeIRReactions(Thermo, powerSeriesReactionRate) \
\
makePressureDependentReactions \
( \
Thermo, \
ArrheniusReactionRate, \
LindemannFallOffFunction \
) \
\
makePressureDependentReactions \
( \
Thermo, \
ArrheniusReactionRate, \
TroeFallOffFunction \
) \
\
makePressureDependentReactions \
( \
Thermo, \
ArrheniusReactionRate, \
SRIFallOffFunction \
)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// absolute enthalpy based reactions
makeReactions(gasHaThermoPhysics, gasHaReaction)
makeReactions(gasEaThermoPhysics, gasEaReaction)
}
// ************************************************************************* //
#include "makeReactionThermo.H"
#include "psiReactionThermo.H"
#include "hePsiThermo.H"
#include "specie.H"
#include "perfectGas.H"
#include "janafThermo.H"
#include "absoluteEnthalpy.H"
#include "thermo.H"
#include "sutherlandTransport.H"
#include "homogeneousMixture.H"
#include "inhomogeneousMixture.H"
#include "veryInhomogeneousMixture.H"
#include "multiComponentMixture.H"
#include "reactingMixture.H"
#include "singleStepReactingMixture.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// sutherlandTransport, janafThermo
makeReactionThermo
(
psiThermo,
psiReactionThermo,
hePsiThermo,
homogeneousMixture,
sutherlandTransport,
absoluteEnthalpy,
janafThermo,
perfectGas,
specie
);
makeReactionThermo
(
psiThermo,
psiReactionThermo,
hePsiThermo,
inhomogeneousMixture,
sutherlandTransport,
absoluteEnthalpy,
janafThermo,
perfectGas,
specie
);
makeReactionThermo
(
psiThermo,
psiReactionThermo,
hePsiThermo,
veryInhomogeneousMixture,
sutherlandTransport,
absoluteEnthalpy,
janafThermo,
perfectGas,
specie
);
// Multi-component thermo for absolute enthalpy
makeReactionMixtureThermo
(
psiThermo,
psiReactionThermo,
hePsiThermo,
multiComponentMixture,
gasHaThermoPhysics
);
// Multi-component thermo for internal energy
makeReactionMixtureThermo
(
psiThermo,
psiReactionThermo,
hePsiThermo,
multiComponentMixture,
gasEaThermoPhysics
);
// Multi-component reaction thermo for absolute enthalpy
makeReactionMixtureThermo
(
psiThermo,
psiReactionThermo,
hePsiThermo,
reactingMixture,
gasHaThermoPhysics
);
makeReactionMixtureThermo
(
psiThermo,
psiReactionThermo,
hePsiThermo,
singleStepReactingMixture,
gasHaThermoPhysics
);
// Multi-component reaction thermo for internal energy
makeReactionMixtureThermo
(
psiThermo,
psiReactionThermo,
hePsiThermo,
reactingMixture,
gasEaThermoPhysics
);
makeReactionMixtureThermo
(
psiThermo,
psiReactionThermo,
hePsiThermo,
singleStepReactingMixture,
gasEaThermoPhysics
);
} // End namespace Foam
/*---------------------------------------------------------------------------*\
InClass
Foam::psiChemistryModel
Description
Creates chemistry model instances templated on the type of thermodynamics
\*---------------------------------------------------------------------------*/
#include "makeChemistryModel.H"
#include "psiChemistryModel.H"
#include "chemistryModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Chemistry moldels based on absoluteEnthalpy
makeChemistryModel
(
chemistryModel,
psiChemistryModel,
gasHaThermoPhysics
);
// Chemistry moldels based on absoluteInternalEnergy
makeChemistryModel
(
chemistryModel,
psiChemistryModel,
gasEaThermoPhysics
);
}
// ************************************************************************* //
#include "makeChemistrySolverTypes.H"
#include "psiChemistryModel.H"
#include "rhoChemistryModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Chemistry solvers based on absoluteEnthalpy
makeChemistrySolverTypes(psiChemistryModel, gasHaThermoPhysics);
// makeChemistrySolverTypes(rhoChemistryModel, gasHaThermoPhysics);
// Chemistry solvers based on absoluteInternalEnergy
makeChemistrySolverTypes(psiChemistryModel, gasEaThermoPhysics);
// makeChemistrySolverTypes(rhoChemistryModel, gasEaThermoPhysics);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View file

@ -1,12 +0,0 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
targetType=libso
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
wmake SLFMFoam
wmake LagrangianCMCFoam
wmake LagrangianCMCSprayFoam
wmake LagrangianCMCdieselEngineFoam4x
#------------------------------------------------------------------------------

View file

@ -5,11 +5,11 @@
{
scalarField Ytemp(Ysize, 0.0);
for(label i=0 ; i < Ysize ; i++) //reaction rate integration over an eta-space for species i
for(label i = 0 ; i < Ysize ; i++) //mass fraction integration over an eta-space for species i
{
for(label k=0 ; k<=group ; k++)
{
for(label j=0 ; j<= etamax ; j++)
for(label j=0 ; j<=etamax ; j++)
{
pdf[j] = Peta[j][celli];
f[j] = QiCMC[(k*(etamax+1)+j)*Ysize + i];
@ -18,33 +18,20 @@
}
}
if( Ytemp[o2index] > Y[o2index][celli] || Ytemp[fuelindex] > Y[fuelindex][celli])
Switch ignoreOFIncrease = true;
Switch oxygenIncrease = Ytemp[o2index] > Y[o2index][celli];
Switch fuelIncrease = Ytemp[fuelindex] > Y[fuelindex][celli];
if( ignoreOFIncrease && (oxygenIncrease || fuelIncrease))
{
SUMSh[celli] = 0;
//keep Yi value
// Do not update Yi
}
else
{
scalarField ReactionRate(Ysize, 0.0);
scalar tShtemp(0);
for(label i = 0 ; i<Ysize ; i++)
{
ReactionRate[i] = rho[celli] * (Ytemp[i] - Y[i][celli]) / runTime.deltaT().value();
tShtemp -= chemistry->calculateShCMC( ReactionRate , i);
}
SUMSh[celli] = tShtemp;
for(label i = 0 ; i <Ysize ; i++)
for(label i = 0 ; i < Ysize ; i++)
{
Y[i][celli] = Ytemp[i];
}
}
}
else
{
SUMSh[celli] = 0;
}
}

View file

@ -6,7 +6,7 @@
fvm::ddt(rho, he) + mvConvection->fvmDiv(phi, he)
+ fvc::ddt(rho, K) + fvc::div(phi, K)
+ (
he.name() == "e"
he.name() == "ea"
? fvc::div
(
fvc::absolute(phi/fvc::interpolate(rho), U),
@ -17,8 +17,7 @@
)
- fvm::laplacian(1.47*turbulence->mut(), he)
==
SUMSh
+fvOptions(rho, he)
fvOptions(rho, he)
);
EEqn.relax();

View file

@ -96,7 +96,6 @@ int main(int argc, char *argv[])
init_start_CMC = false;
}
#include "CMCequation.H" //Solve CMC equations
#include "YEqn.H"
#include "CMCintegration.H" //Conditional field integration and get reaction rate
#include "EEqn.H"

View file

@ -18,6 +18,7 @@ EXE_LIBS = \
-L$(FOAM_USER_LIBBIN) \
-lchemistryModel_POSTECH \
-lcombustionModels_POSTECH \
-lthermoAdd \
-lfiniteVolume \
-lfvOptions \
-lmeshTools \

View file

@ -10,7 +10,7 @@ autoPtr<combustionModels::psiChemistryCombustion> reaction
autoPtr<psiChemistryModel> chemistry = reaction->chem();
psiReactionThermo& thermo = chemistry->thermo();
thermo.validate(args.executable(), "h", "e");
thermo.validate(args.executable(), "ha");
basicMultiComponentMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y();