diffusivityModel is compiled to a seperate libarary.
added laminarReactingFoam for cases without electric field.
This commit is contained in:
parent
cc3d365b3d
commit
d55116bfa4
13 changed files with 273 additions and 49 deletions
19
.gitignore
vendored
19
.gitignore
vendored
|
|
@ -2,6 +2,19 @@
|
|||
[._]*.sw[a-p]
|
||||
[._]s[a-v][a-z]
|
||||
[._]sw[a-p]
|
||||
Make
|
||||
!Make/file
|
||||
!Make/option
|
||||
lnInclude
|
||||
/Make
|
||||
!/Make/file
|
||||
!/Make/option
|
||||
|
||||
/diffusivityModel/Make/*
|
||||
!/diffusivityModel/Make/file
|
||||
!/diffusivityModel/Make/option
|
||||
|
||||
/flameControllingVelocity/Make/*
|
||||
!/flameControllingVelocity/Make/file
|
||||
!/flameControllingVelocity/Make/option
|
||||
|
||||
/laminarReactingFoam/Make/*
|
||||
!/laminarReactingFoam/Make/file
|
||||
!/laminarReactingFoam/Make/option
|
||||
|
|
|
|||
12
EEqn.H
12
EEqn.H
|
|
@ -1,4 +1,14 @@
|
|||
{
|
||||
tmp<fv::convectionScheme<scalar>> hConvection
|
||||
(
|
||||
fv::convectionScheme<scalar>::New
|
||||
(
|
||||
mesh,
|
||||
phi,
|
||||
mesh.divScheme("div(phi,Yi_h)")
|
||||
)
|
||||
);
|
||||
|
||||
typedef multiComponentMixture<gasHThermoPhysics> MMix;
|
||||
|
||||
MMix &janafComposition = dynamic_cast<MMix&>(composition);
|
||||
|
|
@ -49,7 +59,7 @@
|
|||
|
||||
fvScalarMatrix EEqn
|
||||
(
|
||||
fvm::ddt(rho, he) + mvConvection->fvmDiv(phi, he)
|
||||
fvm::ddt(rho, he) + hConvection->fvmDiv(phi, he)
|
||||
+ fvc::ddt(rho, K) + fvc::div(phi, K)
|
||||
- dpdt
|
||||
- fvc::laplacian(diff.k(), T)
|
||||
|
|
|
|||
13
Make/files
13
Make/files
|
|
@ -1,16 +1,3 @@
|
|||
diffusivityModel/Particle/Particle.C
|
||||
diffusivityModel/Neutral/Neutral.C
|
||||
diffusivityModel/Ion/Ion.C
|
||||
diffusivityModel/Electron/Electron.C
|
||||
|
||||
diffusivityModel/Interaction/Interaction.C
|
||||
diffusivityModel/Stockmayer/Stockmayer.C
|
||||
diffusivityModel/Coulomb/Coulomb.C
|
||||
diffusivityModel/N64/N64.C
|
||||
diffusivityModel/CrossSection/CrossSection.C
|
||||
|
||||
diffusivityModel/diffusivityModel/diffusivityModel.C
|
||||
|
||||
eReactingFoam.C
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/eReactingFoam
|
||||
|
|
|
|||
14
Make/options
14
Make/options
|
|
@ -1,14 +1,4 @@
|
|||
EXE_INC = \
|
||||
-g \
|
||||
-IdiffusivityModel/Particle \
|
||||
-IdiffusivityModel/Electron \
|
||||
-IdiffusivityModel/Neutral \
|
||||
-IdiffusivityModel/Ion \
|
||||
-IdiffusivityModel/Interaction \
|
||||
-IdiffusivityModel/Stockmayer \
|
||||
-IdiffusivityModel/Coulomb \
|
||||
-IdiffusivityModel/N64 \
|
||||
-IdiffusivityModel/CrossSection \
|
||||
-IdiffusivityModel/diffusivityModel \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
|
|
@ -36,4 +26,6 @@ EXE_LIBS = \
|
|||
-lfluidThermophysicalModels \
|
||||
-lchemistryModel \
|
||||
-lODE \
|
||||
-lcombustionModels
|
||||
-lcombustionModels \
|
||||
-L$(FOAM_USER_LIBBIN) \
|
||||
-ldiffusivityModel
|
||||
|
|
|
|||
35
YEqn.H
35
YEqn.H
|
|
@ -1,10 +1,24 @@
|
|||
Vc = dimensionedVector("zero", dimLength/dimTime, U[0]*0.0);
|
||||
|
||||
phiC = dimensionedScalar("zero", dimDensity*dimVelocity*dimArea, 0.0);
|
||||
|
||||
forAll(Y, i)
|
||||
{
|
||||
Vc += diff.D(i) * fvc::grad(Y[i]);
|
||||
}
|
||||
|
||||
forAll(Y, i)
|
||||
{
|
||||
phiC += linearInterpolate(rho * diff.D(i)) * fvc::snGrad(Y[i]) * mesh.magSf();
|
||||
}
|
||||
|
||||
tmp<fv::convectionScheme<scalar>> mvConvection
|
||||
(
|
||||
fv::convectionScheme<scalar>::New
|
||||
(
|
||||
mesh,
|
||||
fields,
|
||||
phi,
|
||||
phi + phiC,
|
||||
mesh.divScheme("div(phi,Yi_h)")
|
||||
)
|
||||
);
|
||||
|
|
@ -15,21 +29,6 @@ tmp<fv::convectionScheme<scalar>> mvConvection
|
|||
label inertIndex = -1;
|
||||
volScalarField Yt(0.0*Y[0]);
|
||||
|
||||
// volVectorField Vc(U);
|
||||
Vc = dimensionedVector("zero", dimLength/dimTime, U[0]*0.0);
|
||||
|
||||
phiC = dimensionedScalar("zero", dimDensity*dimVelocity*dimArea, 0.0);
|
||||
|
||||
forAll(Y, i)
|
||||
{
|
||||
Vc += diff.D(i) * fvc::grad(Y[i]);
|
||||
}
|
||||
|
||||
forAll(Y, i)
|
||||
{
|
||||
phiC += linearInterpolate(rho * diff.D(i)) * fvc::snGrad(Y[i]) * mesh.magSf();
|
||||
}
|
||||
|
||||
forAll(Y, i)
|
||||
{
|
||||
if (Y[i].name() != inertSpecie)
|
||||
|
|
@ -39,8 +38,8 @@ tmp<fv::convectionScheme<scalar>> mvConvection
|
|||
fvScalarMatrix YiEqn
|
||||
(
|
||||
fvm::ddt(rho, Yi)
|
||||
+ mvConvection->fvmDiv(phi, Yi)
|
||||
- fvm::laplacian(turbulence->muEff(), Yi)
|
||||
+ mvConvection->fvmDiv(phi + phiC, Yi)
|
||||
- fvm::laplacian(rho * diff.D(i), Yi)
|
||||
==
|
||||
reaction->R(Yi)
|
||||
+ fvOptions(rho, Yi)
|
||||
|
|
|
|||
|
|
@ -17,10 +17,12 @@ dimensionedScalar epsilon0
|
|||
physicalProperties.lookup("epsilon0")
|
||||
);
|
||||
|
||||
/*
|
||||
dimensionedScalar k
|
||||
(
|
||||
physicalProperties.lookup("k")
|
||||
);
|
||||
*/
|
||||
|
||||
|
||||
Info<< "Reading field Phi\n" << endl;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
#include "createElectricField.H"
|
||||
|
||||
Info<< "Creating reaction model\n" << endl;
|
||||
|
||||
autoPtr<combustionModels::psiCombustionModel> reaction
|
||||
|
|
|
|||
14
diffusivityModel/Make/files
Normal file
14
diffusivityModel/Make/files
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
Particle/Particle.C
|
||||
Neutral/Neutral.C
|
||||
Ion/Ion.C
|
||||
Electron/Electron.C
|
||||
|
||||
Interaction/Interaction.C
|
||||
Stockmayer/Stockmayer.C
|
||||
Coulomb/Coulomb.C
|
||||
N64/N64.C
|
||||
CrossSection/CrossSection.C
|
||||
|
||||
diffusivityModel/diffusivityModel.C
|
||||
|
||||
LIB = $(FOAM_USER_LIBBIN)/libdiffusivityModel
|
||||
38
diffusivityModel/Make/options
Normal file
38
diffusivityModel/Make/options
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
EXE_INC = \
|
||||
-IParticle \
|
||||
-IElectron \
|
||||
-INeutral \
|
||||
-IIon \
|
||||
-IInteraction \
|
||||
-IStockmayer \
|
||||
-ICoulomb \
|
||||
-IN64 \
|
||||
-ICrossSection \
|
||||
-IdiffusivityModel \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/sampling/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
|
||||
-I$(LIB_SRC)/ODE/lnInclude \
|
||||
-I$(LIB_SRC)/combustionModels/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lfvOptions \
|
||||
-lmeshTools \
|
||||
-lsampling \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lreactionThermophysicalModels \
|
||||
-lspecie \
|
||||
-lcompressibleTransportModels \
|
||||
-lfluidThermophysicalModels \
|
||||
-lchemistryModel \
|
||||
-lODE \
|
||||
-lcombustionModels
|
||||
|
|
@ -56,6 +56,7 @@ int main(int argc, char *argv[])
|
|||
#include "createTimeControls.H"
|
||||
#include "createRDeltaT.H"
|
||||
#include "initContinuityErrs.H"
|
||||
#include "createElectricField.H"
|
||||
#include "createFields.H"
|
||||
#include "createFieldRefs.H"
|
||||
#include "createFvOptions.H"
|
||||
|
|
@ -95,7 +96,7 @@ int main(int argc, char *argv[])
|
|||
while (pimple.loop())
|
||||
{
|
||||
#include "PhiEqn.H"
|
||||
|
||||
|
||||
diff.correct();
|
||||
|
||||
#include "UEqn.H"
|
||||
|
|
|
|||
3
laminarReactingFoam/Make/files
Normal file
3
laminarReactingFoam/Make/files
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
laminarReactingFoam.C
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/laminarReactingFoam
|
||||
32
laminarReactingFoam/Make/options
Normal file
32
laminarReactingFoam/Make/options
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
EXE_INC = \
|
||||
-I.. \
|
||||
-I../diffusivityModel/diffusivityModel \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/sampling/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
|
||||
-I$(LIB_SRC)/ODE/lnInclude \
|
||||
-I$(LIB_SRC)/combustionModels/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lfvOptions \
|
||||
-lmeshTools \
|
||||
-lsampling \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lreactionThermophysicalModels \
|
||||
-lspecie \
|
||||
-lcompressibleTransportModels \
|
||||
-lfluidThermophysicalModels \
|
||||
-lchemistryModel \
|
||||
-lODE \
|
||||
-lcombustionModels \
|
||||
-L$(FOAM_USER_LIBBIN) \
|
||||
-ldiffusivityModel
|
||||
135
laminarReactingFoam/laminarReactingFoam.C
Normal file
135
laminarReactingFoam/laminarReactingFoam.C
Normal file
|
|
@ -0,0 +1,135 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 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
|
||||
reactingFoam
|
||||
|
||||
Description
|
||||
Solver for combustion with chemical reactions.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "turbulentFluidThermoModel.H"
|
||||
#include "psiCombustionModel.H"
|
||||
#include "multivariateScheme.H"
|
||||
#include "pimpleControl.H"
|
||||
#include "fvOptions.H"
|
||||
#include "localEulerDdtScheme.H"
|
||||
#include "fvcSmooth.H"
|
||||
|
||||
#include "thermoPhysicsTypes.H"
|
||||
#include "multiComponentMixture.H"
|
||||
|
||||
#include "diffusivityModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#include "postProcess.H"
|
||||
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
#include "createMesh.H"
|
||||
#include "createControl.H"
|
||||
#include "createTimeControls.H"
|
||||
#include "createRDeltaT.H"
|
||||
#include "initContinuityErrs.H"
|
||||
#include "createFields.H"
|
||||
#include "createFieldRefs.H"
|
||||
#include "createFvOptions.H"
|
||||
|
||||
turbulence->validate();
|
||||
|
||||
if (!LTS)
|
||||
{
|
||||
#include "compressibleCourantNo.H"
|
||||
#include "setInitialDeltaT.H"
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Info<< "\nStarting time loop\n" << endl;
|
||||
|
||||
while (runTime.run())
|
||||
{
|
||||
#include "readTimeControls.H"
|
||||
|
||||
if (LTS)
|
||||
{
|
||||
#include "setRDeltaT.H"
|
||||
}
|
||||
else
|
||||
{
|
||||
#include "compressibleCourantNo.H"
|
||||
#include "setDeltaT.H"
|
||||
}
|
||||
|
||||
runTime++;
|
||||
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
#include "rhoEqn.H"
|
||||
|
||||
while (pimple.loop())
|
||||
{
|
||||
diff.correct();
|
||||
|
||||
#include "UEqn.H"
|
||||
#include "YEqn.H"
|
||||
#include "EEqn.H"
|
||||
|
||||
// --- Pressure corrector loop
|
||||
while (pimple.correct())
|
||||
{
|
||||
if (pimple.consistent())
|
||||
{
|
||||
#include "pcEqn.H"
|
||||
}
|
||||
else
|
||||
{
|
||||
#include "pEqn.H"
|
||||
}
|
||||
}
|
||||
|
||||
if (pimple.turbCorr())
|
||||
{
|
||||
turbulence->correct();
|
||||
}
|
||||
}
|
||||
|
||||
runTime.write();
|
||||
|
||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||
<< nl << endl;
|
||||
}
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
Loading…
Add table
Reference in a new issue