solidChemistryModel: Removed pending a rewrite based on the latest StandardChemistryModel
solidChemistryModel is not implemented in a general way but specialised to form the basis of the highly specific pyrolysis mode. The handling of reactions is hard-coded for forward reactions only, the Jacobian was present but incomplete so any ODE solvers requiring the Jacobian would either fail, diverge or produce incorrect results. It is not clear if many or any parts of the solidChemistryModel are correct, in particular there is no handling for the solid surface area per unit volume. After a lot of refactoring work it has become clear that solidChemistryModel needs a complete rewrite and can benefit from all the recent development work done on the now more general StandardChemistryModel.
This commit is contained in:
@ -6,12 +6,9 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
|
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/solidSpecie/lnInclude \
|
|
||||||
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/solidChemistryModel/lnInclude \
|
|
||||||
-I$(LIB_SRC)/combustionModels/lnInclude \
|
-I$(LIB_SRC)/combustionModels/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||||
@ -19,7 +16,6 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/radiationModels/lnInclude \
|
-I$(LIB_SRC)/radiationModels/lnInclude \
|
||||||
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
|
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
|
||||||
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
|
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
|
||||||
-I$(LIB_SRC)/regionModels/pyrolysisModels/lnInclude \
|
|
||||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
|
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
|
||||||
-I$(LIB_SRC)/ODE/lnInclude
|
-I$(LIB_SRC)/ODE/lnInclude
|
||||||
@ -37,14 +33,11 @@ EXE_LIBS = \
|
|||||||
-lreactionThermophysicalModels \
|
-lreactionThermophysicalModels \
|
||||||
-lSLGThermo \
|
-lSLGThermo \
|
||||||
-lchemistryModel \
|
-lchemistryModel \
|
||||||
-lsolidChemistryModel \
|
|
||||||
-lcombustionModels \
|
-lcombustionModels \
|
||||||
-lregionModels \
|
-lregionModels \
|
||||||
-lradiationModels \
|
-lradiationModels \
|
||||||
-lsurfaceFilmModels \
|
-lsurfaceFilmModels \
|
||||||
-lsurfaceFilmDerivedFvPatchFields \
|
-lsurfaceFilmDerivedFvPatchFields \
|
||||||
-lpyrolysisModels \
|
|
||||||
-lregionCoupling \
|
|
||||||
-llagrangianIntermediate \
|
-llagrangianIntermediate \
|
||||||
-llagrangianTurbulence \
|
-llagrangianTurbulence \
|
||||||
-lODE
|
-lODE
|
||||||
|
|||||||
@ -119,12 +119,6 @@ Switch solvePrimaryRegion
|
|||||||
additionalControlsDict.lookup("solvePrimaryRegion")
|
additionalControlsDict.lookup("solvePrimaryRegion")
|
||||||
);
|
);
|
||||||
|
|
||||||
Switch solvePyrolysisRegion
|
|
||||||
(
|
|
||||||
additionalControlsDict.lookupOrDefault<bool>("solvePyrolysisRegion", true)
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
Info<< "Creating field dpdt\n" << endl;
|
Info<< "Creating field dpdt\n" << endl;
|
||||||
volScalarField dpdt
|
volScalarField dpdt
|
||||||
(
|
(
|
||||||
@ -143,6 +137,5 @@ volScalarField K("K", 0.5*magSqr(U));
|
|||||||
|
|
||||||
#include "createClouds.H"
|
#include "createClouds.H"
|
||||||
#include "createSurfaceFilmModel.H"
|
#include "createSurfaceFilmModel.H"
|
||||||
#include "createPyrolysisModel.H"
|
|
||||||
#include "createRadiationModel.H"
|
#include "createRadiationModel.H"
|
||||||
#include "createFvOptions.H"
|
#include "createFvOptions.H"
|
||||||
|
|||||||
@ -1,3 +0,0 @@
|
|||||||
Info<< "Creating pyrolysis model" << endl;
|
|
||||||
|
|
||||||
regionModels::pyrolysisModels::pyrolysisModelCollection pyrolysis(mesh);
|
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -26,7 +26,7 @@ Application
|
|||||||
|
|
||||||
Description
|
Description
|
||||||
Transient solver for fires and turbulent diffusion flames with reacting
|
Transient solver for fires and turbulent diffusion flames with reacting
|
||||||
particle clouds, surface film and pyrolysis modelling.
|
particle clouds and surface film modelling.
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
@ -34,10 +34,8 @@ Description
|
|||||||
#include "turbulentFluidThermoModel.H"
|
#include "turbulentFluidThermoModel.H"
|
||||||
#include "basicReactingCloud.H"
|
#include "basicReactingCloud.H"
|
||||||
#include "surfaceFilmModel.H"
|
#include "surfaceFilmModel.H"
|
||||||
#include "pyrolysisModelCollection.H"
|
|
||||||
#include "radiationModel.H"
|
#include "radiationModel.H"
|
||||||
#include "SLGThermo.H"
|
#include "SLGThermo.H"
|
||||||
#include "solidChemistryModel.H"
|
|
||||||
#include "psiReactionThermo.H"
|
#include "psiReactionThermo.H"
|
||||||
#include "CombustionModel.H"
|
#include "CombustionModel.H"
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
@ -59,7 +57,6 @@ int main(int argc, char *argv[])
|
|||||||
#include "createTimeControls.H"
|
#include "createTimeControls.H"
|
||||||
#include "compressibleCourantNo.H"
|
#include "compressibleCourantNo.H"
|
||||||
#include "setInitialDeltaT.H"
|
#include "setInitialDeltaT.H"
|
||||||
#include "readPyrolysisTimeControls.H"
|
|
||||||
|
|
||||||
turbulence->validate();
|
turbulence->validate();
|
||||||
|
|
||||||
@ -71,7 +68,6 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
#include "readTimeControls.H"
|
#include "readTimeControls.H"
|
||||||
#include "compressibleCourantNo.H"
|
#include "compressibleCourantNo.H"
|
||||||
#include "solidRegionDiffusionNo.H"
|
|
||||||
#include "setMultiRegionDeltaT.H"
|
#include "setMultiRegionDeltaT.H"
|
||||||
#include "setDeltaT.H"
|
#include "setDeltaT.H"
|
||||||
|
|
||||||
@ -83,11 +79,6 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
surfaceFilm.evolve();
|
surfaceFilm.evolve();
|
||||||
|
|
||||||
if(solvePyrolysisRegion)
|
|
||||||
{
|
|
||||||
pyrolysis.evolve();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (solvePrimaryRegion)
|
if (solvePrimaryRegion)
|
||||||
{
|
{
|
||||||
#include "rhoEqn.H"
|
#include "rhoEqn.H"
|
||||||
|
|||||||
@ -1,34 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2018 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
|
|
||||||
readPyrolysisTimeControls
|
|
||||||
|
|
||||||
Description
|
|
||||||
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
scalar maxDi = pyrolysis.maxDiff();
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -38,14 +38,7 @@ if (adjustTimeStep)
|
|||||||
CoNum = small;
|
CoNum = small;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DiNum == -great)
|
|
||||||
{
|
|
||||||
DiNum = small;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const scalar TFactorFluid = maxCo/(CoNum + small);
|
const scalar TFactorFluid = maxCo/(CoNum + small);
|
||||||
const scalar TFactorSolid = maxDi/(DiNum + small);
|
|
||||||
const scalar TFactorFilm = maxCo/(surfaceFilm.CourantNumber() + small);
|
const scalar TFactorFilm = maxCo/(surfaceFilm.CourantNumber() + small);
|
||||||
|
|
||||||
const scalar dt0 = runTime.deltaTValue();
|
const scalar dt0 = runTime.deltaTValue();
|
||||||
@ -54,7 +47,7 @@ if (adjustTimeStep)
|
|||||||
(
|
(
|
||||||
min
|
min
|
||||||
(
|
(
|
||||||
dt0*min(min(TFactorFluid, min(TFactorFilm, TFactorSolid)), 1.2),
|
dt0*min(min(TFactorFluid, TFactorFilm), 1.2),
|
||||||
maxDeltaT
|
maxDeltaT
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|||||||
@ -1 +0,0 @@
|
|||||||
scalar DiNum = pyrolysis.solidRegionDiffNo();
|
|
||||||
@ -12,7 +12,6 @@ LIB_LIBS = \
|
|||||||
-lcompressibleTransportModels \
|
-lcompressibleTransportModels \
|
||||||
-lfluidThermophysicalModels \
|
-lfluidThermophysicalModels \
|
||||||
-lsolidThermo \
|
-lsolidThermo \
|
||||||
-lsolidSpecie \
|
|
||||||
-lturbulenceModels \
|
-lturbulenceModels \
|
||||||
-lspecie \
|
-lspecie \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
|
|||||||
@ -3,9 +3,7 @@ cd ${0%/*} || exit 1 # Run from this directory
|
|||||||
makeType=${1:-libso}
|
makeType=${1:-libso}
|
||||||
|
|
||||||
wclean $makeType regionModel
|
wclean $makeType regionModel
|
||||||
wclean $makeType pyrolysisModels
|
|
||||||
wclean $makeType surfaceFilmModels
|
wclean $makeType surfaceFilmModels
|
||||||
wclean $makeType thermalBaffleModels
|
wclean $makeType thermalBaffleModels
|
||||||
wclean $makeType regionCoupling
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -5,10 +5,8 @@ cd ${0%/*} || exit 1 # Run from this directory
|
|||||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||||
|
|
||||||
wmake $targetType regionModel
|
wmake $targetType regionModel
|
||||||
wmake $targetType pyrolysisModels
|
|
||||||
wmake $targetType surfaceFilmModels
|
wmake $targetType surfaceFilmModels
|
||||||
wmake $targetType surfaceFilmModels/derivedFvPatchFields/wallFunctions
|
wmake $targetType surfaceFilmModels/derivedFvPatchFields/wallFunctions
|
||||||
wmake $targetType thermalBaffleModels
|
wmake $targetType thermalBaffleModels
|
||||||
wmake $targetType regionCoupling
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -1,8 +0,0 @@
|
|||||||
/* Pyrolysis models */
|
|
||||||
pyrolysisModel/pyrolysisModel.C
|
|
||||||
pyrolysisModel/pyrolysisModelNew.C
|
|
||||||
reactingOneDim/reactingOneDim.C
|
|
||||||
noPyrolysis/noPyrolysis.C
|
|
||||||
pyrolysisModel/pyrolysisModelCollection.C
|
|
||||||
|
|
||||||
LIB = $(FOAM_LIBBIN)/libpyrolysisModels
|
|
||||||
@ -1,26 +0,0 @@
|
|||||||
EXE_INC = \
|
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
|
||||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/solidChemistryModel/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
|
||||||
-I$(LIB_SRC)/radiationModels/lnInclude \
|
|
||||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
|
||||||
-I$(LIB_SRC)/regionModels/regionModel/lnInclude
|
|
||||||
|
|
||||||
LIB_LIBS = \
|
|
||||||
-lfiniteVolume \
|
|
||||||
-lmeshTools \
|
|
||||||
-lchemistryModel \
|
|
||||||
-lspecie \
|
|
||||||
-lfluidThermophysicalModels \
|
|
||||||
-lsolidChemistryModel \
|
|
||||||
-lsolidThermo \
|
|
||||||
-lturbulenceModels \
|
|
||||||
-lcompressibleTurbulenceModels \
|
|
||||||
-lregionModels \
|
|
||||||
-lradiationModels \
|
|
||||||
-lreactionThermophysicalModels
|
|
||||||
@ -1,194 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2019 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/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "noPyrolysis.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
#include "volFields.H"
|
|
||||||
#include "absorptionEmissionModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace regionModels
|
|
||||||
{
|
|
||||||
namespace pyrolysisModels
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
defineTypeNameAndDebug(noPyrolysis, 0);
|
|
||||||
addToRunTimeSelectionTable(pyrolysisModel, noPyrolysis, mesh);
|
|
||||||
addToRunTimeSelectionTable(pyrolysisModel, noPyrolysis, dictionary);
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void noPyrolysis::constructThermoChemistry()
|
|
||||||
{
|
|
||||||
solidThermo_.reset
|
|
||||||
(
|
|
||||||
solidReactionThermo::New(regionMesh()).ptr()
|
|
||||||
);
|
|
||||||
|
|
||||||
solidChemistry_.reset
|
|
||||||
(
|
|
||||||
basicSolidChemistryModel::New(solidThermo_()).ptr()
|
|
||||||
);
|
|
||||||
|
|
||||||
solidThermo_.reset(&solidChemistry_->solidThermo());
|
|
||||||
radiation_.reset(radiationModel::New(solidThermo_->T()).ptr());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool noPyrolysis::read()
|
|
||||||
{
|
|
||||||
if (pyrolysisModel::read())
|
|
||||||
{
|
|
||||||
// no additional info to read
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool noPyrolysis::read(const dictionary& dict)
|
|
||||||
{
|
|
||||||
if (pyrolysisModel::read(dict))
|
|
||||||
{
|
|
||||||
// no additional info to read
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
noPyrolysis::noPyrolysis
|
|
||||||
(
|
|
||||||
const word& modelType,
|
|
||||||
const fvMesh& mesh,
|
|
||||||
const word& regionType
|
|
||||||
)
|
|
||||||
:
|
|
||||||
pyrolysisModel(mesh, regionType),
|
|
||||||
solidThermo_(nullptr),
|
|
||||||
solidChemistry_(nullptr),
|
|
||||||
radiation_(nullptr)
|
|
||||||
{
|
|
||||||
if (active())
|
|
||||||
{
|
|
||||||
constructThermoChemistry();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
noPyrolysis::noPyrolysis
|
|
||||||
(
|
|
||||||
const word& modelType,
|
|
||||||
const fvMesh& mesh,
|
|
||||||
const dictionary& dict,
|
|
||||||
const word& regionType
|
|
||||||
)
|
|
||||||
:
|
|
||||||
pyrolysisModel(mesh, regionType),
|
|
||||||
solidThermo_(nullptr),
|
|
||||||
solidChemistry_(nullptr),
|
|
||||||
radiation_(nullptr)
|
|
||||||
{
|
|
||||||
if (active())
|
|
||||||
{
|
|
||||||
constructThermoChemistry();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
noPyrolysis::~noPyrolysis()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void noPyrolysis::preEvolveRegion()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
void noPyrolysis::evolveRegion()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
const volScalarField& noPyrolysis::rho() const
|
|
||||||
{
|
|
||||||
return solidThermo_->rho();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const volScalarField& noPyrolysis::T() const
|
|
||||||
{
|
|
||||||
return solidThermo_->T();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const tmp<volScalarField> noPyrolysis::Cp() const
|
|
||||||
{
|
|
||||||
return solidThermo_->Cp();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
tmp<volScalarField> noPyrolysis::kappaRad() const
|
|
||||||
{
|
|
||||||
return radiation_->absorptionEmission().a();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
tmp<volScalarField> noPyrolysis::kappa() const
|
|
||||||
{
|
|
||||||
return solidThermo_->kappa();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const surfaceScalarField& noPyrolysis::phiGas() const
|
|
||||||
{
|
|
||||||
FatalErrorInFunction
|
|
||||||
<< "phiGas field not available for " << type() << abort(FatalError);
|
|
||||||
return surfaceScalarField::null();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace surfaceFilmModels
|
|
||||||
} // End namespace regionModels
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,165 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2019 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/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::regionModels::pyrolysisModels::noPyrolysis
|
|
||||||
|
|
||||||
Description
|
|
||||||
Dummy surface pyrolysis model for 'none'
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
noPyrolysis.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef noPyrolysis_H
|
|
||||||
#define noPyrolysis_H
|
|
||||||
|
|
||||||
#include "pyrolysisModel.H"
|
|
||||||
#include "volFieldsFwd.H"
|
|
||||||
#include "basicSolidChemistryModel.H"
|
|
||||||
#include "radiationModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace regionModels
|
|
||||||
{
|
|
||||||
namespace pyrolysisModels
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class noPyrolysis Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class noPyrolysis
|
|
||||||
:
|
|
||||||
public pyrolysisModel
|
|
||||||
{
|
|
||||||
protected:
|
|
||||||
|
|
||||||
// Protected member functions
|
|
||||||
|
|
||||||
//- Read control parameters from dictionary
|
|
||||||
virtual bool read();
|
|
||||||
|
|
||||||
//- Read control parameters from dictionary
|
|
||||||
virtual bool read(const dictionary& dict);
|
|
||||||
|
|
||||||
//- Reset solidChemistryModel and solidThermo pointers
|
|
||||||
void constructThermoChemistry();
|
|
||||||
|
|
||||||
//- Reference to solid thermo
|
|
||||||
autoPtr<solidReactionThermo> solidThermo_;
|
|
||||||
|
|
||||||
//- Reference to the solid chemistry model
|
|
||||||
autoPtr<basicSolidChemistryModel> solidChemistry_;
|
|
||||||
|
|
||||||
//- Pointer to radiation model
|
|
||||||
autoPtr<radiationModel> radiation_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("none");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from type name and mesh
|
|
||||||
noPyrolysis
|
|
||||||
(
|
|
||||||
const word& modelType,
|
|
||||||
const fvMesh& mesh,
|
|
||||||
const word& regionType
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct from type name and mesh and dict
|
|
||||||
noPyrolysis
|
|
||||||
(
|
|
||||||
const word& modelType,
|
|
||||||
const fvMesh& mesh,
|
|
||||||
const dictionary& dict,
|
|
||||||
const word& regionType
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Disallow default bitwise copy construction
|
|
||||||
noPyrolysis(const noPyrolysis&) = delete;
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~noPyrolysis();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
// Fields
|
|
||||||
|
|
||||||
//- Return density [kg/m^3]
|
|
||||||
virtual const volScalarField& rho() const;
|
|
||||||
|
|
||||||
//- Return const temperature [K]
|
|
||||||
virtual const volScalarField& T() const;
|
|
||||||
|
|
||||||
//- Return specific heat capacity [J/kg/K]
|
|
||||||
virtual const tmp<volScalarField> Cp() const;
|
|
||||||
|
|
||||||
//- Return the region absorptivity [1/m]
|
|
||||||
virtual tmp<volScalarField> kappaRad() const;
|
|
||||||
|
|
||||||
//- Return the region thermal conductivity [W/m/k]
|
|
||||||
virtual tmp<volScalarField> kappa() const;
|
|
||||||
|
|
||||||
//- Return the total gas mass flux to primary region [kg/m^2/s]
|
|
||||||
virtual const surfaceScalarField& phiGas() const;
|
|
||||||
|
|
||||||
|
|
||||||
// Evolution
|
|
||||||
|
|
||||||
//- Pre-evolve region
|
|
||||||
virtual void preEvolveRegion();
|
|
||||||
|
|
||||||
//- Evolve the pyrolysis equations
|
|
||||||
virtual void evolveRegion();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Operators
|
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
|
||||||
void operator=(const noPyrolysis&) = delete;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace pyrolysisModels
|
|
||||||
} // End namespace regionModels
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,154 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2018 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/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "pyrolysisModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace regionModels
|
|
||||||
{
|
|
||||||
namespace pyrolysisModels
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
defineTypeNameAndDebug(pyrolysisModel, 0);
|
|
||||||
defineRunTimeSelectionTable(pyrolysisModel, mesh);
|
|
||||||
defineRunTimeSelectionTable(pyrolysisModel, dictionary);
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void pyrolysisModel::readPyrolysisControls()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
bool pyrolysisModel::read()
|
|
||||||
{
|
|
||||||
if (regionModel1D::read())
|
|
||||||
{
|
|
||||||
readPyrolysisControls();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool pyrolysisModel::read(const dictionary& dict)
|
|
||||||
{
|
|
||||||
if (regionModel1D::read(dict))
|
|
||||||
{
|
|
||||||
readPyrolysisControls();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
pyrolysisModel::pyrolysisModel(const fvMesh& mesh, const word& regionType)
|
|
||||||
:
|
|
||||||
regionModel1D(mesh, regionType)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
pyrolysisModel::pyrolysisModel
|
|
||||||
(
|
|
||||||
const word& modelType,
|
|
||||||
const fvMesh& mesh,
|
|
||||||
const word& regionType
|
|
||||||
)
|
|
||||||
:
|
|
||||||
regionModel1D(mesh, regionType, modelType)
|
|
||||||
{
|
|
||||||
if (active_)
|
|
||||||
{
|
|
||||||
read();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
pyrolysisModel::pyrolysisModel
|
|
||||||
(
|
|
||||||
const word& modelType,
|
|
||||||
const fvMesh& mesh,
|
|
||||||
const dictionary& dict,
|
|
||||||
const word& regionType
|
|
||||||
)
|
|
||||||
:
|
|
||||||
regionModel1D(mesh, regionType, modelType, dict)
|
|
||||||
{
|
|
||||||
if (active_)
|
|
||||||
{
|
|
||||||
read(dict);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
pyrolysisModel::~pyrolysisModel()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
scalar pyrolysisModel::addMassSources
|
|
||||||
(
|
|
||||||
const label patchi,
|
|
||||||
const label facei
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return 0.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
scalar pyrolysisModel::solidRegionDiffNo() const
|
|
||||||
{
|
|
||||||
return -great;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
scalar pyrolysisModel::maxDiff() const
|
|
||||||
{
|
|
||||||
return great;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace pyrolysisModels
|
|
||||||
} // End namespace regionModels
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,241 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2019 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/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::regionModels::pyrolysisModels::pyrolysisModel
|
|
||||||
|
|
||||||
Description
|
|
||||||
Base class for pyrolysis models
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
pyrolysisModelI.H
|
|
||||||
pyrolysisModel.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef pyrolysisModel_H
|
|
||||||
#define pyrolysisModel_H
|
|
||||||
|
|
||||||
#include "runTimeSelectionTables.H"
|
|
||||||
#include "volFieldsFwd.H"
|
|
||||||
#include "regionModel1D.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// Forward declaration of classes
|
|
||||||
class fvMesh;
|
|
||||||
class Time;
|
|
||||||
|
|
||||||
namespace regionModels
|
|
||||||
{
|
|
||||||
namespace pyrolysisModels
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class pyrolysisModel Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class pyrolysisModel
|
|
||||||
:
|
|
||||||
public regionModel1D
|
|
||||||
{
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- Construct fields
|
|
||||||
void constructMeshObjects();
|
|
||||||
|
|
||||||
//- Read pyrolysis controls
|
|
||||||
void readPyrolysisControls();
|
|
||||||
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
// Protected Member Functions
|
|
||||||
|
|
||||||
//- Read control parameters
|
|
||||||
virtual bool read();
|
|
||||||
|
|
||||||
//- Read control parameters from dictionary
|
|
||||||
virtual bool read(const dictionary& dict);
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("pyrolysisModel");
|
|
||||||
|
|
||||||
|
|
||||||
// Declare runtime constructor selection table
|
|
||||||
|
|
||||||
declareRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
autoPtr,
|
|
||||||
pyrolysisModel,
|
|
||||||
mesh,
|
|
||||||
(
|
|
||||||
const word& modelType,
|
|
||||||
const fvMesh& mesh,
|
|
||||||
const word& regionType
|
|
||||||
),
|
|
||||||
(modelType, mesh, regionType)
|
|
||||||
);
|
|
||||||
|
|
||||||
declareRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
autoPtr,
|
|
||||||
pyrolysisModel,
|
|
||||||
dictionary,
|
|
||||||
(
|
|
||||||
const word& modelType,
|
|
||||||
const fvMesh& mesh,
|
|
||||||
const dictionary& dict,
|
|
||||||
const word& regionType
|
|
||||||
),
|
|
||||||
(modelType, mesh, dict, regionType)
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct null from mesh
|
|
||||||
pyrolysisModel
|
|
||||||
(
|
|
||||||
const fvMesh& mesh,
|
|
||||||
const word& regionType
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct from type name and mesh
|
|
||||||
pyrolysisModel
|
|
||||||
(
|
|
||||||
const word& modelType,
|
|
||||||
const fvMesh& mesh,
|
|
||||||
const word& regionType
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct from type name and mesh and dictionary
|
|
||||||
pyrolysisModel
|
|
||||||
(
|
|
||||||
const word& modelType,
|
|
||||||
const fvMesh& mesh,
|
|
||||||
const dictionary& dict,
|
|
||||||
const word& regionType
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Disallow default bitwise copy construction
|
|
||||||
pyrolysisModel(const pyrolysisModel&) = delete;
|
|
||||||
|
|
||||||
//- Return clone
|
|
||||||
autoPtr<pyrolysisModel> clone() const
|
|
||||||
{
|
|
||||||
NotImplemented;
|
|
||||||
return autoPtr<pyrolysisModel>(nullptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Selectors
|
|
||||||
|
|
||||||
//- Return a reference to the selected pyrolysis model
|
|
||||||
static autoPtr<pyrolysisModel> New
|
|
||||||
(
|
|
||||||
const fvMesh& mesh,
|
|
||||||
const word& regionType = "pyrolysis"
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Return a reference to a named selected pyrolysis model
|
|
||||||
static autoPtr<pyrolysisModel> New
|
|
||||||
(
|
|
||||||
const fvMesh& mesh,
|
|
||||||
const dictionary& dict,
|
|
||||||
const word& regionType = "pyrolysis"
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~pyrolysisModel();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
// Access
|
|
||||||
|
|
||||||
// Fields
|
|
||||||
|
|
||||||
//- Return density [kg/m^3]
|
|
||||||
virtual const volScalarField& rho() const = 0;
|
|
||||||
|
|
||||||
//- Return const temperature [K]
|
|
||||||
virtual const volScalarField& T() const = 0;
|
|
||||||
|
|
||||||
//- Return specific heat capacity [J/kg/K]
|
|
||||||
virtual const tmp<volScalarField> Cp() const = 0;
|
|
||||||
|
|
||||||
//- Return the region absorptivity [1/m]
|
|
||||||
virtual tmp<volScalarField> kappaRad() const = 0;
|
|
||||||
|
|
||||||
//- Return the region thermal conductivity [W/m/k]
|
|
||||||
virtual tmp<volScalarField> kappa() const = 0;
|
|
||||||
|
|
||||||
//- Return the total gas mass flux to primary region [kg/m^2/s]
|
|
||||||
virtual const surfaceScalarField& phiGas() const = 0;
|
|
||||||
|
|
||||||
|
|
||||||
// Sources
|
|
||||||
|
|
||||||
//- External hook to add mass to the primary region
|
|
||||||
virtual scalar addMassSources
|
|
||||||
(
|
|
||||||
const label patchi,
|
|
||||||
const label facei
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// Helper function
|
|
||||||
|
|
||||||
//- Mean diffusion number of the solid region
|
|
||||||
virtual scalar solidRegionDiffNo() const;
|
|
||||||
|
|
||||||
//- Return max diffusivity allowed in the solid
|
|
||||||
virtual scalar maxDiff() const;
|
|
||||||
|
|
||||||
|
|
||||||
// Member Operators
|
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
|
||||||
void operator=(const pyrolysisModel&) = delete;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace pyrolysisModels
|
|
||||||
} // End namespace regionModels
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,198 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2018 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/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "pyrolysisModelCollection.H"
|
|
||||||
#include "volFields.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace regionModels
|
|
||||||
{
|
|
||||||
namespace pyrolysisModels
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(pyrolysisModelCollection, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace regionModels
|
|
||||||
{
|
|
||||||
namespace pyrolysisModels
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
pyrolysisModelCollection::pyrolysisModelCollection(const fvMesh& mesh)
|
|
||||||
:
|
|
||||||
PtrList<pyrolysisModel>()
|
|
||||||
|
|
||||||
{
|
|
||||||
IOdictionary pyrolysisZonesDict
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"pyrolysisZones",
|
|
||||||
mesh.time().constant(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
const wordList regions(pyrolysisZonesDict.toc());
|
|
||||||
|
|
||||||
setSize(regions.size());
|
|
||||||
|
|
||||||
for (label i = 0; i < regions.size(); i++)
|
|
||||||
{
|
|
||||||
set
|
|
||||||
(
|
|
||||||
i,
|
|
||||||
pyrolysisModel::New
|
|
||||||
(
|
|
||||||
mesh,
|
|
||||||
pyrolysisZonesDict.subDict(regions[i]),
|
|
||||||
regions[i]
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
pyrolysisModelCollection::~pyrolysisModelCollection()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
void pyrolysisModelCollection::preEvolveRegion()
|
|
||||||
{
|
|
||||||
forAll(*this, i)
|
|
||||||
{
|
|
||||||
this->operator[](i).preEvolveRegion();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void pyrolysisModelCollection::evolveRegion()
|
|
||||||
{
|
|
||||||
forAll(*this, i)
|
|
||||||
{
|
|
||||||
this->operator[](i).evolveRegion();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void pyrolysisModelCollection::evolve()
|
|
||||||
{
|
|
||||||
forAll(*this, i)
|
|
||||||
{
|
|
||||||
pyrolysisModel& pyrolysis = this->operator[](i);
|
|
||||||
|
|
||||||
if (pyrolysis.active())
|
|
||||||
{
|
|
||||||
if (pyrolysis.primaryMesh().changing())
|
|
||||||
{
|
|
||||||
FatalErrorInFunction
|
|
||||||
<< "Currently not possible to apply "
|
|
||||||
<< pyrolysis.modelName()
|
|
||||||
<< " model to moving mesh cases" << nl<< abort(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Pre-evolve
|
|
||||||
pyrolysis.preEvolveRegion();
|
|
||||||
|
|
||||||
// Increment the region equations up to the new time level
|
|
||||||
pyrolysis.evolveRegion();
|
|
||||||
|
|
||||||
// Provide some feedback
|
|
||||||
if (pyrolysis.infoOutput())
|
|
||||||
{
|
|
||||||
Info<< incrIndent;
|
|
||||||
pyrolysis.info();
|
|
||||||
Info<< endl << decrIndent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void pyrolysisModelCollection::info()
|
|
||||||
{
|
|
||||||
forAll(*this, i)
|
|
||||||
{
|
|
||||||
this->operator[](i).info();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
scalar pyrolysisModelCollection::maxDiff() const
|
|
||||||
{
|
|
||||||
scalar maxDiff = 0.0;
|
|
||||||
forAll(*this, i)
|
|
||||||
{
|
|
||||||
if (maxDiff < this->operator[](i).maxDiff())
|
|
||||||
{
|
|
||||||
maxDiff = this->operator[](i).maxDiff();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
return maxDiff;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
scalar pyrolysisModelCollection::solidRegionDiffNo() const
|
|
||||||
{
|
|
||||||
scalar totalDiNum = great;
|
|
||||||
|
|
||||||
forAll(*this, i)
|
|
||||||
{
|
|
||||||
if
|
|
||||||
(
|
|
||||||
totalDiNum > this->operator[](i).solidRegionDiffNo()
|
|
||||||
)
|
|
||||||
{
|
|
||||||
totalDiNum = this->operator[](i).solidRegionDiffNo();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return totalDiNum;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
} // End namespace pyrolysisModels
|
|
||||||
} // End namespace regionModels
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,121 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2019 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/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::regionModels::pyrolysisModels::pyrolysisModelCollection
|
|
||||||
|
|
||||||
Description
|
|
||||||
A centralized pyrolysis collection.
|
|
||||||
|
|
||||||
Container class for a set of pyrolysis with functions implemented
|
|
||||||
to loop over the functions for each type.
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
pyrolysisModelCollection.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef pyrolysisModelCollection_H
|
|
||||||
#define pyrolysisModelCollection_H
|
|
||||||
|
|
||||||
#include "PtrList.H"
|
|
||||||
#include "pyrolysisModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// Forward class declarations
|
|
||||||
class fvMesh;
|
|
||||||
|
|
||||||
namespace regionModels
|
|
||||||
{
|
|
||||||
namespace pyrolysisModels
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class pyrolysisModelCollection Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class pyrolysisModelCollection
|
|
||||||
:
|
|
||||||
public PtrList<pyrolysisModel>
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
// Runtime type information
|
|
||||||
TypeName("pyrolysisModelCollection");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from mesh
|
|
||||||
pyrolysisModelCollection(const fvMesh&);
|
|
||||||
|
|
||||||
//- Disallow default bitwise copy construction
|
|
||||||
pyrolysisModelCollection(const pyrolysisModelCollection&) = delete;
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~pyrolysisModelCollection();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Pre-evolve regions
|
|
||||||
virtual void preEvolveRegion();
|
|
||||||
|
|
||||||
//- Evolve the pyrolysis equation regions
|
|
||||||
virtual void evolveRegion();
|
|
||||||
|
|
||||||
//- Evolve regions
|
|
||||||
virtual void evolve();
|
|
||||||
|
|
||||||
//- Provide some feedback from pyrolysis regions
|
|
||||||
virtual void info();
|
|
||||||
|
|
||||||
//- Return max diffusivity allowed in the solid
|
|
||||||
virtual scalar maxDiff() const;
|
|
||||||
|
|
||||||
//- Mean diffusion number of the solid regions
|
|
||||||
virtual scalar solidRegionDiffNo() const;
|
|
||||||
|
|
||||||
|
|
||||||
// Member Operators
|
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
|
||||||
void operator=(const pyrolysisModelCollection&) = delete;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace pyrolysisModels
|
|
||||||
} // End namespace regionModels
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,44 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2018 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/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "pyrolysisModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
inline const Foam::Switch&
|
|
||||||
Foam::pyrolysisModels::pyrolysisModel::active() const
|
|
||||||
{
|
|
||||||
return active_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::dictionary&
|
|
||||||
Foam::pyrolysisModels::pyrolysisModel::coeffs() const
|
|
||||||
{
|
|
||||||
return coeffs_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,125 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2018 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/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "pyrolysisModel.H"
|
|
||||||
#include "fvMesh.H"
|
|
||||||
#include "Time.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace regionModels
|
|
||||||
{
|
|
||||||
namespace pyrolysisModels
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
autoPtr<pyrolysisModel> pyrolysisModel::New
|
|
||||||
(
|
|
||||||
const fvMesh& mesh,
|
|
||||||
const word& regionType
|
|
||||||
)
|
|
||||||
{
|
|
||||||
// get model name, but do not register the dictionary
|
|
||||||
const word modelType
|
|
||||||
(
|
|
||||||
IOdictionary
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
regionType + "Properties",
|
|
||||||
mesh.time().constant(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ,
|
|
||||||
IOobject::NO_WRITE,
|
|
||||||
false
|
|
||||||
)
|
|
||||||
).lookup("pyrolysisModel")
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<< "Selecting pyrolysisModel " << modelType << endl;
|
|
||||||
|
|
||||||
meshConstructorTable::iterator cstrIter =
|
|
||||||
meshConstructorTablePtr_->find(modelType);
|
|
||||||
|
|
||||||
if (cstrIter == meshConstructorTablePtr_->end())
|
|
||||||
{
|
|
||||||
FatalErrorInFunction
|
|
||||||
<< "Unknown pyrolysisModel type " << modelType
|
|
||||||
<< nl << nl << "Valid pyrolisisModel types are:" << nl
|
|
||||||
<< meshConstructorTablePtr_->sortedToc()
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
return autoPtr<pyrolysisModel>(cstrIter()(modelType, mesh, regionType));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
autoPtr<pyrolysisModel> pyrolysisModel::New
|
|
||||||
(
|
|
||||||
const fvMesh& mesh,
|
|
||||||
const dictionary& dict,
|
|
||||||
const word& regionType
|
|
||||||
)
|
|
||||||
{
|
|
||||||
|
|
||||||
const word modelType = dict.lookup("pyrolysisModel");
|
|
||||||
|
|
||||||
Info<< "Selecting pyrolysisModel " << modelType << endl;
|
|
||||||
|
|
||||||
dictionaryConstructorTable::iterator cstrIter =
|
|
||||||
dictionaryConstructorTablePtr_->find(modelType);
|
|
||||||
|
|
||||||
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
|
||||||
{
|
|
||||||
FatalErrorInFunction
|
|
||||||
<< "Unknown pyrolysisModel type " << modelType
|
|
||||||
<< nl << nl << "Valid pyrolisisModel types are:" << nl
|
|
||||||
<< dictionaryConstructorTablePtr_->sortedToc()
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
return autoPtr<pyrolysisModel>
|
|
||||||
(
|
|
||||||
cstrIter()
|
|
||||||
(
|
|
||||||
modelType,
|
|
||||||
mesh,
|
|
||||||
dict,
|
|
||||||
regionType
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace surfaceFilmModels
|
|
||||||
} // End namespace regionModels
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,744 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2019 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/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "reactingOneDim.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
#include "fvm.H"
|
|
||||||
#include "fvcDiv.H"
|
|
||||||
#include "fvcVolumeIntegrate.H"
|
|
||||||
#include "fvcLaplacian.H"
|
|
||||||
#include "absorptionEmissionModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace regionModels
|
|
||||||
{
|
|
||||||
namespace pyrolysisModels
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
defineTypeNameAndDebug(reactingOneDim, 0);
|
|
||||||
|
|
||||||
addToRunTimeSelectionTable(pyrolysisModel, reactingOneDim, mesh);
|
|
||||||
addToRunTimeSelectionTable(pyrolysisModel, reactingOneDim, dictionary);
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void reactingOneDim::readReactingOneDimControls()
|
|
||||||
{
|
|
||||||
const dictionary& solution = this->solution().subDict("SIMPLE");
|
|
||||||
solution.lookup("nNonOrthCorr") >> nNonOrthCorr_;
|
|
||||||
time().controlDict().lookup("maxDi") >> maxDiff_;
|
|
||||||
|
|
||||||
coeffs().lookup("minimumDelta") >> minimumDelta_;
|
|
||||||
|
|
||||||
coeffs().lookup("gasHSource") >> gasHSource_;
|
|
||||||
coeffs().lookup("qrHSource") >> qrHSource_;
|
|
||||||
useChemistrySolvers_ =
|
|
||||||
coeffs().lookupOrDefault<bool>("useChemistrySolvers", true);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool reactingOneDim::read()
|
|
||||||
{
|
|
||||||
if (pyrolysisModel::read())
|
|
||||||
{
|
|
||||||
readReactingOneDimControls();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool reactingOneDim::read(const dictionary& dict)
|
|
||||||
{
|
|
||||||
if (pyrolysisModel::read(dict))
|
|
||||||
{
|
|
||||||
readReactingOneDimControls();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void reactingOneDim::updateqr()
|
|
||||||
{
|
|
||||||
// Update local qr from coupled qr field
|
|
||||||
qr_ == dimensionedScalar(qr_.dimensions(), 0);
|
|
||||||
|
|
||||||
// Retrieve field from coupled region using mapped boundary conditions
|
|
||||||
qr_.correctBoundaryConditions();
|
|
||||||
|
|
||||||
volScalarField::Boundary& qrBf = qr_.boundaryFieldRef();
|
|
||||||
|
|
||||||
forAll(intCoupledPatchIDs_, i)
|
|
||||||
{
|
|
||||||
const label patchi = intCoupledPatchIDs_[i];
|
|
||||||
|
|
||||||
// qr is positive going in the solid
|
|
||||||
// If the surface is emitting the radiative flux is set to zero
|
|
||||||
qrBf[patchi] = max(qrBf[patchi], scalar(0));
|
|
||||||
}
|
|
||||||
|
|
||||||
const vectorField& cellC = regionMesh().cellCentres();
|
|
||||||
|
|
||||||
tmp<volScalarField> kappa = kappaRad();
|
|
||||||
|
|
||||||
// Propagate qr through 1-D regions
|
|
||||||
label localPyrolysisFacei = 0;
|
|
||||||
forAll(intCoupledPatchIDs_, i)
|
|
||||||
{
|
|
||||||
const label patchi = intCoupledPatchIDs_[i];
|
|
||||||
|
|
||||||
const scalarField& qrp = qr_.boundaryField()[patchi];
|
|
||||||
const vectorField& Cf = regionMesh().Cf().boundaryField()[patchi];
|
|
||||||
|
|
||||||
forAll(qrp, facei)
|
|
||||||
{
|
|
||||||
const scalar qr0 = qrp[facei];
|
|
||||||
point Cf0 = Cf[facei];
|
|
||||||
const labelList& cells = boundaryFaceCells_[localPyrolysisFacei++];
|
|
||||||
scalar kappaInt = 0.0;
|
|
||||||
forAll(cells, k)
|
|
||||||
{
|
|
||||||
const label celli = cells[k];
|
|
||||||
const point& Cf1 = cellC[celli];
|
|
||||||
const scalar delta = mag(Cf1 - Cf0);
|
|
||||||
kappaInt += kappa()[celli]*delta;
|
|
||||||
qr_[celli] = qr0*exp(-kappaInt);
|
|
||||||
Cf0 = Cf1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void reactingOneDim::updatePhiGas()
|
|
||||||
{
|
|
||||||
phiHsGas_ == dimensionedScalar(phiHsGas_.dimensions(), 0);
|
|
||||||
phiGas_ == dimensionedScalar(phiGas_.dimensions(), 0);
|
|
||||||
|
|
||||||
const speciesTable& gasTable = solidChemistry_->gasTable();
|
|
||||||
|
|
||||||
forAll(gasTable, gasI)
|
|
||||||
{
|
|
||||||
tmp<volScalarField> tHsiGas =
|
|
||||||
solidChemistry_->gasHs(solidThermo_->p(), solidThermo_->T(), gasI);
|
|
||||||
|
|
||||||
const volScalarField& HsiGas = tHsiGas();
|
|
||||||
|
|
||||||
const volScalarField::Internal& RRiGas =
|
|
||||||
solidChemistry_->RRg(gasI);
|
|
||||||
|
|
||||||
surfaceScalarField::Boundary& phiGasBf =
|
|
||||||
phiGas_.boundaryFieldRef();
|
|
||||||
|
|
||||||
label totalFaceId = 0;
|
|
||||||
forAll(intCoupledPatchIDs_, i)
|
|
||||||
{
|
|
||||||
const label patchi = intCoupledPatchIDs_[i];
|
|
||||||
|
|
||||||
scalarField& phiGasp = phiGasBf[patchi];
|
|
||||||
const scalarField& cellVol = regionMesh().V();
|
|
||||||
|
|
||||||
forAll(phiGasp, facei)
|
|
||||||
{
|
|
||||||
const labelList& cells = boundaryFaceCells_[totalFaceId++];
|
|
||||||
scalar massInt = 0.0;
|
|
||||||
forAllReverse(cells, k)
|
|
||||||
{
|
|
||||||
const label celli = cells[k];
|
|
||||||
massInt += RRiGas[celli]*cellVol[celli];
|
|
||||||
phiHsGas_[celli] += massInt*HsiGas[celli];
|
|
||||||
}
|
|
||||||
|
|
||||||
phiGasp[facei] += massInt;
|
|
||||||
|
|
||||||
if (debug)
|
|
||||||
{
|
|
||||||
Info<< " Gas : " << gasTable[gasI]
|
|
||||||
<< " on patch : " << patchi
|
|
||||||
<< " mass produced at face(local) : "
|
|
||||||
<< facei
|
|
||||||
<< " is : " << massInt
|
|
||||||
<< " [kg/s] " << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void reactingOneDim::updateFields()
|
|
||||||
{
|
|
||||||
if (qrHSource_)
|
|
||||||
{
|
|
||||||
updateqr();
|
|
||||||
}
|
|
||||||
|
|
||||||
updatePhiGas();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void reactingOneDim::updateMesh(const scalarField& mass0)
|
|
||||||
{
|
|
||||||
if (!moveMesh_)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const scalarField newV(mass0/rho_);
|
|
||||||
|
|
||||||
Info<< "Initial/final volumes = " << gSum(regionMesh().V()) << ", "
|
|
||||||
<< gSum(newV) << " [m^3]" << endl;
|
|
||||||
|
|
||||||
// move the mesh
|
|
||||||
const labelList moveMap = moveMesh(regionMesh().V() - newV, minimumDelta_);
|
|
||||||
|
|
||||||
// flag any cells that have not moved as non-reacting
|
|
||||||
forAll(moveMap, i)
|
|
||||||
{
|
|
||||||
if (moveMap[i] == 0)
|
|
||||||
{
|
|
||||||
solidChemistry_->setCellReacting(i, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void reactingOneDim::solveContinuity()
|
|
||||||
{
|
|
||||||
if (debug)
|
|
||||||
{
|
|
||||||
InfoInFunction << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
const scalarField mass0 = rho_*regionMesh().V();
|
|
||||||
|
|
||||||
fvScalarMatrix rhoEqn
|
|
||||||
(
|
|
||||||
fvm::ddt(rho_) == -solidChemistry_->RRg()
|
|
||||||
);
|
|
||||||
|
|
||||||
if (regionMesh().moving())
|
|
||||||
{
|
|
||||||
surfaceScalarField phiRhoMesh
|
|
||||||
(
|
|
||||||
fvc::interpolate(rho_)*regionMesh().phi()
|
|
||||||
);
|
|
||||||
|
|
||||||
rhoEqn += fvc::div(phiRhoMesh);
|
|
||||||
}
|
|
||||||
|
|
||||||
rhoEqn.solve();
|
|
||||||
|
|
||||||
updateMesh(mass0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void reactingOneDim::solveSpeciesMass()
|
|
||||||
{
|
|
||||||
if (debug)
|
|
||||||
{
|
|
||||||
InfoInFunction << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
volScalarField Yt(0.0*Ys_[0]);
|
|
||||||
|
|
||||||
for (label i=0; i<Ys_.size()-1; i++)
|
|
||||||
{
|
|
||||||
volScalarField& Yi = Ys_[i];
|
|
||||||
|
|
||||||
fvScalarMatrix YiEqn
|
|
||||||
(
|
|
||||||
fvm::ddt(rho_, Yi) == solidChemistry_->RRs(i)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (regionMesh().moving())
|
|
||||||
{
|
|
||||||
surfaceScalarField phiYiRhoMesh
|
|
||||||
(
|
|
||||||
fvc::interpolate(Yi*rho_)*regionMesh().phi()
|
|
||||||
);
|
|
||||||
|
|
||||||
YiEqn += fvc::div(phiYiRhoMesh);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
YiEqn.solve("Yi");
|
|
||||||
Yi.max(0.0);
|
|
||||||
Yt += Yi;
|
|
||||||
}
|
|
||||||
|
|
||||||
Ys_[Ys_.size() - 1] = 1.0 - Yt;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void reactingOneDim::solveEnergy()
|
|
||||||
{
|
|
||||||
if (debug)
|
|
||||||
{
|
|
||||||
InfoInFunction << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
tmp<volScalarField> alpha(solidThermo_->alpha());
|
|
||||||
|
|
||||||
fvScalarMatrix hEqn
|
|
||||||
(
|
|
||||||
fvm::ddt(rho_, h_)
|
|
||||||
- fvm::laplacian(alpha, h_)
|
|
||||||
+ fvc::laplacian(alpha, h_)
|
|
||||||
- fvc::laplacian(kappa(), T())
|
|
||||||
==
|
|
||||||
chemistryQdot_
|
|
||||||
- fvm::Sp(solidChemistry_->RRg(), h_)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (gasHSource_)
|
|
||||||
{
|
|
||||||
const surfaceScalarField phiGas(fvc::interpolate(phiHsGas_));
|
|
||||||
hEqn += fvc::div(phiGas);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (qrHSource_)
|
|
||||||
{
|
|
||||||
const surfaceScalarField phiqr(fvc::interpolate(qr_)*nMagSf());
|
|
||||||
hEqn += fvc::div(phiqr);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (regionMesh().moving())
|
|
||||||
{
|
|
||||||
surfaceScalarField phihMesh
|
|
||||||
(
|
|
||||||
fvc::interpolate(rho_*h_)*regionMesh().phi()
|
|
||||||
);
|
|
||||||
|
|
||||||
hEqn += fvc::div(phihMesh);
|
|
||||||
}
|
|
||||||
|
|
||||||
hEqn.relax();
|
|
||||||
hEqn.solve();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void reactingOneDim::calculateMassTransfer()
|
|
||||||
{
|
|
||||||
totalGasMassFlux_ = 0;
|
|
||||||
forAll(intCoupledPatchIDs_, i)
|
|
||||||
{
|
|
||||||
const label patchi = intCoupledPatchIDs_[i];
|
|
||||||
totalGasMassFlux_ += gSum(phiGas_.boundaryField()[patchi]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (infoOutput_)
|
|
||||||
{
|
|
||||||
totalHeatRR_ = fvc::domainIntegrate(chemistryQdot_);
|
|
||||||
|
|
||||||
addedGasMass_ +=
|
|
||||||
fvc::domainIntegrate(solidChemistry_->RRg())*time_.deltaT();
|
|
||||||
lostSolidMass_ +=
|
|
||||||
fvc::domainIntegrate(solidChemistry_->RRs())*time_.deltaT();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
reactingOneDim::reactingOneDim
|
|
||||||
(
|
|
||||||
const word& modelType,
|
|
||||||
const fvMesh& mesh,
|
|
||||||
const word& regionType
|
|
||||||
)
|
|
||||||
:
|
|
||||||
pyrolysisModel(modelType, mesh, regionType),
|
|
||||||
solidThermo_(solidReactionThermo::New(regionMesh())),
|
|
||||||
solidChemistry_(basicSolidChemistryModel::New(solidThermo_())),
|
|
||||||
radiation_(radiationModel::New(solidThermo_->T())),
|
|
||||||
rho_
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"rho",
|
|
||||||
regionMesh().time().timeName(),
|
|
||||||
regionMesh(),
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
solidThermo_->rho()
|
|
||||||
),
|
|
||||||
Ys_(solidThermo_->composition().Y()),
|
|
||||||
h_(solidThermo_->he()),
|
|
||||||
nNonOrthCorr_(-1),
|
|
||||||
maxDiff_(10),
|
|
||||||
minimumDelta_(1e-4),
|
|
||||||
|
|
||||||
phiGas_
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"phiGas",
|
|
||||||
time().timeName(),
|
|
||||||
regionMesh(),
|
|
||||||
IOobject::READ_IF_PRESENT,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
regionMesh(),
|
|
||||||
dimensionedScalar(dimMass/dimTime, 0)
|
|
||||||
),
|
|
||||||
|
|
||||||
phiHsGas_
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"phiHsGas",
|
|
||||||
time().timeName(),
|
|
||||||
regionMesh(),
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
regionMesh(),
|
|
||||||
dimensionedScalar(dimEnergy/dimTime, 0)
|
|
||||||
),
|
|
||||||
|
|
||||||
chemistryQdot_
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"chemistryQdot",
|
|
||||||
time().timeName(),
|
|
||||||
regionMesh(),
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
regionMesh(),
|
|
||||||
dimensionedScalar(dimEnergy/dimTime/dimVolume, 0)
|
|
||||||
),
|
|
||||||
|
|
||||||
qr_
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"qr",
|
|
||||||
time().timeName(),
|
|
||||||
regionMesh(),
|
|
||||||
IOobject::MUST_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
regionMesh()
|
|
||||||
),
|
|
||||||
|
|
||||||
lostSolidMass_(dimensionedScalar(dimMass, 0)),
|
|
||||||
addedGasMass_(dimensionedScalar(dimMass, 0)),
|
|
||||||
totalGasMassFlux_(0.0),
|
|
||||||
totalHeatRR_(dimensionedScalar(dimEnergy/dimTime, 0)),
|
|
||||||
gasHSource_(false),
|
|
||||||
qrHSource_(false),
|
|
||||||
useChemistrySolvers_(true)
|
|
||||||
{
|
|
||||||
if (active_)
|
|
||||||
{
|
|
||||||
read();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
reactingOneDim::reactingOneDim
|
|
||||||
(
|
|
||||||
const word& modelType,
|
|
||||||
const fvMesh& mesh,
|
|
||||||
const dictionary& dict,
|
|
||||||
const word& regionType
|
|
||||||
)
|
|
||||||
:
|
|
||||||
pyrolysisModel(modelType, mesh, dict, regionType),
|
|
||||||
solidThermo_(solidReactionThermo::New(regionMesh())),
|
|
||||||
solidChemistry_(basicSolidChemistryModel::New(solidThermo_())),
|
|
||||||
radiation_(radiationModel::New(solidThermo_->T())),
|
|
||||||
rho_
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"rho",
|
|
||||||
regionMesh().time().timeName(),
|
|
||||||
regionMesh(),
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
solidThermo_->rho()
|
|
||||||
),
|
|
||||||
Ys_(solidThermo_->composition().Y()),
|
|
||||||
h_(solidThermo_->he()),
|
|
||||||
nNonOrthCorr_(-1),
|
|
||||||
maxDiff_(10),
|
|
||||||
minimumDelta_(1e-4),
|
|
||||||
|
|
||||||
phiGas_
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"phiGas",
|
|
||||||
time().timeName(),
|
|
||||||
regionMesh(),
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
regionMesh(),
|
|
||||||
dimensionedScalar(dimMass/dimTime, 0)
|
|
||||||
),
|
|
||||||
|
|
||||||
phiHsGas_
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"phiHsGas",
|
|
||||||
time().timeName(),
|
|
||||||
regionMesh(),
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
regionMesh(),
|
|
||||||
dimensionedScalar(dimEnergy/dimTime, 0)
|
|
||||||
),
|
|
||||||
|
|
||||||
chemistryQdot_
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"chemistryQdot",
|
|
||||||
time().timeName(),
|
|
||||||
regionMesh(),
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
regionMesh(),
|
|
||||||
dimensionedScalar(dimEnergy/dimTime/dimVolume, 0)
|
|
||||||
),
|
|
||||||
|
|
||||||
qr_
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"qr",
|
|
||||||
time().timeName(),
|
|
||||||
regionMesh(),
|
|
||||||
IOobject::MUST_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
regionMesh()
|
|
||||||
),
|
|
||||||
|
|
||||||
lostSolidMass_(dimensionedScalar(dimMass, 0)),
|
|
||||||
addedGasMass_(dimensionedScalar(dimMass, 0)),
|
|
||||||
totalGasMassFlux_(0.0),
|
|
||||||
totalHeatRR_(dimensionedScalar(dimEnergy/dimTime, 0)),
|
|
||||||
gasHSource_(false),
|
|
||||||
qrHSource_(false),
|
|
||||||
useChemistrySolvers_(true)
|
|
||||||
{
|
|
||||||
if (active_)
|
|
||||||
{
|
|
||||||
read(dict);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
reactingOneDim::~reactingOneDim()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
scalar reactingOneDim::addMassSources(const label patchi, const label facei)
|
|
||||||
{
|
|
||||||
label index = 0;
|
|
||||||
forAll(primaryPatchIDs_, i)
|
|
||||||
{
|
|
||||||
if (primaryPatchIDs_[i] == patchi)
|
|
||||||
{
|
|
||||||
index = i;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const label localPatchId = intCoupledPatchIDs_[index];
|
|
||||||
|
|
||||||
const scalar massAdded = phiGas_.boundaryField()[localPatchId][facei];
|
|
||||||
|
|
||||||
if (debug)
|
|
||||||
{
|
|
||||||
Info<< "\nPyrolysis region: " << type() << "added mass : "
|
|
||||||
<< massAdded << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
return massAdded;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
scalar reactingOneDim::solidRegionDiffNo() const
|
|
||||||
{
|
|
||||||
scalar DiNum = -great;
|
|
||||||
|
|
||||||
if (regionMesh().nInternalFaces() > 0)
|
|
||||||
{
|
|
||||||
surfaceScalarField KrhoCpbyDelta
|
|
||||||
(
|
|
||||||
sqr(regionMesh().surfaceInterpolation::deltaCoeffs())
|
|
||||||
*fvc::interpolate(kappa())
|
|
||||||
/fvc::interpolate(Cp()*rho_)
|
|
||||||
);
|
|
||||||
|
|
||||||
DiNum = max(KrhoCpbyDelta.primitiveField())*time().deltaTValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
return DiNum;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
scalar reactingOneDim::maxDiff() const
|
|
||||||
{
|
|
||||||
return maxDiff_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const volScalarField& reactingOneDim::rho() const
|
|
||||||
{
|
|
||||||
return rho_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const volScalarField& reactingOneDim::T() const
|
|
||||||
{
|
|
||||||
return solidThermo_->T();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const tmp<volScalarField> reactingOneDim::Cp() const
|
|
||||||
{
|
|
||||||
return solidThermo_->Cp();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
tmp<volScalarField> reactingOneDim::kappaRad() const
|
|
||||||
{
|
|
||||||
return radiation_->absorptionEmission().a();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
tmp<volScalarField> reactingOneDim::kappa() const
|
|
||||||
{
|
|
||||||
return solidThermo_->kappa();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const surfaceScalarField& reactingOneDim::phiGas() const
|
|
||||||
{
|
|
||||||
return phiGas_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void reactingOneDim::preEvolveRegion()
|
|
||||||
{
|
|
||||||
pyrolysisModel::preEvolveRegion();
|
|
||||||
|
|
||||||
// Initialise all cells as able to react
|
|
||||||
forAll(h_, celli)
|
|
||||||
{
|
|
||||||
solidChemistry_->setCellReacting(celli, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void reactingOneDim::evolveRegion()
|
|
||||||
{
|
|
||||||
Info<< "\nEvolving pyrolysis in region: " << regionMesh().name() << endl;
|
|
||||||
|
|
||||||
if (useChemistrySolvers_)
|
|
||||||
{
|
|
||||||
solidChemistry_->solve(time().deltaTValue());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
solidChemistry_->calculate();
|
|
||||||
}
|
|
||||||
|
|
||||||
solveContinuity();
|
|
||||||
|
|
||||||
chemistryQdot_ = solidChemistry_->Qdot()();
|
|
||||||
|
|
||||||
updateFields();
|
|
||||||
|
|
||||||
solveSpeciesMass();
|
|
||||||
|
|
||||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr_; nonOrth++)
|
|
||||||
{
|
|
||||||
solveEnergy();
|
|
||||||
}
|
|
||||||
|
|
||||||
calculateMassTransfer();
|
|
||||||
|
|
||||||
solidThermo_->correct();
|
|
||||||
|
|
||||||
Info<< "pyrolysis min/max(T) = "
|
|
||||||
<< gMin(solidThermo_->T().primitiveField())
|
|
||||||
<< ", "
|
|
||||||
<< gMax(solidThermo_->T().primitiveField())
|
|
||||||
<< endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void reactingOneDim::info()
|
|
||||||
{
|
|
||||||
Info<< "\nPyrolysis in region: " << regionMesh().name() << endl;
|
|
||||||
|
|
||||||
Info<< indent << "Total gas mass produced [kg] = "
|
|
||||||
<< addedGasMass_.value() << nl
|
|
||||||
<< indent << "Total solid mass lost [kg] = "
|
|
||||||
<< lostSolidMass_.value() << nl
|
|
||||||
<< indent << "Total pyrolysis gases [kg/s] = "
|
|
||||||
<< totalGasMassFlux_ << nl
|
|
||||||
<< indent << "Total heat release rate [J/s] = "
|
|
||||||
<< totalHeatRR_.value() << nl;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
} // End namespace regionModels
|
|
||||||
} // End namespace pyrolysisModels
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,305 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2019 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/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::regionModels::pyrolysisModels::reactingOneDim
|
|
||||||
|
|
||||||
Description
|
|
||||||
Reacting, 1-D pyrolysis model
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
reactingOneDim.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef reactingOneDim_H
|
|
||||||
#define reactingOneDim_H
|
|
||||||
|
|
||||||
#include "pyrolysisModel.H"
|
|
||||||
#include "basicSolidChemistryModel.H"
|
|
||||||
#include "radiationModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace regionModels
|
|
||||||
{
|
|
||||||
namespace pyrolysisModels
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class reactingOneDim Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class reactingOneDim
|
|
||||||
:
|
|
||||||
public pyrolysisModel
|
|
||||||
{
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- Read model controls
|
|
||||||
void readReactingOneDimControls();
|
|
||||||
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
// Protected data
|
|
||||||
|
|
||||||
//- Reference to solid thermo
|
|
||||||
autoPtr<solidReactionThermo> solidThermo_;
|
|
||||||
|
|
||||||
//- Reference to the solid chemistry model
|
|
||||||
autoPtr<basicSolidChemistryModel> solidChemistry_;
|
|
||||||
|
|
||||||
//- Pointer to radiation model
|
|
||||||
autoPtr<radiationModel> radiation_;
|
|
||||||
|
|
||||||
|
|
||||||
// Reference to solid thermo properties
|
|
||||||
|
|
||||||
//- Density [kg/m^3]
|
|
||||||
volScalarField rho_;
|
|
||||||
|
|
||||||
//- List of solid components
|
|
||||||
PtrList<volScalarField>& Ys_;
|
|
||||||
|
|
||||||
// Non-const access to enthalpy
|
|
||||||
volScalarField& h_;
|
|
||||||
|
|
||||||
|
|
||||||
// Solution parameters
|
|
||||||
|
|
||||||
//- Number of non-orthogonal correctors
|
|
||||||
label nNonOrthCorr_;
|
|
||||||
|
|
||||||
//- Maximum diffussivity
|
|
||||||
scalar maxDiff_;
|
|
||||||
|
|
||||||
//- Minimum delta for combustion
|
|
||||||
scalar minimumDelta_;
|
|
||||||
|
|
||||||
|
|
||||||
// Fields
|
|
||||||
|
|
||||||
//- Total gas mass flux to the primary region [kg/m^2/s]
|
|
||||||
surfaceScalarField phiGas_;
|
|
||||||
|
|
||||||
//- Sensible enthalpy gas flux [J/m2/s]
|
|
||||||
volScalarField phiHsGas_;
|
|
||||||
|
|
||||||
//- Heat release rate [J/s/m^3]
|
|
||||||
volScalarField chemistryQdot_;
|
|
||||||
|
|
||||||
|
|
||||||
// Source term fields
|
|
||||||
|
|
||||||
//- Coupled region radiative heat flux [W/m^2]
|
|
||||||
// Requires user to input mapping info for coupled patches
|
|
||||||
// volScalarField qrCoupled_;
|
|
||||||
|
|
||||||
//- In depth radiative heat flux [W/m^2]
|
|
||||||
volScalarField qr_;
|
|
||||||
|
|
||||||
|
|
||||||
// Checks
|
|
||||||
|
|
||||||
//- Cumulative lost mass of the condensed phase [kg]
|
|
||||||
dimensionedScalar lostSolidMass_;
|
|
||||||
|
|
||||||
//- Cumulative mass generation of the gas phase [kg]
|
|
||||||
dimensionedScalar addedGasMass_;
|
|
||||||
|
|
||||||
//- Total mass gas flux at the pyrolysing walls [kg/s]
|
|
||||||
scalar totalGasMassFlux_;
|
|
||||||
|
|
||||||
//- Total heat release rate [J/s]
|
|
||||||
dimensionedScalar totalHeatRR_;
|
|
||||||
|
|
||||||
|
|
||||||
// Options
|
|
||||||
|
|
||||||
//- Add gas enthalpy source term
|
|
||||||
bool gasHSource_;
|
|
||||||
|
|
||||||
//- Add in depth radiation source term
|
|
||||||
bool qrHSource_;
|
|
||||||
|
|
||||||
//- Use chemistry solvers (ode or sequential)
|
|
||||||
bool useChemistrySolvers_;
|
|
||||||
|
|
||||||
|
|
||||||
// Protected member functions
|
|
||||||
|
|
||||||
//- Read control parameters from dictionary
|
|
||||||
bool read();
|
|
||||||
|
|
||||||
//- Read control parameters from dict
|
|
||||||
bool read(const dictionary& dict);
|
|
||||||
|
|
||||||
//- Update submodels
|
|
||||||
void updateFields();
|
|
||||||
|
|
||||||
//- Update/move mesh based on change in mass
|
|
||||||
void updateMesh(const scalarField& mass0);
|
|
||||||
|
|
||||||
//- Update radiative flux in pyrolysis region
|
|
||||||
void updateqr();
|
|
||||||
|
|
||||||
//- Update enthalpy flux for pyrolysis gases
|
|
||||||
void updatePhiGas();
|
|
||||||
|
|
||||||
//- Mass check
|
|
||||||
void calculateMassTransfer();
|
|
||||||
|
|
||||||
|
|
||||||
// Equations
|
|
||||||
|
|
||||||
//- Solve continuity equation
|
|
||||||
void solveContinuity();
|
|
||||||
|
|
||||||
//- Solve energy
|
|
||||||
void solveEnergy();
|
|
||||||
|
|
||||||
//- Solve solid species mass conservation
|
|
||||||
void solveSpeciesMass();
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("reactingOneDim");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from type name and mesh
|
|
||||||
reactingOneDim
|
|
||||||
(
|
|
||||||
const word& modelType,
|
|
||||||
const fvMesh& mesh,
|
|
||||||
const word& regionType
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct from type name, mesh and dictionary
|
|
||||||
reactingOneDim
|
|
||||||
(
|
|
||||||
const word& modelType,
|
|
||||||
const fvMesh& mesh,
|
|
||||||
const dictionary& dict,
|
|
||||||
const word& regionType
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Disallow default bitwise copy construction
|
|
||||||
reactingOneDim(const reactingOneDim&) = delete;
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~reactingOneDim();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
// Access
|
|
||||||
|
|
||||||
//- Fields
|
|
||||||
|
|
||||||
//- Return const density [Kg/m^3]
|
|
||||||
const volScalarField& rho() const;
|
|
||||||
|
|
||||||
//- Return const temperature [K]
|
|
||||||
virtual const volScalarField& T() const;
|
|
||||||
|
|
||||||
//- Return specific heat capacity [J/kg/K]
|
|
||||||
virtual const tmp<volScalarField> Cp() const;
|
|
||||||
|
|
||||||
//- Return the region absorptivity [1/m]
|
|
||||||
virtual tmp<volScalarField> kappaRad() const;
|
|
||||||
|
|
||||||
//- Return the region thermal conductivity [W/m/k]
|
|
||||||
virtual tmp<volScalarField> kappa() const;
|
|
||||||
|
|
||||||
//- Return the total gas mass flux to primary region [kg/m^2/s]
|
|
||||||
virtual const surfaceScalarField& phiGas() const;
|
|
||||||
|
|
||||||
|
|
||||||
// Solution parameters
|
|
||||||
|
|
||||||
//- Return the number of non-orthogonal correctors
|
|
||||||
inline label nNonOrthCorr() const;
|
|
||||||
|
|
||||||
//- Return max diffusivity allowed in the solid
|
|
||||||
virtual scalar maxDiff() const;
|
|
||||||
|
|
||||||
|
|
||||||
// Helper functions
|
|
||||||
|
|
||||||
//- External hook to add mass to the primary region
|
|
||||||
virtual scalar addMassSources
|
|
||||||
(
|
|
||||||
const label patchi, // patchi on primary region
|
|
||||||
const label facei // facei of patchi
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Mean diffusion number of the solid region
|
|
||||||
virtual scalar solidRegionDiffNo() const;
|
|
||||||
|
|
||||||
|
|
||||||
// Evolution
|
|
||||||
|
|
||||||
//- Pre-evolve region
|
|
||||||
virtual void preEvolveRegion();
|
|
||||||
|
|
||||||
//- Evolve the pyrolysis equations
|
|
||||||
virtual void evolveRegion();
|
|
||||||
|
|
||||||
|
|
||||||
// I-O
|
|
||||||
|
|
||||||
//- Provide some feedback
|
|
||||||
virtual void info();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Operators
|
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
|
||||||
void operator=(const reactingOneDim&) = delete;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace pyrolysisModels
|
|
||||||
} // End namespace regionModels
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#include "reactingOneDimI.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,37 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2018 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/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "reactingOneDim.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
inline Foam::label
|
|
||||||
Foam::regionModels::pyrolysisModels::reactingOneDim::nNonOrthCorr() const
|
|
||||||
{
|
|
||||||
return nNonOrthCorr_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,5 +0,0 @@
|
|||||||
derivedFvPatchFields/filmPyrolysisVelocityCoupled/filmPyrolysisVelocityCoupledFvPatchVectorField.C
|
|
||||||
derivedFvPatchFields/filmPyrolysisTemperatureCoupled/filmPyrolysisTemperatureCoupledFvPatchScalarField.C
|
|
||||||
derivedFvPatchFields/filmPyrolysisRadiativeCoupledMixed/filmPyrolysisRadiativeCoupledMixedFvPatchScalarField.C
|
|
||||||
|
|
||||||
LIB = $(FOAM_LIBBIN)/libregionCoupling
|
|
||||||
@ -1,30 +0,0 @@
|
|||||||
EXE_INC = \
|
|
||||||
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude\
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/solidChemistryModel/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/solidSpecie/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
|
||||||
-I$(LIB_SRC)/radiationModels/lnInclude \
|
|
||||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
|
||||||
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
|
|
||||||
-I$(LIB_SRC)/regionModels/pyrolysisModels/lnInclude \
|
|
||||||
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
|
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
|
||||||
-I$(LIB_SRC)/meshTools/lnInclude
|
|
||||||
|
|
||||||
LIB_LIBS = \
|
|
||||||
-lregionModels \
|
|
||||||
-lpyrolysisModels \
|
|
||||||
-lsurfaceFilmModels \
|
|
||||||
-lsolidChemistryModel \
|
|
||||||
-lreactionThermophysicalModels \
|
|
||||||
-lSLGThermo \
|
|
||||||
-lturbulenceModels \
|
|
||||||
-lcompressibleTurbulenceModels \
|
|
||||||
-lfiniteVolume \
|
|
||||||
-lmeshTools
|
|
||||||
@ -1,424 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2013-2019 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/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "filmPyrolysisRadiativeCoupledMixedFvPatchScalarField.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
#include "mappedPatchBase.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
|
||||||
|
|
||||||
const filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::filmModelType&
|
|
||||||
filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::
|
|
||||||
filmModel() const
|
|
||||||
{
|
|
||||||
HashTable<const filmModelType*> models
|
|
||||||
= db().time().lookupClass<filmModelType>();
|
|
||||||
|
|
||||||
forAllConstIter(HashTable<const filmModelType*>, models, iter)
|
|
||||||
{
|
|
||||||
if (iter()->regionMesh().name() == filmRegionName_)
|
|
||||||
{
|
|
||||||
return *iter();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DynamicList<word> modelNames;
|
|
||||||
forAllConstIter(HashTable<const filmModelType*>, models, iter)
|
|
||||||
{
|
|
||||||
modelNames.append(iter()->regionMesh().name());
|
|
||||||
}
|
|
||||||
|
|
||||||
FatalErrorInFunction
|
|
||||||
<< "Unable to locate film region " << filmRegionName_
|
|
||||||
<< ". Available regions include: " << modelNames
|
|
||||||
<< abort(FatalError);
|
|
||||||
|
|
||||||
return **models.begin();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::
|
|
||||||
pyrolysisModelType&
|
|
||||||
filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::
|
|
||||||
pyrModel() const
|
|
||||||
{
|
|
||||||
HashTable<const pyrolysisModelType*> models =
|
|
||||||
db().time().lookupClass<pyrolysisModelType>();
|
|
||||||
|
|
||||||
forAllConstIter(HashTable<const pyrolysisModelType*>, models, iter)
|
|
||||||
{
|
|
||||||
if (iter()->regionMesh().name() == pyrolysisRegionName_)
|
|
||||||
{
|
|
||||||
return *iter();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DynamicList<word> modelNames;
|
|
||||||
forAllConstIter(HashTable<const pyrolysisModelType*>, models, iter)
|
|
||||||
{
|
|
||||||
modelNames.append(iter()->regionMesh().name());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
FatalErrorInFunction
|
|
||||||
<< "Unable to locate pyrolysis region " << pyrolysisRegionName_
|
|
||||||
<< ". Available regions include: " << modelNames
|
|
||||||
<< abort(FatalError);
|
|
||||||
|
|
||||||
return **models.begin();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::
|
|
||||||
filmPyrolysisRadiativeCoupledMixedFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF
|
|
||||||
)
|
|
||||||
:
|
|
||||||
mixedFvPatchScalarField(p, iF),
|
|
||||||
temperatureCoupledBase(patch()),
|
|
||||||
filmRegionName_("surfaceFilmProperties"),
|
|
||||||
pyrolysisRegionName_("pyrolysisProperties"),
|
|
||||||
TnbrName_("undefined-Tnbr"),
|
|
||||||
qrName_("undefined-qr"),
|
|
||||||
convectiveScaling_(1.0),
|
|
||||||
filmDeltaDry_(0.0),
|
|
||||||
filmDeltaWet_(0.0)
|
|
||||||
{
|
|
||||||
this->refValue() = 0.0;
|
|
||||||
this->refGrad() = 0.0;
|
|
||||||
this->valueFraction() = 1.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::
|
|
||||||
filmPyrolysisRadiativeCoupledMixedFvPatchScalarField
|
|
||||||
(
|
|
||||||
const filmPyrolysisRadiativeCoupledMixedFvPatchScalarField& psf,
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF,
|
|
||||||
const fvPatchFieldMapper& mapper
|
|
||||||
)
|
|
||||||
:
|
|
||||||
mixedFvPatchScalarField(psf, p, iF, mapper),
|
|
||||||
temperatureCoupledBase(patch(), psf),
|
|
||||||
filmRegionName_(psf.filmRegionName_),
|
|
||||||
pyrolysisRegionName_(psf.pyrolysisRegionName_),
|
|
||||||
TnbrName_(psf.TnbrName_),
|
|
||||||
qrName_(psf.qrName_),
|
|
||||||
convectiveScaling_(psf.convectiveScaling_),
|
|
||||||
filmDeltaDry_(psf.filmDeltaDry_),
|
|
||||||
filmDeltaWet_(psf.filmDeltaWet_)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::
|
|
||||||
filmPyrolysisRadiativeCoupledMixedFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF,
|
|
||||||
const dictionary& dict
|
|
||||||
)
|
|
||||||
:
|
|
||||||
mixedFvPatchScalarField(p, iF),
|
|
||||||
temperatureCoupledBase(patch(), dict),
|
|
||||||
filmRegionName_
|
|
||||||
(
|
|
||||||
dict.lookupOrDefault<word>("filmRegion", "surfaceFilmProperties")
|
|
||||||
),
|
|
||||||
pyrolysisRegionName_
|
|
||||||
(
|
|
||||||
dict.lookupOrDefault<word>("pyrolysisRegion", "pyrolysisProperties")
|
|
||||||
),
|
|
||||||
TnbrName_(dict.lookup("Tnbr")),
|
|
||||||
qrName_(dict.lookup("qr")),
|
|
||||||
convectiveScaling_(dict.lookupOrDefault<scalar>("convectiveScaling", 1.0)),
|
|
||||||
filmDeltaDry_(readScalar(dict.lookup("filmDeltaDry"))),
|
|
||||||
filmDeltaWet_(readScalar(dict.lookup("filmDeltaWet")))
|
|
||||||
{
|
|
||||||
if (!isA<mappedPatchBase>(this->patch().patch()))
|
|
||||||
{
|
|
||||||
FatalErrorInFunction
|
|
||||||
<< "' not type '" << mappedPatchBase::typeName << "'"
|
|
||||||
<< "\n for patch " << p.name()
|
|
||||||
<< " of field " << internalField().name()
|
|
||||||
<< " in file " << internalField().objectPath()
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
fvPatchScalarField::operator=(scalarField("value", dict, p.size()));
|
|
||||||
|
|
||||||
if (dict.found("refValue"))
|
|
||||||
{
|
|
||||||
// Full restart
|
|
||||||
refValue() = scalarField("refValue", dict, p.size());
|
|
||||||
refGrad() = scalarField("refGradient", dict, p.size());
|
|
||||||
valueFraction() = scalarField("valueFraction", dict, p.size());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Start from user entered data. Assume fixedValue.
|
|
||||||
refValue() = *this;
|
|
||||||
refGrad() = 0.0;
|
|
||||||
valueFraction() = 1.0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::
|
|
||||||
filmPyrolysisRadiativeCoupledMixedFvPatchScalarField
|
|
||||||
(
|
|
||||||
const filmPyrolysisRadiativeCoupledMixedFvPatchScalarField& psf,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF
|
|
||||||
)
|
|
||||||
:
|
|
||||||
mixedFvPatchScalarField(psf, iF),
|
|
||||||
temperatureCoupledBase(patch(), psf),
|
|
||||||
filmRegionName_(psf.filmRegionName_),
|
|
||||||
pyrolysisRegionName_(psf.pyrolysisRegionName_),
|
|
||||||
TnbrName_(psf.TnbrName_),
|
|
||||||
qrName_(psf.qrName_),
|
|
||||||
convectiveScaling_(psf.convectiveScaling_),
|
|
||||||
filmDeltaDry_(psf.filmDeltaDry_),
|
|
||||||
filmDeltaWet_(psf.filmDeltaWet_)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::updateCoeffs()
|
|
||||||
{
|
|
||||||
if (updated())
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get the coupling information from the mappedPatchBase
|
|
||||||
const mappedPatchBase& mpp =
|
|
||||||
refCast<const mappedPatchBase>(patch().patch());
|
|
||||||
|
|
||||||
const label patchi = patch().index();
|
|
||||||
const label nbrPatchi = mpp.samplePolyPatch().index();
|
|
||||||
const polyMesh& mesh = patch().boundaryMesh().mesh();
|
|
||||||
const polyMesh& nbrMesh = mpp.sampleMesh();
|
|
||||||
const fvPatch& nbrPatch =
|
|
||||||
refCast<const fvMesh>(nbrMesh).boundary()[nbrPatchi];
|
|
||||||
|
|
||||||
scalarField intFld(patchInternalField());
|
|
||||||
|
|
||||||
const filmPyrolysisRadiativeCoupledMixedFvPatchScalarField&
|
|
||||||
nbrField =
|
|
||||||
refCast
|
|
||||||
<
|
|
||||||
const filmPyrolysisRadiativeCoupledMixedFvPatchScalarField
|
|
||||||
>
|
|
||||||
(
|
|
||||||
nbrPatch.lookupPatchField<volScalarField, scalar>(TnbrName_)
|
|
||||||
);
|
|
||||||
|
|
||||||
// Swap to obtain full local values of neighbour internal field
|
|
||||||
scalarField nbrIntFld(nbrField.patchInternalField());
|
|
||||||
mpp.distribute(nbrIntFld);
|
|
||||||
|
|
||||||
scalarField& Tp = *this;
|
|
||||||
|
|
||||||
const scalarField K(this->kappa(*this));
|
|
||||||
const scalarField nbrK(nbrField.kappa(*this));
|
|
||||||
|
|
||||||
// Swap to obtain full local values of neighbour K*delta
|
|
||||||
scalarField KDeltaNbr(nbrK*nbrPatch.deltaCoeffs());
|
|
||||||
mpp.distribute(KDeltaNbr);
|
|
||||||
|
|
||||||
scalarField myKDelta(K*patch().deltaCoeffs());
|
|
||||||
|
|
||||||
scalarList Tfilm(patch().size(), 0.0);
|
|
||||||
scalarList htcwfilm(patch().size(), 0.0);
|
|
||||||
scalarList filmDelta(patch().size(), 0.0);
|
|
||||||
|
|
||||||
const pyrolysisModelType& pyrolysis = pyrModel();
|
|
||||||
const filmModelType& film = filmModel();
|
|
||||||
|
|
||||||
// Obtain Rad heat (qr)
|
|
||||||
scalarField qr(patch().size(), 0.0);
|
|
||||||
|
|
||||||
label coupledPatchi = -1;
|
|
||||||
if (pyrolysisRegionName_ == mesh.name())
|
|
||||||
{
|
|
||||||
coupledPatchi = patchi;
|
|
||||||
if (qrName_ != "none")
|
|
||||||
{
|
|
||||||
qr = nbrPatch.lookupPatchField<volScalarField, scalar>(qrName_);
|
|
||||||
mpp.distribute(qr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (pyrolysis.primaryMesh().name() == mesh.name())
|
|
||||||
{
|
|
||||||
coupledPatchi = nbrPatch.index();
|
|
||||||
if (qrName_ != "none")
|
|
||||||
{
|
|
||||||
qr = patch().lookupPatchField<volScalarField, scalar>(qrName_);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
FatalErrorInFunction
|
|
||||||
<< type() << " condition is intended to be applied to either the "
|
|
||||||
<< "primary or pyrolysis regions only"
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
const label filmPatchi = pyrolysis.nbrCoupledPatchID(film, coupledPatchi);
|
|
||||||
|
|
||||||
const scalarField htcw(film.htcw().h()().boundaryField()[filmPatchi]);
|
|
||||||
|
|
||||||
// Obtain htcw
|
|
||||||
htcwfilm =
|
|
||||||
pyrolysis.mapRegionPatchField
|
|
||||||
(
|
|
||||||
film,
|
|
||||||
coupledPatchi,
|
|
||||||
filmPatchi,
|
|
||||||
htcw,
|
|
||||||
true
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// Obtain Tfilm at the boundary through Ts.
|
|
||||||
// NOTE: Tf is not good as at the boundary it will retrieve Tp
|
|
||||||
Tfilm = film.Ts().boundaryField()[filmPatchi];
|
|
||||||
film.toPrimary(filmPatchi, Tfilm);
|
|
||||||
|
|
||||||
// Obtain delta
|
|
||||||
filmDelta =
|
|
||||||
pyrolysis.mapRegionPatchField<scalar>
|
|
||||||
(
|
|
||||||
film,
|
|
||||||
"deltaf",
|
|
||||||
coupledPatchi,
|
|
||||||
true
|
|
||||||
);
|
|
||||||
|
|
||||||
// Estimate wetness of the film (1: wet , 0: dry)
|
|
||||||
scalarField ratio
|
|
||||||
(
|
|
||||||
min
|
|
||||||
(
|
|
||||||
max
|
|
||||||
(
|
|
||||||
(filmDelta - filmDeltaDry_)/(filmDeltaWet_ - filmDeltaDry_),
|
|
||||||
scalar(0)
|
|
||||||
),
|
|
||||||
scalar(1)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
scalarField qConv(ratio*htcwfilm*(Tfilm - Tp)*convectiveScaling_);
|
|
||||||
|
|
||||||
scalarField qRad((1.0 - ratio)*qr);
|
|
||||||
|
|
||||||
scalarField alpha(KDeltaNbr - (qRad + qConv)/Tp);
|
|
||||||
|
|
||||||
valueFraction() = alpha/(alpha + (1.0 - ratio)*myKDelta);
|
|
||||||
|
|
||||||
refValue() = ratio*Tfilm + (1.0 - ratio)*(KDeltaNbr*nbrIntFld)/alpha;
|
|
||||||
|
|
||||||
mixedFvPatchScalarField::updateCoeffs();
|
|
||||||
|
|
||||||
if (debug)
|
|
||||||
{
|
|
||||||
scalar Qc = gSum(qConv*patch().magSf());
|
|
||||||
scalar qr = gSum(qRad*patch().magSf());
|
|
||||||
scalar Qt = gSum((qConv + qRad)*patch().magSf());
|
|
||||||
|
|
||||||
Info<< mesh.name() << ':'
|
|
||||||
<< patch().name() << ':'
|
|
||||||
<< this->internalField().name() << " <- "
|
|
||||||
<< nbrMesh.name() << ':'
|
|
||||||
<< nbrPatch.name() << ':'
|
|
||||||
<< this->internalField().name() << " :" << nl
|
|
||||||
<< " convective heat[W] : " << Qc << nl
|
|
||||||
<< " radiative heat [W] : " << qr << nl
|
|
||||||
<< " total heat [W] : " << Qt << nl
|
|
||||||
<< " wall temperature "
|
|
||||||
<< " min:" << gMin(*this)
|
|
||||||
<< " max:" << gMax(*this)
|
|
||||||
<< " avg:" << gAverage(*this)
|
|
||||||
<< endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::write
|
|
||||||
(
|
|
||||||
Ostream& os
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
mixedFvPatchScalarField::write(os);
|
|
||||||
writeEntryIfDifferent<word>
|
|
||||||
(
|
|
||||||
os,
|
|
||||||
"filmRegion",
|
|
||||||
"surfaceFilmProperties",
|
|
||||||
filmRegionName_
|
|
||||||
);
|
|
||||||
writeEntryIfDifferent<word>
|
|
||||||
(
|
|
||||||
os,
|
|
||||||
"pyrolysisRegion",
|
|
||||||
"pyrolysisProperties",
|
|
||||||
pyrolysisRegionName_
|
|
||||||
);
|
|
||||||
writeEntry(os, "Tnbr", TnbrName_);
|
|
||||||
writeEntry(os, "qr", qrName_);
|
|
||||||
writeEntry(os, "convectiveScaling", convectiveScaling_);
|
|
||||||
writeEntry(os, "filmDeltaDry", filmDeltaDry_);
|
|
||||||
writeEntry(os, "filmDeltaWet", filmDeltaWet_);
|
|
||||||
temperatureCoupledBase::write(os);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
makePatchTypeField
|
|
||||||
(
|
|
||||||
fvPatchScalarField,
|
|
||||||
filmPyrolysisRadiativeCoupledMixedFvPatchScalarField
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,237 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2013-2019 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/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::filmPyrolysisRadiativeCoupledMixedFvPatchScalarField
|
|
||||||
|
|
||||||
Description
|
|
||||||
Mixed boundary condition for temperature, to be used in the flow and
|
|
||||||
pyrolysis regions when a film region model is used.
|
|
||||||
|
|
||||||
Example usage:
|
|
||||||
\verbatim
|
|
||||||
myInterfacePatchName
|
|
||||||
{
|
|
||||||
type filmPyrolysisRadiativeCoupledMixed;
|
|
||||||
Tnbr T;
|
|
||||||
kappa fluidThermo;
|
|
||||||
qr qr;
|
|
||||||
kappaName none;
|
|
||||||
filmDeltaDry 0.0;
|
|
||||||
filmDeltaWet 3e-4;
|
|
||||||
value $internalField;
|
|
||||||
}
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
Needs to be on underlying mapped(Wall)FvPatch.
|
|
||||||
It calculates local field as:
|
|
||||||
|
|
||||||
\verbatim
|
|
||||||
ratio = (filmDelta - filmDeltaDry)/(filmDeltaWet - filmDeltaDry)
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
when ratio = 1 is considered wet and the film temperature is fixed at
|
|
||||||
the wall. If ratio = 0 (dry) it emulates the normal radiative solid BC.
|
|
||||||
|
|
||||||
In between ratio 0 and 1 the gradient and value contributions are
|
|
||||||
weighted using the ratio field in the following way:
|
|
||||||
|
|
||||||
\verbatim
|
|
||||||
qConv = ratio*htcwfilm*(Tfilm - *this);
|
|
||||||
qRad = (1.0 - ratio)*qr;
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
Then the solid can gain or loose energy through radiation or conduction
|
|
||||||
towards the film.
|
|
||||||
|
|
||||||
Notes:
|
|
||||||
|
|
||||||
- kappa and \c kappaName are inherited from temperatureCoupledBase.
|
|
||||||
- qr is the radiative flux defined in the radiation model.
|
|
||||||
|
|
||||||
|
|
||||||
See also
|
|
||||||
Foam::temperatureCoupledBase
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
filmPyrolysisRadiativeCoupledMixedFvPatchScalarField.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef filmPyrolysisRadiativeCoupledMixedFvPatchScalarField_H
|
|
||||||
#define filmPyrolysisRadiativeCoupledMixedFvPatchScalarField_H
|
|
||||||
|
|
||||||
#include "mixedFvPatchFields.H"
|
|
||||||
#include "temperatureCoupledBase.H"
|
|
||||||
#include "thermoSingleLayer.H"
|
|
||||||
#include "pyrolysisModel.H"
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class filmPyrolysisRadiativeCoupledMixedFvPatchScalarField Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class filmPyrolysisRadiativeCoupledMixedFvPatchScalarField
|
|
||||||
:
|
|
||||||
public mixedFvPatchScalarField,
|
|
||||||
public temperatureCoupledBase
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
typedef Foam::regionModels::surfaceFilmModels::thermoSingleLayer
|
|
||||||
filmModelType;
|
|
||||||
|
|
||||||
typedef Foam::regionModels::pyrolysisModels::pyrolysisModel
|
|
||||||
pyrolysisModelType;
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
// Private Data
|
|
||||||
|
|
||||||
//- Name of film region
|
|
||||||
const word filmRegionName_;
|
|
||||||
|
|
||||||
//- Name of pyrolysis region
|
|
||||||
const word pyrolysisRegionName_;
|
|
||||||
|
|
||||||
//- Name of field on the neighbour region
|
|
||||||
const word TnbrName_;
|
|
||||||
|
|
||||||
//- Name of the radiative heat flux
|
|
||||||
const word qrName_;
|
|
||||||
|
|
||||||
//- Convective Scaling Factor (as determined by Prateep's tests)
|
|
||||||
const scalar convectiveScaling_;
|
|
||||||
|
|
||||||
//- Minimum delta film to be consired dry
|
|
||||||
const scalar filmDeltaDry_;
|
|
||||||
|
|
||||||
//- Maximum delta film to be consired wet
|
|
||||||
const scalar filmDeltaWet_;
|
|
||||||
|
|
||||||
//- Retrieve film model from the database
|
|
||||||
const filmModelType& filmModel() const;
|
|
||||||
|
|
||||||
//- Retrieve pyrolysis model from the database
|
|
||||||
const pyrolysisModelType& pyrModel() const;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("filmPyrolysisRadiativeCoupledMixed");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from patch and internal field
|
|
||||||
filmPyrolysisRadiativeCoupledMixedFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch&,
|
|
||||||
const DimensionedField<scalar, volMesh>&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct from patch, internal field and dictionary
|
|
||||||
filmPyrolysisRadiativeCoupledMixedFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch&,
|
|
||||||
const DimensionedField<scalar, volMesh>&,
|
|
||||||
const dictionary&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct by mapping given
|
|
||||||
// turbulentTemperatureCoupledBaffleMixedFvPatchScalarField onto a
|
|
||||||
// new patch
|
|
||||||
filmPyrolysisRadiativeCoupledMixedFvPatchScalarField
|
|
||||||
(
|
|
||||||
const
|
|
||||||
filmPyrolysisRadiativeCoupledMixedFvPatchScalarField&,
|
|
||||||
const fvPatch&,
|
|
||||||
const DimensionedField<scalar, volMesh>&,
|
|
||||||
const fvPatchFieldMapper&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct and return a clone
|
|
||||||
virtual tmp<fvPatchScalarField> clone() const
|
|
||||||
{
|
|
||||||
return tmp<fvPatchScalarField>
|
|
||||||
(
|
|
||||||
new filmPyrolysisRadiativeCoupledMixedFvPatchScalarField
|
|
||||||
(
|
|
||||||
*this
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Construct as copy setting internal field reference
|
|
||||||
filmPyrolysisRadiativeCoupledMixedFvPatchScalarField
|
|
||||||
(
|
|
||||||
const filmPyrolysisRadiativeCoupledMixedFvPatchScalarField&,
|
|
||||||
const DimensionedField<scalar, volMesh>&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct and return a clone setting internal field reference
|
|
||||||
virtual tmp<fvPatchScalarField> clone
|
|
||||||
(
|
|
||||||
const DimensionedField<scalar, volMesh>& iF
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return tmp<fvPatchScalarField>
|
|
||||||
(
|
|
||||||
new filmPyrolysisRadiativeCoupledMixedFvPatchScalarField
|
|
||||||
(
|
|
||||||
*this,
|
|
||||||
iF
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Get corresponding K field
|
|
||||||
tmp<scalarField> K() const;
|
|
||||||
|
|
||||||
//- Update the coefficients associated with the patch field
|
|
||||||
virtual void updateCoeffs();
|
|
||||||
|
|
||||||
//- Write
|
|
||||||
virtual void write(Ostream&) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,221 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2019 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/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "filmPyrolysisTemperatureCoupledFvPatchScalarField.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
#include "surfaceFields.H"
|
|
||||||
#include "pyrolysisModel.H"
|
|
||||||
#include "surfaceFilmRegionModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::filmPyrolysisTemperatureCoupledFvPatchScalarField::
|
|
||||||
filmPyrolysisTemperatureCoupledFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fixedValueFvPatchScalarField(p, iF),
|
|
||||||
filmRegionName_("surfaceFilmProperties"),
|
|
||||||
pyrolysisRegionName_("pyrolysisProperties"),
|
|
||||||
phiName_("phi"),
|
|
||||||
rhoName_("rho")
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::filmPyrolysisTemperatureCoupledFvPatchScalarField::
|
|
||||||
filmPyrolysisTemperatureCoupledFvPatchScalarField
|
|
||||||
(
|
|
||||||
const filmPyrolysisTemperatureCoupledFvPatchScalarField& ptf,
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF,
|
|
||||||
const fvPatchFieldMapper& mapper
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fixedValueFvPatchScalarField(ptf, p, iF, mapper),
|
|
||||||
filmRegionName_(ptf.filmRegionName_),
|
|
||||||
pyrolysisRegionName_(ptf.pyrolysisRegionName_),
|
|
||||||
phiName_(ptf.phiName_),
|
|
||||||
rhoName_(ptf.rhoName_)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::filmPyrolysisTemperatureCoupledFvPatchScalarField::
|
|
||||||
filmPyrolysisTemperatureCoupledFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF,
|
|
||||||
const dictionary& dict
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fixedValueFvPatchScalarField(p, iF, dict),
|
|
||||||
filmRegionName_
|
|
||||||
(
|
|
||||||
dict.lookupOrDefault<word>("filmRegion", "surfaceFilmProperties")
|
|
||||||
),
|
|
||||||
pyrolysisRegionName_
|
|
||||||
(
|
|
||||||
dict.lookupOrDefault<word>("pyrolysisRegion", "pyrolysisProperties")
|
|
||||||
),
|
|
||||||
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
|
|
||||||
rhoName_(dict.lookupOrDefault<word>("rho", "rho"))
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::filmPyrolysisTemperatureCoupledFvPatchScalarField::
|
|
||||||
filmPyrolysisTemperatureCoupledFvPatchScalarField
|
|
||||||
(
|
|
||||||
const filmPyrolysisTemperatureCoupledFvPatchScalarField& fptpsf
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fixedValueFvPatchScalarField(fptpsf),
|
|
||||||
filmRegionName_(fptpsf.filmRegionName_),
|
|
||||||
pyrolysisRegionName_(fptpsf.pyrolysisRegionName_),
|
|
||||||
phiName_(fptpsf.phiName_),
|
|
||||||
rhoName_(fptpsf.rhoName_)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::filmPyrolysisTemperatureCoupledFvPatchScalarField::
|
|
||||||
filmPyrolysisTemperatureCoupledFvPatchScalarField
|
|
||||||
(
|
|
||||||
const filmPyrolysisTemperatureCoupledFvPatchScalarField& fptpsf,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fixedValueFvPatchScalarField(fptpsf, iF),
|
|
||||||
filmRegionName_(fptpsf.filmRegionName_),
|
|
||||||
pyrolysisRegionName_(fptpsf.pyrolysisRegionName_),
|
|
||||||
phiName_(fptpsf.phiName_),
|
|
||||||
rhoName_(fptpsf.rhoName_)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void Foam::filmPyrolysisTemperatureCoupledFvPatchScalarField::updateCoeffs()
|
|
||||||
{
|
|
||||||
if (updated())
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef regionModels::surfaceFilmModels::surfaceFilmRegionModel
|
|
||||||
filmModelType;
|
|
||||||
|
|
||||||
typedef regionModels::pyrolysisModels::pyrolysisModel pyrModelType;
|
|
||||||
|
|
||||||
// Since we're inside initEvaluate/evaluate there might be processor
|
|
||||||
// comms underway. Change the tag we use.
|
|
||||||
int oldTag = UPstream::msgType();
|
|
||||||
UPstream::msgType() = oldTag+1;
|
|
||||||
|
|
||||||
bool filmOk = db().time().foundObject<filmModelType>(filmRegionName_);
|
|
||||||
|
|
||||||
|
|
||||||
bool pyrOk = db().time().foundObject<pyrModelType>(pyrolysisRegionName_);
|
|
||||||
|
|
||||||
if (!filmOk || !pyrOk)
|
|
||||||
{
|
|
||||||
// Do nothing on construction - film model doesn't exist yet
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
scalarField& Tp = *this;
|
|
||||||
|
|
||||||
const label patchi = patch().index();
|
|
||||||
|
|
||||||
// Retrieve film model
|
|
||||||
const filmModelType& filmModel =
|
|
||||||
db().time().lookupObject<filmModelType>(filmRegionName_);
|
|
||||||
|
|
||||||
const label filmPatchi = filmModel.regionPatchID(patchi);
|
|
||||||
|
|
||||||
scalarField alphaFilm = filmModel.alpha().boundaryField()[filmPatchi];
|
|
||||||
filmModel.toPrimary(filmPatchi, alphaFilm);
|
|
||||||
|
|
||||||
scalarField TFilm = filmModel.Ts().boundaryField()[filmPatchi];
|
|
||||||
filmModel.toPrimary(filmPatchi, TFilm);
|
|
||||||
|
|
||||||
// Retrieve pyrolysis model
|
|
||||||
const pyrModelType& pyrModel =
|
|
||||||
db().time().lookupObject<pyrModelType>(pyrolysisRegionName_);
|
|
||||||
|
|
||||||
const label pyrPatchi = pyrModel.regionPatchID(patchi);
|
|
||||||
|
|
||||||
scalarField TPyr = pyrModel.T().boundaryField()[pyrPatchi];
|
|
||||||
pyrModel.toPrimary(pyrPatchi, TPyr);
|
|
||||||
|
|
||||||
|
|
||||||
// Evaluate temperature
|
|
||||||
Tp = alphaFilm*TFilm + (1.0 - alphaFilm)*TPyr;
|
|
||||||
|
|
||||||
// Restore tag
|
|
||||||
UPstream::msgType() = oldTag;
|
|
||||||
|
|
||||||
fixedValueFvPatchScalarField::updateCoeffs();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::filmPyrolysisTemperatureCoupledFvPatchScalarField::write
|
|
||||||
(
|
|
||||||
Ostream& os
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
fvPatchScalarField::write(os);
|
|
||||||
writeEntryIfDifferent<word>
|
|
||||||
(
|
|
||||||
os,
|
|
||||||
"filmRegion",
|
|
||||||
"surfaceFilmProperties",
|
|
||||||
filmRegionName_
|
|
||||||
);
|
|
||||||
writeEntryIfDifferent<word>
|
|
||||||
(
|
|
||||||
os,
|
|
||||||
"pyrolysisRegion",
|
|
||||||
"pyrolysisProperties",
|
|
||||||
pyrolysisRegionName_
|
|
||||||
);
|
|
||||||
writeEntryIfDifferent<word>(os, "phi", "phi", phiName_);
|
|
||||||
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
|
|
||||||
writeEntry(os, "value", *this);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
makePatchTypeField
|
|
||||||
(
|
|
||||||
fvPatchScalarField,
|
|
||||||
filmPyrolysisTemperatureCoupledFvPatchScalarField
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,199 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2019 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/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::filmPyrolysisTemperatureCoupledFvPatchScalarField
|
|
||||||
|
|
||||||
Description
|
|
||||||
This boundary condition is designed to be used in conjunction with surface
|
|
||||||
film and pyrolysis modelling. It provides a temperature boundary condition
|
|
||||||
for patches on the primary region based on whether the patch is seen to
|
|
||||||
be 'wet', retrieved from the film alpha field.
|
|
||||||
|
|
||||||
- if the patch is wet, the temperature is set using the film temperature
|
|
||||||
- otherwise, it is set using pyrolysis temperature
|
|
||||||
|
|
||||||
Example of the boundary condition specification:
|
|
||||||
\verbatim
|
|
||||||
<patchName>
|
|
||||||
{
|
|
||||||
type filmPyrolysisTemperatureCoupled;
|
|
||||||
phi phi; // name of flux field (default = phi)
|
|
||||||
rho rho; // name of density field (default = rho)
|
|
||||||
deltaWet 1e-4; // threshold height for 'wet' film
|
|
||||||
value uniform 300; // initial temperature / [K]
|
|
||||||
}
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
filmPyrolysisTemperatureCoupledFvPatchScalarField.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef filmPyrolysisTemperatureCoupledFvPatchScalarField_H
|
|
||||||
#define filmPyrolysisTemperatureCoupledFvPatchScalarField_H
|
|
||||||
|
|
||||||
#include "fixedValueFvPatchFields.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class filmPyrolysisTemperatureCoupledFvPatchScalarField Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class filmPyrolysisTemperatureCoupledFvPatchScalarField
|
|
||||||
:
|
|
||||||
public fixedValueFvPatchScalarField
|
|
||||||
{
|
|
||||||
// Private Data
|
|
||||||
|
|
||||||
//- Name of film region
|
|
||||||
const word filmRegionName_;
|
|
||||||
|
|
||||||
//- Name of pyrolysis region
|
|
||||||
const word pyrolysisRegionName_;
|
|
||||||
|
|
||||||
//- Name of flux field
|
|
||||||
word phiName_;
|
|
||||||
|
|
||||||
//- Name of density field
|
|
||||||
word rhoName_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("filmPyrolysisTemperatureCoupled");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from patch and internal field
|
|
||||||
filmPyrolysisTemperatureCoupledFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch&,
|
|
||||||
const DimensionedField<scalar, volMesh>&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct from patch, internal field and dictionary
|
|
||||||
filmPyrolysisTemperatureCoupledFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch&,
|
|
||||||
const DimensionedField<scalar, volMesh>&,
|
|
||||||
const dictionary&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct by mapping given
|
|
||||||
// filmPyrolysisTemperatureCoupledFvPatchScalarField onto a new patch
|
|
||||||
filmPyrolysisTemperatureCoupledFvPatchScalarField
|
|
||||||
(
|
|
||||||
const filmPyrolysisTemperatureCoupledFvPatchScalarField&,
|
|
||||||
const fvPatch&,
|
|
||||||
const DimensionedField<scalar, volMesh>&,
|
|
||||||
const fvPatchFieldMapper&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Copy constructor
|
|
||||||
filmPyrolysisTemperatureCoupledFvPatchScalarField
|
|
||||||
(
|
|
||||||
const filmPyrolysisTemperatureCoupledFvPatchScalarField&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct and return a clone
|
|
||||||
virtual tmp<fvPatchScalarField> clone() const
|
|
||||||
{
|
|
||||||
return tmp<fvPatchScalarField>
|
|
||||||
(
|
|
||||||
new filmPyrolysisTemperatureCoupledFvPatchScalarField(*this)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Copy constructor setting internal field reference
|
|
||||||
filmPyrolysisTemperatureCoupledFvPatchScalarField
|
|
||||||
(
|
|
||||||
const filmPyrolysisTemperatureCoupledFvPatchScalarField&,
|
|
||||||
const DimensionedField<scalar, volMesh>&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct and return a clone setting internal field reference
|
|
||||||
virtual tmp<fvPatchScalarField> clone
|
|
||||||
(
|
|
||||||
const DimensionedField<scalar, volMesh>& iF
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return tmp<fvPatchScalarField>
|
|
||||||
(
|
|
||||||
new filmPyrolysisTemperatureCoupledFvPatchScalarField(*this, iF)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
// Access
|
|
||||||
|
|
||||||
//- Return the name of phi
|
|
||||||
const word& phiName() const
|
|
||||||
{
|
|
||||||
return phiName_;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Return reference to the name of phi to allow adjustment
|
|
||||||
word& phiName()
|
|
||||||
{
|
|
||||||
return phiName_;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Return the name of rho
|
|
||||||
const word& rhoName() const
|
|
||||||
{
|
|
||||||
return rhoName_;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Return reference to the name of rho to allow adjustment
|
|
||||||
word& rhoName()
|
|
||||||
{
|
|
||||||
return rhoName_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//- Update the coefficients associated with the patch field
|
|
||||||
virtual void updateCoeffs();
|
|
||||||
|
|
||||||
//- Write
|
|
||||||
virtual void write(Ostream&) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,247 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2019 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/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "filmPyrolysisVelocityCoupledFvPatchVectorField.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
#include "surfaceFields.H"
|
|
||||||
#include "pyrolysisModel.H"
|
|
||||||
#include "surfaceFilmRegionModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::filmPyrolysisVelocityCoupledFvPatchVectorField::
|
|
||||||
filmPyrolysisVelocityCoupledFvPatchVectorField
|
|
||||||
(
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<vector, volMesh>& iF
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fixedValueFvPatchVectorField(p, iF),
|
|
||||||
filmRegionName_("surfaceFilmProperties"),
|
|
||||||
pyrolysisRegionName_("pyrolysisProperties"),
|
|
||||||
phiName_("phi"),
|
|
||||||
rhoName_("rho")
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::filmPyrolysisVelocityCoupledFvPatchVectorField::
|
|
||||||
filmPyrolysisVelocityCoupledFvPatchVectorField
|
|
||||||
(
|
|
||||||
const filmPyrolysisVelocityCoupledFvPatchVectorField& ptf,
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<vector, volMesh>& iF,
|
|
||||||
const fvPatchFieldMapper& mapper
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fixedValueFvPatchVectorField(ptf, p, iF, mapper),
|
|
||||||
filmRegionName_(ptf.filmRegionName_),
|
|
||||||
pyrolysisRegionName_(ptf.pyrolysisRegionName_),
|
|
||||||
phiName_(ptf.phiName_),
|
|
||||||
rhoName_(ptf.rhoName_)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::filmPyrolysisVelocityCoupledFvPatchVectorField::
|
|
||||||
filmPyrolysisVelocityCoupledFvPatchVectorField
|
|
||||||
(
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<vector, volMesh>& iF,
|
|
||||||
const dictionary& dict
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fixedValueFvPatchVectorField(p, iF, dict),
|
|
||||||
filmRegionName_
|
|
||||||
(
|
|
||||||
dict.lookupOrDefault<word>("filmRegion", "surfaceFilmProperties")
|
|
||||||
),
|
|
||||||
pyrolysisRegionName_
|
|
||||||
(
|
|
||||||
dict.lookupOrDefault<word>("pyrolysisRegion", "pyrolysisProperties")
|
|
||||||
),
|
|
||||||
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
|
|
||||||
rhoName_(dict.lookupOrDefault<word>("rho", "rho"))
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::filmPyrolysisVelocityCoupledFvPatchVectorField::
|
|
||||||
filmPyrolysisVelocityCoupledFvPatchVectorField
|
|
||||||
(
|
|
||||||
const filmPyrolysisVelocityCoupledFvPatchVectorField& fpvpvf
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fixedValueFvPatchVectorField(fpvpvf),
|
|
||||||
filmRegionName_(fpvpvf.filmRegionName_),
|
|
||||||
pyrolysisRegionName_(fpvpvf.pyrolysisRegionName_),
|
|
||||||
phiName_(fpvpvf.phiName_),
|
|
||||||
rhoName_(fpvpvf.rhoName_)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::filmPyrolysisVelocityCoupledFvPatchVectorField::
|
|
||||||
filmPyrolysisVelocityCoupledFvPatchVectorField
|
|
||||||
(
|
|
||||||
const filmPyrolysisVelocityCoupledFvPatchVectorField& fpvpvf,
|
|
||||||
const DimensionedField<vector, volMesh>& iF
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fixedValueFvPatchVectorField(fpvpvf, iF),
|
|
||||||
filmRegionName_(fpvpvf.filmRegionName_),
|
|
||||||
pyrolysisRegionName_(fpvpvf.pyrolysisRegionName_),
|
|
||||||
phiName_(fpvpvf.phiName_),
|
|
||||||
rhoName_(fpvpvf.rhoName_)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void Foam::filmPyrolysisVelocityCoupledFvPatchVectorField::updateCoeffs()
|
|
||||||
{
|
|
||||||
if (updated())
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef regionModels::surfaceFilmModels::surfaceFilmRegionModel
|
|
||||||
filmModelType;
|
|
||||||
|
|
||||||
typedef regionModels::pyrolysisModels::pyrolysisModel pyrModelType;
|
|
||||||
|
|
||||||
// Since we're inside initEvaluate/evaluate there might be processor
|
|
||||||
// comms underway. Change the tag we use.
|
|
||||||
int oldTag = UPstream::msgType();
|
|
||||||
UPstream::msgType() = oldTag+1;
|
|
||||||
|
|
||||||
bool foundFilm = db().time().foundObject<filmModelType>(filmRegionName_);
|
|
||||||
|
|
||||||
bool foundPyrolysis =
|
|
||||||
db().time().foundObject<pyrModelType>(pyrolysisRegionName_);
|
|
||||||
|
|
||||||
if (!foundFilm || !foundPyrolysis)
|
|
||||||
{
|
|
||||||
// Do nothing on construction - film model doesn't exist yet
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
vectorField& Up = *this;
|
|
||||||
|
|
||||||
const label patchi = patch().index();
|
|
||||||
|
|
||||||
// Retrieve film model
|
|
||||||
const filmModelType& filmModel =
|
|
||||||
db().time().lookupObject<filmModelType>(filmRegionName_);
|
|
||||||
|
|
||||||
const label filmPatchi = filmModel.regionPatchID(patchi);
|
|
||||||
|
|
||||||
scalarField alphaFilm = filmModel.alpha().boundaryField()[filmPatchi];
|
|
||||||
filmModel.toPrimary(filmPatchi, alphaFilm);
|
|
||||||
|
|
||||||
vectorField UFilm = filmModel.Us().boundaryField()[filmPatchi];
|
|
||||||
filmModel.toPrimary(filmPatchi, UFilm);
|
|
||||||
|
|
||||||
// Retrieve pyrolysis model
|
|
||||||
const pyrModelType& pyrModel =
|
|
||||||
db().time().lookupObject<pyrModelType>(pyrolysisRegionName_);
|
|
||||||
|
|
||||||
const label pyrPatchi = pyrModel.regionPatchID(patchi);
|
|
||||||
|
|
||||||
scalarField phiPyr = pyrModel.phiGas().boundaryField()[pyrPatchi];
|
|
||||||
pyrModel.toPrimary(pyrPatchi, phiPyr);
|
|
||||||
|
|
||||||
|
|
||||||
const surfaceScalarField& phi =
|
|
||||||
db().lookupObject<surfaceScalarField>(phiName_);
|
|
||||||
|
|
||||||
if (phi.dimensions() == dimVelocity*dimArea)
|
|
||||||
{}
|
|
||||||
else if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
|
|
||||||
{
|
|
||||||
const fvPatchField<scalar>& rhop =
|
|
||||||
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
|
||||||
phiPyr /= rhop;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
FatalErrorInFunction
|
|
||||||
<< "Unable to process flux field phi with dimensions "
|
|
||||||
<< phi.dimensions() << nl
|
|
||||||
<< " on patch " << patch().name()
|
|
||||||
<< " of field " << internalField().name()
|
|
||||||
<< " in file " << internalField().objectPath()
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
const scalarField UAvePyr(-phiPyr/patch().magSf());
|
|
||||||
const vectorField& nf = patch().nf();
|
|
||||||
|
|
||||||
|
|
||||||
// Evaluate velocity
|
|
||||||
Up = alphaFilm*UFilm + (1.0 - alphaFilm)*UAvePyr*nf;
|
|
||||||
|
|
||||||
// Restore tag
|
|
||||||
UPstream::msgType() = oldTag;
|
|
||||||
|
|
||||||
fixedValueFvPatchVectorField::updateCoeffs();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::filmPyrolysisVelocityCoupledFvPatchVectorField::write
|
|
||||||
(
|
|
||||||
Ostream& os
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
fvPatchVectorField::write(os);
|
|
||||||
writeEntryIfDifferent<word>
|
|
||||||
(
|
|
||||||
os,
|
|
||||||
"filmRegion",
|
|
||||||
"surfaceFilmProperties",
|
|
||||||
filmRegionName_
|
|
||||||
);
|
|
||||||
writeEntryIfDifferent<word>
|
|
||||||
(
|
|
||||||
os,
|
|
||||||
"pyrolysisRegion",
|
|
||||||
"pyrolysisProperties",
|
|
||||||
pyrolysisRegionName_
|
|
||||||
);
|
|
||||||
writeEntryIfDifferent<word>(os, "phi", "phi", phiName_);
|
|
||||||
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
|
|
||||||
writeEntry(os, "value", *this);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
makePatchTypeField
|
|
||||||
(
|
|
||||||
fvPatchVectorField,
|
|
||||||
filmPyrolysisVelocityCoupledFvPatchVectorField
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,200 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2019 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/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::filmPyrolysisVelocityCoupledFvPatchVectorField
|
|
||||||
|
|
||||||
Description
|
|
||||||
This boundary condition is designed to be used in conjunction with surface
|
|
||||||
film and pyrolysis modelling.
|
|
||||||
|
|
||||||
It provides a velocity boundary condition for patches on the primary region
|
|
||||||
based on whether the patch is seen to be 'wet', retrieved from the film
|
|
||||||
alpha field.
|
|
||||||
- if the patch is wet, the velocity is set using the film velocity
|
|
||||||
- otherwise, it is set using pyrolysis out-gassing velocity
|
|
||||||
|
|
||||||
Example of the boundary condition specification:
|
|
||||||
\verbatim
|
|
||||||
<patchName>
|
|
||||||
{
|
|
||||||
type filmPyrolysisVelocityCoupled;
|
|
||||||
phi phi; // name of flux field (default = phi)
|
|
||||||
rho rho; // name of density field (default = rho)
|
|
||||||
deltaWet 1e-4; // threshold height for 'wet' film
|
|
||||||
value uniform (0 0 0); // initial velocity / [m/s]
|
|
||||||
}
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
filmPyrolysisVelocityCoupledFvPatchVectorField.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef filmPyrolysisVelocityCoupledFvPatchVectorField_H
|
|
||||||
#define filmPyrolysisVelocityCoupledFvPatchVectorField_H
|
|
||||||
|
|
||||||
#include "fixedValueFvPatchFields.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class filmPyrolysisVelocityCoupledFvPatchVectorField Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class filmPyrolysisVelocityCoupledFvPatchVectorField
|
|
||||||
:
|
|
||||||
public fixedValueFvPatchVectorField
|
|
||||||
{
|
|
||||||
// Private Data
|
|
||||||
|
|
||||||
//- Name of film region
|
|
||||||
word filmRegionName_;
|
|
||||||
|
|
||||||
//- Name of pyrolysis region
|
|
||||||
word pyrolysisRegionName_;
|
|
||||||
|
|
||||||
//- Name of flux field
|
|
||||||
word phiName_;
|
|
||||||
|
|
||||||
//- Name of density field
|
|
||||||
word rhoName_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("filmPyrolysisVelocityCoupled");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from patch and internal field
|
|
||||||
filmPyrolysisVelocityCoupledFvPatchVectorField
|
|
||||||
(
|
|
||||||
const fvPatch&,
|
|
||||||
const DimensionedField<vector, volMesh>&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct from patch, internal field and dictionary
|
|
||||||
filmPyrolysisVelocityCoupledFvPatchVectorField
|
|
||||||
(
|
|
||||||
const fvPatch&,
|
|
||||||
const DimensionedField<vector, volMesh>&,
|
|
||||||
const dictionary&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct by mapping given
|
|
||||||
// filmPyrolysisVelocityCoupledFvPatchVectorField onto a new patch
|
|
||||||
filmPyrolysisVelocityCoupledFvPatchVectorField
|
|
||||||
(
|
|
||||||
const filmPyrolysisVelocityCoupledFvPatchVectorField&,
|
|
||||||
const fvPatch&,
|
|
||||||
const DimensionedField<vector, volMesh>&,
|
|
||||||
const fvPatchFieldMapper&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Copy constructor
|
|
||||||
filmPyrolysisVelocityCoupledFvPatchVectorField
|
|
||||||
(
|
|
||||||
const filmPyrolysisVelocityCoupledFvPatchVectorField&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct and return a clone
|
|
||||||
virtual tmp<fvPatchVectorField> clone() const
|
|
||||||
{
|
|
||||||
return tmp<fvPatchVectorField>
|
|
||||||
(
|
|
||||||
new filmPyrolysisVelocityCoupledFvPatchVectorField(*this)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Copy constructor setting internal field reference
|
|
||||||
filmPyrolysisVelocityCoupledFvPatchVectorField
|
|
||||||
(
|
|
||||||
const filmPyrolysisVelocityCoupledFvPatchVectorField&,
|
|
||||||
const DimensionedField<vector, volMesh>&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct and return a clone setting internal field reference
|
|
||||||
virtual tmp<fvPatchVectorField> clone
|
|
||||||
(
|
|
||||||
const DimensionedField<vector, volMesh>& iF
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return tmp<fvPatchVectorField>
|
|
||||||
(
|
|
||||||
new filmPyrolysisVelocityCoupledFvPatchVectorField(*this, iF)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
// Access
|
|
||||||
|
|
||||||
//- Return the name of phi
|
|
||||||
const word& phiName() const
|
|
||||||
{
|
|
||||||
return phiName_;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Return reference to the name of phi to allow adjustment
|
|
||||||
word& phiName()
|
|
||||||
{
|
|
||||||
return phiName_;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Return the name of rho
|
|
||||||
const word& rhoName() const
|
|
||||||
{
|
|
||||||
return rhoName_;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Return reference to the name of rho to allow adjustment
|
|
||||||
word& rhoName()
|
|
||||||
{
|
|
||||||
return rhoName_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//- Update the coefficients associated with the patch field
|
|
||||||
virtual void updateCoeffs();
|
|
||||||
|
|
||||||
//- Write
|
|
||||||
virtual void write(Ostream&) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -25,7 +25,7 @@ Class
|
|||||||
Foam::regionModels::thermalBaffleModels::noThermo
|
Foam::regionModels::thermalBaffleModels::noThermo
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Dummy surface pyrolysis model for 'none'
|
Dummy surface model for 'none'
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
noThermo.C
|
noThermo.C
|
||||||
|
|||||||
@ -5,7 +5,6 @@ cd ${0%/*} || exit 1 # Run from this directory
|
|||||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||||
|
|
||||||
wmake $targetType specie
|
wmake $targetType specie
|
||||||
wmake $targetType solidSpecie
|
|
||||||
wmake $targetType thermophysicalProperties
|
wmake $targetType thermophysicalProperties
|
||||||
|
|
||||||
wmake $targetType basic
|
wmake $targetType basic
|
||||||
@ -16,6 +15,5 @@ wmake $targetType barotropicCompressibilityModel
|
|||||||
wmake $targetType SLGThermo
|
wmake $targetType SLGThermo
|
||||||
|
|
||||||
wmake $targetType solidThermo
|
wmake $targetType solidThermo
|
||||||
wmake $targetType solidChemistryModel
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -2,12 +2,10 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/solidSpecie/lnInclude \
|
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||||
|
|
||||||
LIB_LIBS = \
|
LIB_LIBS = \
|
||||||
-lcompressibleTransportModels \
|
-lcompressibleTransportModels \
|
||||||
-lfluidThermophysicalModels \
|
-lfluidThermophysicalModels \
|
||||||
-lspecie \
|
-lspecie \
|
||||||
-lsolidSpecie \
|
|
||||||
-lfiniteVolume
|
-lfiniteVolume
|
||||||
|
|||||||
@ -1,8 +0,0 @@
|
|||||||
|
|
||||||
basicSolidChemistryModel/basicSolidChemistryModel.C
|
|
||||||
basicSolidChemistryModel/basicSolidChemistryModelNew.C
|
|
||||||
basicSolidChemistryModel/basicSolidChemistryModels.C
|
|
||||||
|
|
||||||
solidChemistrySolver/makeSolidChemistrySolvers.C
|
|
||||||
|
|
||||||
LIB = $(FOAM_LIBBIN)/libsolidChemistryModel
|
|
||||||
@ -1,15 +0,0 @@
|
|||||||
EXE_INC = \
|
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/solidSpecie/lnInclude \
|
|
||||||
-I$(LIB_SRC)/ODE/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude
|
|
||||||
|
|
||||||
LIB_LIBS = \
|
|
||||||
-lchemistryModel \
|
|
||||||
-lfiniteVolume \
|
|
||||||
-lODE\
|
|
||||||
-lreactionThermophysicalModels
|
|
||||||
@ -1,98 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2013-2018 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/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "basicSolidChemistryModel.H"
|
|
||||||
#include "fvMesh.H"
|
|
||||||
#include "Time.H"
|
|
||||||
|
|
||||||
/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(basicSolidChemistryModel, 0);
|
|
||||||
defineRunTimeSelectionTable(basicSolidChemistryModel, thermo);
|
|
||||||
}
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::basicSolidChemistryModel::basicSolidChemistryModel
|
|
||||||
(
|
|
||||||
solidReactionThermo& thermo
|
|
||||||
)
|
|
||||||
:
|
|
||||||
basicChemistryModel(thermo),
|
|
||||||
solidThermo_(thermo)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::basicSolidChemistryModel::~basicSolidChemistryModel()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
const Foam::DimensionedField<Foam::scalar, Foam::volMesh>&
|
|
||||||
Foam::basicSolidChemistryModel::RR(const label i) const
|
|
||||||
{
|
|
||||||
NotImplemented;
|
|
||||||
return (volScalarField::Internal::null());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::DimensionedField<Foam::scalar, Foam::volMesh>&
|
|
||||||
Foam::basicSolidChemistryModel::RR(const label i)
|
|
||||||
{
|
|
||||||
NotImplemented;
|
|
||||||
|
|
||||||
return dynamic_cast<volScalarField::Internal&>
|
|
||||||
(
|
|
||||||
const_cast<volScalarField::Internal& >
|
|
||||||
(
|
|
||||||
volScalarField::Internal::null()
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh>>
|
|
||||||
Foam::basicSolidChemistryModel::calculateRR
|
|
||||||
(
|
|
||||||
const label reactionI,
|
|
||||||
const label speciei
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
NotImplemented;
|
|
||||||
|
|
||||||
return dynamic_cast<tmp<volScalarField::Internal>&>
|
|
||||||
(
|
|
||||||
const_cast<volScalarField::Internal& >
|
|
||||||
(
|
|
||||||
volScalarField::Internal::null()
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,187 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2013-2019 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/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::basicSolidChemistryModel
|
|
||||||
|
|
||||||
Description
|
|
||||||
Chemistry model for solid thermodynamics
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
basicSolidChemistryModelI.H
|
|
||||||
basicSolidChemistryModel.C
|
|
||||||
newChemistrySolidModel.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef basicSolidChemistryModel_H
|
|
||||||
#define basicSolidChemistryModel_H
|
|
||||||
|
|
||||||
#include "basicChemistryModel.H"
|
|
||||||
#include "autoPtr.H"
|
|
||||||
#include "runTimeSelectionTables.H"
|
|
||||||
#include "solidReactionThermo.H"
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// Forward declaration of classes
|
|
||||||
class fvMesh;
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
class basicSolidChemistryModel Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class basicSolidChemistryModel
|
|
||||||
:
|
|
||||||
public basicChemistryModel
|
|
||||||
{
|
|
||||||
protected:
|
|
||||||
|
|
||||||
// Protected data
|
|
||||||
|
|
||||||
//- Solid thermo
|
|
||||||
solidReactionThermo& solidThermo_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("basicSolidChemistryModel");
|
|
||||||
|
|
||||||
|
|
||||||
//- Thermo type
|
|
||||||
typedef solidReactionThermo reactionThermo;
|
|
||||||
|
|
||||||
|
|
||||||
//- Declare run-time constructor selection tables
|
|
||||||
declareRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
autoPtr,
|
|
||||||
basicSolidChemistryModel,
|
|
||||||
thermo,
|
|
||||||
(solidReactionThermo& thermo),
|
|
||||||
(thermo)
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from thermo
|
|
||||||
basicSolidChemistryModel(solidReactionThermo& thermo);
|
|
||||||
|
|
||||||
//- Construct as copy (not implemented)
|
|
||||||
basicSolidChemistryModel(const basicSolidChemistryModel&);
|
|
||||||
|
|
||||||
|
|
||||||
//- Selector
|
|
||||||
static autoPtr<basicSolidChemistryModel> New(solidReactionThermo& thermo);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~basicSolidChemistryModel();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Return access to the solid thermo package
|
|
||||||
inline solidReactionThermo& solidThermo();
|
|
||||||
|
|
||||||
//- Return const access to the solid thermo package
|
|
||||||
inline const solidReactionThermo& solidThermo() const;
|
|
||||||
|
|
||||||
//- Return total gases mass source term [kg/m^3/s]
|
|
||||||
virtual tmp<volScalarField::Internal> RRg() const = 0;
|
|
||||||
|
|
||||||
//- Return total solids mass source term [kg/m^3/s]
|
|
||||||
virtual tmp<volScalarField::Internal> RRs() const = 0;
|
|
||||||
|
|
||||||
//- Return chemical source terms for solids [kg/m^3/s]
|
|
||||||
virtual const volScalarField::Internal& RRs
|
|
||||||
(
|
|
||||||
const label i
|
|
||||||
) const = 0;
|
|
||||||
|
|
||||||
//- Return chemical source terms for gases [kg/m^3/s]
|
|
||||||
virtual const volScalarField::Internal& RRg
|
|
||||||
(
|
|
||||||
const label i
|
|
||||||
) const = 0;
|
|
||||||
|
|
||||||
//- Returns the reaction rate of the speciei in reactionI
|
|
||||||
virtual tmp<volScalarField::Internal> calculateRR
|
|
||||||
(
|
|
||||||
const label reactionI,
|
|
||||||
const label speciei
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Return sensible enthalpy for gas i [J/Kg]
|
|
||||||
virtual tmp<volScalarField> gasHs
|
|
||||||
(
|
|
||||||
const volScalarField& p,
|
|
||||||
const volScalarField& T,
|
|
||||||
const label i
|
|
||||||
) const = 0;
|
|
||||||
|
|
||||||
//- Return specie Table for gases
|
|
||||||
virtual const speciesTable& gasTable() const = 0;
|
|
||||||
|
|
||||||
//- Set reacting status of cell, celli
|
|
||||||
virtual void setCellReacting(const label celli, const bool active) = 0;
|
|
||||||
|
|
||||||
//- Calculates the reaction rates
|
|
||||||
virtual void calculate() = 0;
|
|
||||||
|
|
||||||
//- Return const access to the total source terms
|
|
||||||
virtual const volScalarField::Internal& RR
|
|
||||||
(
|
|
||||||
const label i
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Return non-const access to the total source terms
|
|
||||||
virtual volScalarField::Internal& RR(const label i);
|
|
||||||
|
|
||||||
|
|
||||||
// Member Operators
|
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
|
||||||
void operator=(const basicSolidChemistryModel&) = delete;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#include "basicSolidChemistryModelI.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,41 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2013-2018 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/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
inline Foam::solidReactionThermo& Foam::basicSolidChemistryModel::solidThermo()
|
|
||||||
{
|
|
||||||
return solidThermo_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::solidReactionThermo&
|
|
||||||
Foam::basicSolidChemistryModel::solidThermo() const
|
|
||||||
{
|
|
||||||
return solidThermo_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,168 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2013-2018 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/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "basicSolidChemistryModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::autoPtr<Foam::basicSolidChemistryModel>
|
|
||||||
Foam::basicSolidChemistryModel::New(solidReactionThermo& thermo)
|
|
||||||
{
|
|
||||||
IOdictionary chemistryDict
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
thermo.phasePropertyName("chemistryProperties"),
|
|
||||||
thermo.db().time().constant(),
|
|
||||||
thermo.db(),
|
|
||||||
IOobject::MUST_READ,
|
|
||||||
IOobject::NO_WRITE,
|
|
||||||
false
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
const dictionary& chemistryTypeDict
|
|
||||||
(
|
|
||||||
chemistryDict.subDict("chemistryType")
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<< "Selecting chemistry type " << chemistryTypeDict << endl;
|
|
||||||
|
|
||||||
const int nCmpt = 13;
|
|
||||||
const char* cmptNames[nCmpt] =
|
|
||||||
{
|
|
||||||
"chemistrySolver",
|
|
||||||
"chemistryThermo",
|
|
||||||
"baseChemistry",
|
|
||||||
"transport",
|
|
||||||
"thermo",
|
|
||||||
"equationOfState",
|
|
||||||
"specie",
|
|
||||||
"energy",
|
|
||||||
"transport",
|
|
||||||
"thermo",
|
|
||||||
"equationOfState",
|
|
||||||
"specie",
|
|
||||||
"energy"
|
|
||||||
};
|
|
||||||
|
|
||||||
IOdictionary thermoDict
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
basicThermo::dictName,
|
|
||||||
thermo.db().time().constant(),
|
|
||||||
thermo.db(),
|
|
||||||
IOobject::MUST_READ_IF_MODIFIED,
|
|
||||||
IOobject::NO_WRITE,
|
|
||||||
false
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
const dictionary& solidThermoTypeDict(thermoDict.subDict("thermoType"));
|
|
||||||
word solidThermoTypeName
|
|
||||||
(
|
|
||||||
word(solidThermoTypeDict.lookup("transport")) + '<'
|
|
||||||
+ word(solidThermoTypeDict.lookup("thermo")) + '<'
|
|
||||||
+ word(solidThermoTypeDict.lookup("equationOfState")) + '<'
|
|
||||||
+ word(solidThermoTypeDict.lookup("specie")) + ">>,"
|
|
||||||
+ word(solidThermoTypeDict.lookup("energy")) + ">"
|
|
||||||
);
|
|
||||||
|
|
||||||
const dictionary& gasThermoTypeDict(thermoDict.subDict("gasThermoType"));
|
|
||||||
word gasThermoTypeName
|
|
||||||
(
|
|
||||||
word(gasThermoTypeDict.lookup("transport")) + '<'
|
|
||||||
+ word(gasThermoTypeDict.lookup("thermo")) + '<'
|
|
||||||
+ word(gasThermoTypeDict.lookup("equationOfState")) + '<'
|
|
||||||
+ word(gasThermoTypeDict.lookup("specie")) + ">>,"
|
|
||||||
+ word(gasThermoTypeDict.lookup("energy")) + ">"
|
|
||||||
);
|
|
||||||
|
|
||||||
// Construct the name of the chemistry type from the components
|
|
||||||
word chemistryTypeName
|
|
||||||
(
|
|
||||||
word(chemistryTypeDict.lookup("chemistrySolver")) + '<'
|
|
||||||
+ word(chemistryTypeDict.lookup("chemistryThermo")) + '<'
|
|
||||||
+ typeName + ','
|
|
||||||
+ solidThermoTypeName + ',' + gasThermoTypeName + ">>"
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<< "chemistryTypeName " << chemistryTypeName << endl;
|
|
||||||
|
|
||||||
thermoConstructorTable::iterator cstrIter =
|
|
||||||
thermoConstructorTablePtr_->find(chemistryTypeName);
|
|
||||||
|
|
||||||
if (cstrIter == thermoConstructorTablePtr_->end())
|
|
||||||
{
|
|
||||||
FatalErrorInFunction
|
|
||||||
<< "Unknown " << typeName << " type " << nl
|
|
||||||
<< "chemistryType" << chemistryTypeDict << nl << nl
|
|
||||||
<< "Valid " << typeName << " types are:"
|
|
||||||
<< nl << nl;
|
|
||||||
|
|
||||||
// Get the list of all the suitable chemistry packages available
|
|
||||||
wordList validChemistryTypeNames
|
|
||||||
(
|
|
||||||
thermoConstructorTablePtr_->sortedToc()
|
|
||||||
);
|
|
||||||
Info<< validChemistryTypeNames << endl;
|
|
||||||
|
|
||||||
// Build a table of the thermo packages constituent parts
|
|
||||||
// Note: row-0 contains the names of constituent parts
|
|
||||||
List<wordList> validChemistryTypeNameCmpts
|
|
||||||
(
|
|
||||||
validChemistryTypeNames.size() + 1
|
|
||||||
);
|
|
||||||
|
|
||||||
validChemistryTypeNameCmpts[0].setSize(nCmpt);
|
|
||||||
forAll(validChemistryTypeNameCmpts[0], j)
|
|
||||||
{
|
|
||||||
validChemistryTypeNameCmpts[0][j] = cmptNames[j];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Split the thermo package names into their constituent parts
|
|
||||||
forAll(validChemistryTypeNames, i)
|
|
||||||
{
|
|
||||||
validChemistryTypeNameCmpts[i+1] = basicThermo::splitThermoName
|
|
||||||
(
|
|
||||||
validChemistryTypeNames[i],
|
|
||||||
nCmpt
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Print the table of available packages
|
|
||||||
// in terms of their constituent parts
|
|
||||||
printTable(validChemistryTypeNameCmpts, FatalError);
|
|
||||||
|
|
||||||
FatalError<< exit(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
return
|
|
||||||
autoPtr<basicSolidChemistryModel>(cstrIter()(thermo));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,104 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2013-2018 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/>.
|
|
||||||
|
|
||||||
InClass
|
|
||||||
Foam::basicSolidChemistryModel
|
|
||||||
|
|
||||||
Description
|
|
||||||
Creates solid chemistry model instances templated on the type of
|
|
||||||
solid thermodynamics
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "makeSolidChemistryModel.H"
|
|
||||||
|
|
||||||
#include "pyrolysisChemistryModel.H"
|
|
||||||
#include "basicSolidChemistryModel.H"
|
|
||||||
#include "solidChemistryModel.H"
|
|
||||||
#include "solidThermoPhysicsTypes.H"
|
|
||||||
#include "thermoPhysicsTypes.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
// hConstSolidThermoPhysics
|
|
||||||
|
|
||||||
makeSolidChemistryModel
|
|
||||||
(
|
|
||||||
solidChemistryModel,
|
|
||||||
pyrolysisChemistryModel,
|
|
||||||
basicSolidChemistryModel,
|
|
||||||
hConstSolidThermoPhysics
|
|
||||||
);
|
|
||||||
|
|
||||||
makeSolidGasChemistryModel
|
|
||||||
(
|
|
||||||
solidChemistryModel,
|
|
||||||
pyrolysisChemistryModel,
|
|
||||||
basicSolidChemistryModel,
|
|
||||||
hConstSolidThermoPhysics,
|
|
||||||
gasHThermoPhysics
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
// hPowerSolidThermoPhysics
|
|
||||||
|
|
||||||
makeSolidChemistryModel
|
|
||||||
(
|
|
||||||
solidChemistryModel,
|
|
||||||
pyrolysisChemistryModel,
|
|
||||||
basicSolidChemistryModel,
|
|
||||||
hPowerSolidThermoPhysics
|
|
||||||
);
|
|
||||||
|
|
||||||
makeSolidGasChemistryModel
|
|
||||||
(
|
|
||||||
solidChemistryModel,
|
|
||||||
pyrolysisChemistryModel,
|
|
||||||
basicSolidChemistryModel,
|
|
||||||
hPowerSolidThermoPhysics,
|
|
||||||
gasHThermoPhysics
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
// hExpKappaConstSolidThermoPhysics
|
|
||||||
|
|
||||||
makeSolidChemistryModel
|
|
||||||
(
|
|
||||||
solidChemistryModel,
|
|
||||||
pyrolysisChemistryModel,
|
|
||||||
basicSolidChemistryModel,
|
|
||||||
hExpKappaConstSolidThermoPhysics
|
|
||||||
);
|
|
||||||
|
|
||||||
makeSolidGasChemistryModel
|
|
||||||
(
|
|
||||||
solidChemistryModel,
|
|
||||||
pyrolysisChemistryModel,
|
|
||||||
basicSolidChemistryModel,
|
|
||||||
hExpKappaConstSolidThermoPhysics,
|
|
||||||
gasHThermoPhysics
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,69 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2012-2018 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/>.
|
|
||||||
|
|
||||||
Description
|
|
||||||
Macros for instantiating solid chemistry models
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef makeSolidChemistryModel_H
|
|
||||||
#define makeSolidChemistryModel_H
|
|
||||||
|
|
||||||
#include "solidChemistryModel.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#define makeSolidChemistryModel(sChemistry, SS, Comp, SThermo) \
|
|
||||||
\
|
|
||||||
typedef Foam::sChemistry<Foam::Comp, Foam::SThermo> \
|
|
||||||
sChemistry##Comp##SThermo; \
|
|
||||||
\
|
|
||||||
defineTemplateTypeNameAndDebugWithName \
|
|
||||||
( \
|
|
||||||
sChemistry##Comp##SThermo, \
|
|
||||||
(Foam::word(sChemistry##Comp##SThermo::typeName_()) + "<"#Comp"," \
|
|
||||||
+ SThermo::typeName() + ">").c_str(), \
|
|
||||||
0 \
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
#define makeSolidGasChemistryModel(sChemistry, SS, Comp, SThermo, GThermo) \
|
|
||||||
\
|
|
||||||
typedef Foam::SS<Foam::Comp, Foam::SThermo, Foam::GThermo> \
|
|
||||||
SS##Comp##SThermo##GThermo; \
|
|
||||||
\
|
|
||||||
defineTemplateTypeNameAndDebugWithName \
|
|
||||||
( \
|
|
||||||
SS##Comp##SThermo##GThermo, \
|
|
||||||
(Foam::word(SS##Comp##SThermo##GThermo::typeName_()) + "<"#Comp"," \
|
|
||||||
+ SThermo::typeName() + "," + GThermo::typeName() + ">").c_str(), \
|
|
||||||
0 \
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,664 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2013-2019 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/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "pyrolysisChemistryModel.H"
|
|
||||||
#include "SolidReaction.H"
|
|
||||||
#include "basicThermo.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo, class GasThermo>
|
|
||||||
Foam::pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::
|
|
||||||
pyrolysisChemistryModel
|
|
||||||
(
|
|
||||||
typename CompType::reactionThermo& thermo
|
|
||||||
)
|
|
||||||
:
|
|
||||||
solidChemistryModel<CompType, SolidThermo>(thermo),
|
|
||||||
pyrolisisGases_
|
|
||||||
(
|
|
||||||
dynamic_cast<const SolidReaction<SolidThermo>&>
|
|
||||||
(
|
|
||||||
this->reactions_[0]
|
|
||||||
).gasSpecies()
|
|
||||||
),
|
|
||||||
gasThermo_(pyrolisisGases_.size()),
|
|
||||||
nGases_(pyrolisisGases_.size()),
|
|
||||||
nSpecie_(this->Ys_.size() + nGases_),
|
|
||||||
RRg_(nGases_),
|
|
||||||
Ys0_(this->nSolids_)
|
|
||||||
{
|
|
||||||
// create the fields for the chemistry sources
|
|
||||||
forAll(this->RRs_, fieldi)
|
|
||||||
{
|
|
||||||
IOobject header
|
|
||||||
(
|
|
||||||
this->Ys_[fieldi].name() + "0",
|
|
||||||
this->mesh().time().timeName(),
|
|
||||||
this->mesh(),
|
|
||||||
IOobject::NO_READ
|
|
||||||
);
|
|
||||||
|
|
||||||
// check if field exists and can be read
|
|
||||||
if (header.typeHeaderOk<volScalarField>(true))
|
|
||||||
{
|
|
||||||
Ys0_.set
|
|
||||||
(
|
|
||||||
fieldi,
|
|
||||||
new volScalarField
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
this->Ys_[fieldi].name() + "0",
|
|
||||||
this->mesh().time().timeName(),
|
|
||||||
this->mesh(),
|
|
||||||
IOobject::MUST_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
this->mesh()
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
volScalarField Y0Default
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"Y0Default",
|
|
||||||
this->mesh().time().timeName(),
|
|
||||||
this->mesh(),
|
|
||||||
IOobject::MUST_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
this->mesh()
|
|
||||||
);
|
|
||||||
|
|
||||||
Ys0_.set
|
|
||||||
(
|
|
||||||
fieldi,
|
|
||||||
new volScalarField
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
this->Ys_[fieldi].name() + "0",
|
|
||||||
this->mesh().time().timeName(),
|
|
||||||
this->mesh(),
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
Y0Default
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
// Calculate initial values of Ysi0 = rho*delta*Yi
|
|
||||||
Ys0_[fieldi].primitiveFieldRef() =
|
|
||||||
this->solidThermo().rho()
|
|
||||||
*max(this->Ys_[fieldi], scalar(0.001))*this->mesh().V();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
forAll(RRg_, fieldi)
|
|
||||||
{
|
|
||||||
RRg_.set
|
|
||||||
(
|
|
||||||
fieldi,
|
|
||||||
new volScalarField::Internal
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"RRg." + pyrolisisGases_[fieldi],
|
|
||||||
this->mesh().time().timeName(),
|
|
||||||
this->mesh(),
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
this->mesh(),
|
|
||||||
dimensionedScalar(dimMass/dimVolume/dimTime, 0)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
forAll(gasThermo_, gasI)
|
|
||||||
{
|
|
||||||
dictionary thermoDict =
|
|
||||||
this->mesh().template lookupObject<dictionary>
|
|
||||||
(
|
|
||||||
basicThermo::dictName
|
|
||||||
).subDict(pyrolisisGases_[gasI]);
|
|
||||||
|
|
||||||
gasThermo_.set
|
|
||||||
(
|
|
||||||
gasI,
|
|
||||||
new GasThermo(thermoDict)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Info<< "pyrolysisChemistryModel: " << nl;
|
|
||||||
Info<< indent << "Number of solids = " << this->nSolids_ << nl;
|
|
||||||
Info<< indent << "Number of gases = " << nGases_ << nl;
|
|
||||||
forAll(this->reactions_, i)
|
|
||||||
{
|
|
||||||
Info<< dynamic_cast<const SolidReaction<SolidThermo>&>
|
|
||||||
(
|
|
||||||
this->reactions_[i]
|
|
||||||
) << nl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo, class GasThermo>
|
|
||||||
Foam::pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::
|
|
||||||
~pyrolysisChemistryModel()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo, class GasThermo>
|
|
||||||
Foam::scalarField Foam::
|
|
||||||
pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::omega
|
|
||||||
(
|
|
||||||
const scalar p,
|
|
||||||
const scalar T,
|
|
||||||
const scalarField& c,
|
|
||||||
const label li,
|
|
||||||
const bool updateC0
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
scalar pf, cf, pr, cr;
|
|
||||||
label lRef, rRef;
|
|
||||||
|
|
||||||
scalarField om(nEqns(), 0.0);
|
|
||||||
|
|
||||||
forAll(this->reactions_, i)
|
|
||||||
{
|
|
||||||
const SolidReaction<SolidThermo>& R =
|
|
||||||
dynamic_cast<const SolidReaction<SolidThermo>&>
|
|
||||||
(
|
|
||||||
this->reactions_[i]
|
|
||||||
);
|
|
||||||
|
|
||||||
scalar omegai = omega
|
|
||||||
(
|
|
||||||
R, p, T, c, li, pf, cf, lRef, pr, cr, rRef
|
|
||||||
);
|
|
||||||
scalar rhoL = 0.0;
|
|
||||||
forAll(R.lhs(), s)
|
|
||||||
{
|
|
||||||
label si = R.lhs()[s].index;
|
|
||||||
om[si] -= omegai;
|
|
||||||
rhoL = this->solidThermo_[si].rho(p, T);
|
|
||||||
}
|
|
||||||
scalar sr = 0.0;
|
|
||||||
forAll(R.rhs(), s)
|
|
||||||
{
|
|
||||||
label si = R.rhs()[s].index;
|
|
||||||
scalar rhoR = this->solidThermo_[si].rho(p, T);
|
|
||||||
sr = rhoR/rhoL;
|
|
||||||
om[si] += sr*omegai;
|
|
||||||
|
|
||||||
if (updateC0)
|
|
||||||
{
|
|
||||||
Ys0_[si][li] += sr*omegai;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
forAll(R.grhs(), g)
|
|
||||||
{
|
|
||||||
label gi = R.grhs()[g].index;
|
|
||||||
om[gi + this->nSolids_] += (1.0 - sr)*omegai;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return om;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo, class GasThermo>
|
|
||||||
Foam::scalar
|
|
||||||
Foam::pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::omega
|
|
||||||
(
|
|
||||||
const Reaction<SolidThermo>& R,
|
|
||||||
const scalar p,
|
|
||||||
const scalar T,
|
|
||||||
const scalarField& c,
|
|
||||||
const label li,
|
|
||||||
scalar& pf,
|
|
||||||
scalar& cf,
|
|
||||||
label& lRef,
|
|
||||||
scalar& pr,
|
|
||||||
scalar& cr,
|
|
||||||
label& rRef
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
scalarField c1(nSpecie_, 0.0);
|
|
||||||
|
|
||||||
for (label i=0; i<nSpecie_; i++)
|
|
||||||
{
|
|
||||||
c1[i] = max(0.0, c[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar kf = R.kf(p, T, c1, li);
|
|
||||||
|
|
||||||
const label Nl = R.lhs().size();
|
|
||||||
|
|
||||||
for (label s=0; s<Nl; s++)
|
|
||||||
{
|
|
||||||
label si = R.lhs()[s].index;
|
|
||||||
const scalar exp = R.lhs()[si].exponent;
|
|
||||||
|
|
||||||
kf *=
|
|
||||||
pow(c1[si]/Ys0_[si][li], exp)
|
|
||||||
*(Ys0_[si][li]);
|
|
||||||
}
|
|
||||||
|
|
||||||
return kf;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo, class GasThermo>
|
|
||||||
Foam::scalar Foam::pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::
|
|
||||||
omegaI
|
|
||||||
(
|
|
||||||
const label index,
|
|
||||||
const scalar p,
|
|
||||||
const scalar T,
|
|
||||||
const scalarField& c,
|
|
||||||
const label li,
|
|
||||||
scalar& pf,
|
|
||||||
scalar& cf,
|
|
||||||
label& lRef,
|
|
||||||
scalar& pr,
|
|
||||||
scalar& cr,
|
|
||||||
label& rRef
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
|
|
||||||
const Reaction<SolidThermo>& R = this->reactions_[index];
|
|
||||||
scalar w = omega(R, p, T, c, li, pf, cf, lRef, pr, cr, rRef);
|
|
||||||
return(w);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo, class GasThermo>
|
|
||||||
void Foam::pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::
|
|
||||||
derivatives
|
|
||||||
(
|
|
||||||
const scalar time,
|
|
||||||
const scalarField& c,
|
|
||||||
const label li,
|
|
||||||
scalarField& dcdt
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
const scalar T = c[nSpecie_];
|
|
||||||
const scalar p = c[nSpecie_ + 1];
|
|
||||||
|
|
||||||
dcdt = 0.0;
|
|
||||||
|
|
||||||
dcdt = omega(p, T, c, li);
|
|
||||||
|
|
||||||
// Total mass concentration
|
|
||||||
scalar cTot = 0.0;
|
|
||||||
for (label i=0; i<this->nSolids_; i++)
|
|
||||||
{
|
|
||||||
cTot += c[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar newCp = 0.0;
|
|
||||||
scalar newhi = 0.0;
|
|
||||||
for (label i=0; i<this->nSolids_; i++)
|
|
||||||
{
|
|
||||||
scalar dYidt = dcdt[i]/cTot;
|
|
||||||
scalar Yi = c[i]/cTot;
|
|
||||||
newCp += Yi*this->solidThermo_[i].Cp(p, T);
|
|
||||||
newhi -= dYidt*this->solidThermo_[i].Hc();
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar dTdt = newhi/newCp;
|
|
||||||
scalar dtMag = min(500.0, mag(dTdt));
|
|
||||||
dcdt[nSpecie_] = dTdt*dtMag/(mag(dTdt) + 1.0e-10);
|
|
||||||
|
|
||||||
// dp/dt = ...
|
|
||||||
dcdt[nSpecie_ + 1] = 0.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo, class GasThermo>
|
|
||||||
void Foam::pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::
|
|
||||||
jacobian
|
|
||||||
(
|
|
||||||
const scalar t,
|
|
||||||
const scalarField& c,
|
|
||||||
const label li,
|
|
||||||
scalarField& dcdt,
|
|
||||||
scalarSquareMatrix& dfdc
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
const scalar T = c[nSpecie_];
|
|
||||||
const scalar p = c[nSpecie_ + 1];
|
|
||||||
|
|
||||||
scalarField c2(nSpecie_, 0.0);
|
|
||||||
|
|
||||||
for (label i=0; i<this->nSolids_; i++)
|
|
||||||
{
|
|
||||||
c2[i] = max(c[i], 0.0);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (label i=0; i<nEqns(); i++)
|
|
||||||
{
|
|
||||||
for (label j=0; j<nEqns(); j++)
|
|
||||||
{
|
|
||||||
dfdc(i, j) = 0.0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// length of the first argument must be nSolids
|
|
||||||
dcdt = omega(p, T, c2, li);
|
|
||||||
|
|
||||||
for (label ri=0; ri<this->reactions_.size(); ri++)
|
|
||||||
{
|
|
||||||
const Reaction<SolidThermo>& R = this->reactions_[ri];
|
|
||||||
|
|
||||||
scalar kf0 = R.kf(p, T, c2, li);
|
|
||||||
|
|
||||||
forAll(R.lhs(), j)
|
|
||||||
{
|
|
||||||
label sj = R.lhs()[j].index;
|
|
||||||
scalar kf = kf0;
|
|
||||||
forAll(R.lhs(), i)
|
|
||||||
{
|
|
||||||
label si = R.lhs()[i].index;
|
|
||||||
scalar exp = R.lhs()[i].exponent;
|
|
||||||
if (i == j)
|
|
||||||
{
|
|
||||||
if (exp < 1.0)
|
|
||||||
{
|
|
||||||
if (c2[si] > small)
|
|
||||||
{
|
|
||||||
kf *= exp*pow(c2[si], exp - 1.0);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
kf = 0.0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
kf *= exp*pow(c2[si], exp - 1.0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Info<< "Solid reactions have only elements on slhs"
|
|
||||||
<< endl;
|
|
||||||
kf = 0.0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
forAll(R.lhs(), i)
|
|
||||||
{
|
|
||||||
label si = R.lhs()[i].index;
|
|
||||||
dfdc[si][sj] -= kf;
|
|
||||||
}
|
|
||||||
forAll(R.rhs(), i)
|
|
||||||
{
|
|
||||||
label si = R.rhs()[i].index;
|
|
||||||
dfdc[si][sj] += kf;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// calculate the dcdT elements numerically
|
|
||||||
scalar delta = 1.0e-8;
|
|
||||||
scalarField dcdT0 = omega(p , T - delta, c2, li);
|
|
||||||
scalarField dcdT1 = omega(p, T + delta, c2, li);
|
|
||||||
|
|
||||||
for (label i=0; i<nEqns(); i++)
|
|
||||||
{
|
|
||||||
dfdc[i][nSpecie_] = 0.5*(dcdT1[i] - dcdT0[i])/delta;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo, class GasThermo>
|
|
||||||
Foam::label Foam::
|
|
||||||
pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::nEqns() const
|
|
||||||
{
|
|
||||||
// nEqns = number of solids + gases + temperature + pressure
|
|
||||||
return (nSpecie_ + 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo, class GasThermo>
|
|
||||||
void Foam::pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::
|
|
||||||
calculate()
|
|
||||||
{
|
|
||||||
if (!this->chemistry_)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const volScalarField rho
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"rho",
|
|
||||||
this->time().timeName(),
|
|
||||||
this->mesh(),
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE,
|
|
||||||
false
|
|
||||||
),
|
|
||||||
this->solidThermo().rho()
|
|
||||||
);
|
|
||||||
|
|
||||||
forAll(this->RRs_, i)
|
|
||||||
{
|
|
||||||
this->RRs_[i].field() = 0.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
forAll(RRg_, i)
|
|
||||||
{
|
|
||||||
RRg_[i].field() = 0.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
forAll(rho, celli)
|
|
||||||
{
|
|
||||||
const scalar delta = this->mesh().V()[celli];
|
|
||||||
|
|
||||||
if (this->reactingCells_[celli])
|
|
||||||
{
|
|
||||||
scalar rhoi = rho[celli];
|
|
||||||
scalar Ti = this->solidThermo().T()[celli];
|
|
||||||
scalar pi = this->solidThermo().p()[celli];
|
|
||||||
|
|
||||||
scalarField c(nSpecie_, 0.0);
|
|
||||||
for (label i=0; i<this->nSolids_; i++)
|
|
||||||
{
|
|
||||||
c[i] = rhoi*this->Ys_[i][celli]*delta;
|
|
||||||
}
|
|
||||||
|
|
||||||
const scalarField dcdt = omega(pi, Ti, c, celli, true);
|
|
||||||
|
|
||||||
forAll(this->RRs_, i)
|
|
||||||
{
|
|
||||||
this->RRs_[i][celli] = dcdt[i]/delta;
|
|
||||||
}
|
|
||||||
|
|
||||||
forAll(RRg_, i)
|
|
||||||
{
|
|
||||||
RRg_[i][celli] = dcdt[this->nSolids_ + i]/delta;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo, class GasThermo>
|
|
||||||
Foam::scalar
|
|
||||||
Foam::pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::solve
|
|
||||||
(
|
|
||||||
const scalar deltaT
|
|
||||||
)
|
|
||||||
{
|
|
||||||
scalar deltaTMin = great;
|
|
||||||
|
|
||||||
if (!this->chemistry_)
|
|
||||||
{
|
|
||||||
return deltaTMin;
|
|
||||||
}
|
|
||||||
|
|
||||||
const volScalarField rho
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"rho",
|
|
||||||
this->time().timeName(),
|
|
||||||
this->mesh(),
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE,
|
|
||||||
false
|
|
||||||
),
|
|
||||||
this->solidThermo().rho()
|
|
||||||
);
|
|
||||||
|
|
||||||
forAll(this->RRs_, i)
|
|
||||||
{
|
|
||||||
this->RRs_[i].field() = 0.0;
|
|
||||||
}
|
|
||||||
forAll(RRg_, i)
|
|
||||||
{
|
|
||||||
RRg_[i].field() = 0.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
const scalarField& T = this->solidThermo().T();
|
|
||||||
const scalarField& p = this->solidThermo().p();
|
|
||||||
|
|
||||||
scalarField c(nSpecie_, 0.0);
|
|
||||||
scalarField c0(nSpecie_, 0.0);
|
|
||||||
scalarField dc(nSpecie_, 0.0);
|
|
||||||
scalarField delta(this->mesh().V());
|
|
||||||
|
|
||||||
forAll(rho, celli)
|
|
||||||
{
|
|
||||||
if (this->reactingCells_[celli])
|
|
||||||
{
|
|
||||||
scalar rhoi = rho[celli];
|
|
||||||
scalar pi = p[celli];
|
|
||||||
scalar Ti = T[celli];
|
|
||||||
|
|
||||||
for (label i=0; i<this->nSolids_; i++)
|
|
||||||
{
|
|
||||||
c[i] = rhoi*this->Ys_[i][celli]*delta[celli];
|
|
||||||
}
|
|
||||||
|
|
||||||
c0 = c;
|
|
||||||
|
|
||||||
// Initialise time progress
|
|
||||||
scalar timeLeft = deltaT;
|
|
||||||
|
|
||||||
// calculate the chemical source terms
|
|
||||||
while (timeLeft > small)
|
|
||||||
{
|
|
||||||
scalar dt = timeLeft;
|
|
||||||
this->solve(pi, Ti, c, celli, dt, this->deltaTChem_[celli]);
|
|
||||||
timeLeft -= dt;
|
|
||||||
}
|
|
||||||
|
|
||||||
deltaTMin = min(this->deltaTChem_[celli], deltaTMin);
|
|
||||||
dc = c - c0;
|
|
||||||
|
|
||||||
forAll(this->RRs_, i)
|
|
||||||
{
|
|
||||||
this->RRs_[i][celli] = dc[i]/(deltaT*delta[celli]);
|
|
||||||
}
|
|
||||||
|
|
||||||
forAll(RRg_, i)
|
|
||||||
{
|
|
||||||
RRg_[i][celli] = dc[this->nSolids_ + i]/(deltaT*delta[celli]);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update Ys0_
|
|
||||||
dc = omega(pi, Ti, c0, celli, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Don't allow the time-step to change more than a factor of 2
|
|
||||||
deltaTMin = min(deltaTMin, 2*deltaT);
|
|
||||||
|
|
||||||
return deltaTMin;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo,class GasThermo>
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::gasHs
|
|
||||||
(
|
|
||||||
const volScalarField& p,
|
|
||||||
const volScalarField& T,
|
|
||||||
const label index
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
tmp<volScalarField> tHs
|
|
||||||
(
|
|
||||||
volScalarField::New
|
|
||||||
(
|
|
||||||
"Hs_" + pyrolisisGases_[index],
|
|
||||||
this->mesh_,
|
|
||||||
dimensionedScalar(dimEnergy/dimMass, 0)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
volScalarField::Internal& gasHs = tHs.ref();
|
|
||||||
|
|
||||||
const GasThermo& mixture = gasThermo_[index];
|
|
||||||
|
|
||||||
forAll(gasHs, celli)
|
|
||||||
{
|
|
||||||
gasHs[celli] = mixture.Hs(p[celli], T[celli]);
|
|
||||||
}
|
|
||||||
|
|
||||||
return tHs;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo, class GasThermo>
|
|
||||||
void Foam::pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::solve
|
|
||||||
(
|
|
||||||
scalar& p,
|
|
||||||
scalar& T,
|
|
||||||
scalarField& c,
|
|
||||||
const label li,
|
|
||||||
scalar& deltaT,
|
|
||||||
scalar& subDeltaT
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
NotImplemented;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,256 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2013-2019 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/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::pyrolysisChemistryModel
|
|
||||||
|
|
||||||
Description
|
|
||||||
Pyrolysis chemistry model. It includes gas phase in the solid
|
|
||||||
reaction.
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
pyrolysisChemistryModelI.H
|
|
||||||
pyrolysisChemistryModel.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef pyrolysisChemistryModel_H
|
|
||||||
#define pyrolysisChemistryModel_H
|
|
||||||
|
|
||||||
#include "volFieldsFwd.H"
|
|
||||||
#include "DimensionedField.H"
|
|
||||||
#include "solidChemistryModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// Forward declaration of classes
|
|
||||||
class fvMesh;
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class pyrolysisChemistryModel Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo, class GasThermo>
|
|
||||||
class pyrolysisChemistryModel
|
|
||||||
:
|
|
||||||
public solidChemistryModel<CompType, SolidThermo>
|
|
||||||
{
|
|
||||||
protected:
|
|
||||||
|
|
||||||
//- List of gas species present in reaction system
|
|
||||||
speciesTable pyrolisisGases_;
|
|
||||||
|
|
||||||
//- Thermodynamic data of gases
|
|
||||||
PtrList<GasThermo> gasThermo_;
|
|
||||||
|
|
||||||
//- Number of gas species
|
|
||||||
label nGases_;
|
|
||||||
|
|
||||||
//- Number of components being solved by ODE
|
|
||||||
label nSpecie_;
|
|
||||||
|
|
||||||
//- List of reaction rate per gas [kg/m^3/s]
|
|
||||||
PtrList<volScalarField::Internal> RRg_;
|
|
||||||
|
|
||||||
|
|
||||||
// Protected Member Functions
|
|
||||||
|
|
||||||
//- Write access to source terms for gases
|
|
||||||
inline PtrList<volScalarField::Internal>& RRg();
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
//- List of accumulative solid concentrations
|
|
||||||
mutable PtrList<volScalarField> Ys0_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("pyrolysis");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from thermo
|
|
||||||
pyrolysisChemistryModel(typename CompType::reactionThermo& thermo);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~pyrolysisChemistryModel();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Thermodynamic data of gases
|
|
||||||
inline const PtrList<GasThermo>& gasThermo() const;
|
|
||||||
|
|
||||||
//- Gases table
|
|
||||||
inline const speciesTable& gasTable() const;
|
|
||||||
|
|
||||||
//- The number of solids
|
|
||||||
inline label nSpecie() const;
|
|
||||||
|
|
||||||
//- The number of solids
|
|
||||||
inline label nGases() const;
|
|
||||||
|
|
||||||
|
|
||||||
//- dc/dt = omega, rate of change in concentration, for each species
|
|
||||||
virtual scalarField omega
|
|
||||||
(
|
|
||||||
const scalar p,
|
|
||||||
const scalar T,
|
|
||||||
const scalarField& c,
|
|
||||||
const label li,
|
|
||||||
const bool updateC0 = false
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Return the reaction rate for reaction r
|
|
||||||
// NOTE: Currently does not calculate reference specie and
|
|
||||||
// characteristic times (pf, cf,l Ref, etc.)
|
|
||||||
virtual scalar omega
|
|
||||||
(
|
|
||||||
const Reaction<SolidThermo>& r,
|
|
||||||
const scalar p,
|
|
||||||
const scalar T,
|
|
||||||
const scalarField& c,
|
|
||||||
const label li,
|
|
||||||
scalar& pf,
|
|
||||||
scalar& cf,
|
|
||||||
label& lRef,
|
|
||||||
scalar& pr,
|
|
||||||
scalar& cr,
|
|
||||||
label& rRef
|
|
||||||
) const;
|
|
||||||
|
|
||||||
|
|
||||||
//- Return the reaction rate for iReaction
|
|
||||||
// NOTE: Currently does not calculate reference specie and
|
|
||||||
// characteristic times (pf, cf,l Ref, etc.)
|
|
||||||
virtual scalar omegaI
|
|
||||||
(
|
|
||||||
label iReaction,
|
|
||||||
const scalar p,
|
|
||||||
const scalar T,
|
|
||||||
const scalarField& c,
|
|
||||||
const label li,
|
|
||||||
scalar& pf,
|
|
||||||
scalar& cf,
|
|
||||||
label& lRef,
|
|
||||||
scalar& pr,
|
|
||||||
scalar& cr,
|
|
||||||
label& rRef
|
|
||||||
) const;
|
|
||||||
|
|
||||||
|
|
||||||
//- Calculates the reaction rates
|
|
||||||
virtual void calculate();
|
|
||||||
|
|
||||||
|
|
||||||
// Chemistry model functions
|
|
||||||
|
|
||||||
//- Return const access to the chemical source terms for gases
|
|
||||||
inline const volScalarField::Internal& RRg
|
|
||||||
(
|
|
||||||
const label i
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Return total gas source term
|
|
||||||
inline tmp<volScalarField::Internal> RRg() const;
|
|
||||||
|
|
||||||
//- Return sensible enthalpy for gas i [J/Kg]
|
|
||||||
virtual tmp<volScalarField> gasHs
|
|
||||||
(
|
|
||||||
const volScalarField& p,
|
|
||||||
const volScalarField& T,
|
|
||||||
const label i
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Solve the reaction system for the given time step
|
|
||||||
// and return the characteristic time
|
|
||||||
virtual scalar solve(const scalar deltaT);
|
|
||||||
|
|
||||||
|
|
||||||
// ODE functions (overriding abstract functions in ODE.H)
|
|
||||||
|
|
||||||
//- Number of ODE's to solve
|
|
||||||
virtual label nEqns() const;
|
|
||||||
|
|
||||||
virtual void derivatives
|
|
||||||
(
|
|
||||||
const scalar t,
|
|
||||||
const scalarField& c,
|
|
||||||
const label li,
|
|
||||||
scalarField& dcdt
|
|
||||||
) const;
|
|
||||||
|
|
||||||
virtual void jacobian
|
|
||||||
(
|
|
||||||
const scalar t,
|
|
||||||
const scalarField& c,
|
|
||||||
const label li,
|
|
||||||
scalarField& dcdt,
|
|
||||||
scalarSquareMatrix& dfdc
|
|
||||||
) const;
|
|
||||||
|
|
||||||
virtual void solve
|
|
||||||
(
|
|
||||||
scalar& p,
|
|
||||||
scalar& T,
|
|
||||||
scalarField& c,
|
|
||||||
const label li,
|
|
||||||
scalar& deltaT,
|
|
||||||
scalar& subDeltaT
|
|
||||||
) const;
|
|
||||||
|
|
||||||
|
|
||||||
// Member Operators
|
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
|
||||||
void operator=(const pyrolysisChemistryModel&) = delete;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#include "pyrolysisChemistryModelI.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#ifdef NoRepository
|
|
||||||
#include "pyrolysisChemistryModel.C"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,105 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2013-2018 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/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "volFields.H"
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo, class GasThermo>
|
|
||||||
inline Foam::PtrList<Foam::DimensionedField<Foam::scalar, Foam::volMesh>>&
|
|
||||||
Foam::pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::RRg()
|
|
||||||
{
|
|
||||||
return RRg_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo, class GasThermo>
|
|
||||||
inline const Foam::PtrList<GasThermo>&
|
|
||||||
Foam::pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::
|
|
||||||
gasThermo() const
|
|
||||||
{
|
|
||||||
return gasThermo_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo, class GasThermo>
|
|
||||||
inline const Foam::speciesTable&
|
|
||||||
Foam::pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::
|
|
||||||
gasTable() const
|
|
||||||
{
|
|
||||||
return pyrolisisGases_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo, class GasThermo>
|
|
||||||
inline Foam::label
|
|
||||||
Foam::pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::
|
|
||||||
nSpecie() const
|
|
||||||
{
|
|
||||||
return nSpecie_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo, class GasThermo>
|
|
||||||
inline const Foam::DimensionedField<Foam::scalar, Foam::volMesh>&
|
|
||||||
Foam::pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::RRg
|
|
||||||
(
|
|
||||||
const label i
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return RRg_[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo, class GasThermo>
|
|
||||||
inline Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh>>
|
|
||||||
Foam::pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::
|
|
||||||
RRg() const
|
|
||||||
{
|
|
||||||
tmp<volScalarField::Internal> tRRg
|
|
||||||
(
|
|
||||||
volScalarField::Internal::New
|
|
||||||
(
|
|
||||||
"RRg",
|
|
||||||
this->mesh(),
|
|
||||||
dimensionedScalar(dimMass/dimVolume/dimTime, 0)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (this->chemistry_)
|
|
||||||
{
|
|
||||||
volScalarField::Internal& RRg = tRRg.ref();
|
|
||||||
for (label i=0; i < nGases_; i++)
|
|
||||||
{
|
|
||||||
RRg += RRg_[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return tRRg;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,158 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2019 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/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "solidChemistryModel.H"
|
|
||||||
#include "multiComponentMixture.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo>
|
|
||||||
Foam::solidChemistryModel<CompType, SolidThermo>::solidChemistryModel
|
|
||||||
(
|
|
||||||
typename CompType::reactionThermo& thermo
|
|
||||||
)
|
|
||||||
:
|
|
||||||
CompType(thermo),
|
|
||||||
ODESystem(),
|
|
||||||
Ys_(this->solidThermo().composition().Y()),
|
|
||||||
solidThermo_
|
|
||||||
(
|
|
||||||
dynamic_cast<const multiComponentMixture<SolidThermo>&>
|
|
||||||
(
|
|
||||||
this->solidThermo()
|
|
||||||
).speciesData()
|
|
||||||
),
|
|
||||||
reactions_
|
|
||||||
(
|
|
||||||
dynamic_cast<const multiComponentMixture<SolidThermo>&>
|
|
||||||
(
|
|
||||||
this->solidThermo()
|
|
||||||
).species(),
|
|
||||||
solidThermo_,
|
|
||||||
this->mesh(),
|
|
||||||
*this
|
|
||||||
),
|
|
||||||
nSolids_(Ys_.size()),
|
|
||||||
nReaction_(reactions_.size()),
|
|
||||||
RRs_(nSolids_),
|
|
||||||
reactingCells_(this->mesh().nCells(), true)
|
|
||||||
{
|
|
||||||
// create the fields for the chemistry sources
|
|
||||||
forAll(RRs_, fieldi)
|
|
||||||
{
|
|
||||||
RRs_.set
|
|
||||||
(
|
|
||||||
fieldi,
|
|
||||||
new volScalarField::Internal
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"RRs." + Ys_[fieldi].name(),
|
|
||||||
this->mesh().time().timeName(),
|
|
||||||
this->mesh(),
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
this->mesh(),
|
|
||||||
dimensionedScalar(dimMass/dimVolume/dimTime, 0)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo>
|
|
||||||
Foam::solidChemistryModel<CompType, SolidThermo>::
|
|
||||||
~solidChemistryModel()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo>
|
|
||||||
Foam::scalar Foam::solidChemistryModel<CompType, SolidThermo>::solve
|
|
||||||
(
|
|
||||||
const scalarField& deltaT
|
|
||||||
)
|
|
||||||
{
|
|
||||||
NotImplemented;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo>
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::solidChemistryModel<CompType, SolidThermo>::tc() const
|
|
||||||
{
|
|
||||||
NotImplemented;
|
|
||||||
return volScalarField::null();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo>
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::solidChemistryModel<CompType, SolidThermo>::Qdot() const
|
|
||||||
{
|
|
||||||
tmp<volScalarField> tQdot
|
|
||||||
(
|
|
||||||
volScalarField::New
|
|
||||||
(
|
|
||||||
"Qdot",
|
|
||||||
this->mesh_,
|
|
||||||
dimensionedScalar(dimEnergy/dimVolume/dimTime, 0)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (this->chemistry_)
|
|
||||||
{
|
|
||||||
scalarField& Qdot = tQdot.ref();
|
|
||||||
|
|
||||||
forAll(Ys_, i)
|
|
||||||
{
|
|
||||||
forAll(Qdot, celli)
|
|
||||||
{
|
|
||||||
scalar hf = solidThermo_[i].Hc();
|
|
||||||
Qdot[celli] -= hf*RRs_[i][celli];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return tQdot;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo>
|
|
||||||
void Foam::solidChemistryModel<CompType, SolidThermo>::setCellReacting
|
|
||||||
(
|
|
||||||
const label celli,
|
|
||||||
const bool active
|
|
||||||
)
|
|
||||||
{
|
|
||||||
reactingCells_[celli] = active;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,258 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2013-2019 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/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::solidChemistryModel
|
|
||||||
|
|
||||||
Description
|
|
||||||
Extends base solid chemistry model by adding a thermo package, and ODE
|
|
||||||
functions.
|
|
||||||
Introduces chemistry equation system and evaluation of chemical source
|
|
||||||
terms.
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
solidChemistryModelI.H
|
|
||||||
solidChemistryModel.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef solidChemistryModel_H
|
|
||||||
#define solidChemistryModel_H
|
|
||||||
|
|
||||||
#include "ReactionList.H"
|
|
||||||
#include "ODESystem.H"
|
|
||||||
#include "volFields.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// Forward declaration of classes
|
|
||||||
class fvMesh;
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class solidChemistryModel Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo>
|
|
||||||
class solidChemistryModel
|
|
||||||
:
|
|
||||||
public CompType,
|
|
||||||
public ODESystem
|
|
||||||
{
|
|
||||||
protected:
|
|
||||||
|
|
||||||
//- Reference to solid mass fractions
|
|
||||||
PtrList<volScalarField>& Ys_;
|
|
||||||
|
|
||||||
//- Thermodynamic data of solids
|
|
||||||
const PtrList<SolidThermo>& solidThermo_;
|
|
||||||
|
|
||||||
//- Reactions
|
|
||||||
const ReactionList<SolidThermo> reactions_;
|
|
||||||
|
|
||||||
//- Number of solid components
|
|
||||||
label nSolids_;
|
|
||||||
|
|
||||||
//- Number of solid reactions
|
|
||||||
label nReaction_;
|
|
||||||
|
|
||||||
//- List of reaction rate per solid [kg/m^3/s]
|
|
||||||
PtrList<volScalarField::Internal> RRs_;
|
|
||||||
|
|
||||||
//- List of active reacting cells
|
|
||||||
List<bool> reactingCells_;
|
|
||||||
|
|
||||||
|
|
||||||
// Protected Member Functions
|
|
||||||
|
|
||||||
//- Write access to source terms for solids
|
|
||||||
inline PtrList<volScalarField::Internal>& RRs();
|
|
||||||
|
|
||||||
//- Set reacting status of cell, celli
|
|
||||||
void setCellReacting(const label celli, const bool active);
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("solidChemistryModel");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from thermo
|
|
||||||
solidChemistryModel(typename CompType::reactionThermo& thermo);
|
|
||||||
|
|
||||||
//- Disallow default bitwise copy construction
|
|
||||||
solidChemistryModel(const solidChemistryModel&);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~solidChemistryModel();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- The reactions
|
|
||||||
inline const PtrList<Reaction<SolidThermo>>& reactions() const;
|
|
||||||
|
|
||||||
//- The number of reactions
|
|
||||||
inline label nReaction() const;
|
|
||||||
|
|
||||||
|
|
||||||
//- dc/dt = omega, rate of change in concentration, for each species
|
|
||||||
virtual scalarField omega
|
|
||||||
(
|
|
||||||
const scalar p,
|
|
||||||
const scalar T,
|
|
||||||
const scalarField& c,
|
|
||||||
const label li,
|
|
||||||
const bool updateC0 = false
|
|
||||||
) const = 0;
|
|
||||||
|
|
||||||
//- Return the reaction rate for reaction r and the reference
|
|
||||||
// species and charateristic times
|
|
||||||
virtual scalar omega
|
|
||||||
(
|
|
||||||
const Reaction<SolidThermo>& r,
|
|
||||||
const scalar p,
|
|
||||||
const scalar T,
|
|
||||||
const scalarField& c,
|
|
||||||
const label li,
|
|
||||||
scalar& pf,
|
|
||||||
scalar& cf,
|
|
||||||
label& lRef,
|
|
||||||
scalar& pr,
|
|
||||||
scalar& cr,
|
|
||||||
label& rRef
|
|
||||||
) const = 0;
|
|
||||||
|
|
||||||
|
|
||||||
//- Return the reaction rate for iReaction and the reference
|
|
||||||
// species and charateristic times
|
|
||||||
virtual scalar omegaI
|
|
||||||
(
|
|
||||||
label iReaction,
|
|
||||||
const scalar p,
|
|
||||||
const scalar T,
|
|
||||||
const scalarField& c,
|
|
||||||
const label li,
|
|
||||||
scalar& pf,
|
|
||||||
scalar& cf,
|
|
||||||
label& lRef,
|
|
||||||
scalar& pr,
|
|
||||||
scalar& cr,
|
|
||||||
label& rRef
|
|
||||||
) const = 0;
|
|
||||||
|
|
||||||
//- Calculates the reaction rates
|
|
||||||
virtual void calculate() = 0;
|
|
||||||
|
|
||||||
|
|
||||||
// Solid Chemistry model functions
|
|
||||||
|
|
||||||
//- Return const access to the chemical source terms for solids
|
|
||||||
inline const volScalarField::Internal& RRs
|
|
||||||
(
|
|
||||||
const label i
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Return total solid source term
|
|
||||||
inline tmp<volScalarField::Internal> RRs() const;
|
|
||||||
|
|
||||||
//- Solve the reaction system for the given time step
|
|
||||||
// and return the characteristic time
|
|
||||||
virtual scalar solve(const scalar deltaT) = 0;
|
|
||||||
|
|
||||||
//- Solve the reaction system for the given time step
|
|
||||||
// and return the characteristic time
|
|
||||||
virtual scalar solve(const scalarField& deltaT);
|
|
||||||
|
|
||||||
//- Return the chemical time scale
|
|
||||||
virtual tmp<volScalarField> tc() const;
|
|
||||||
|
|
||||||
//- Return the heat release rate [kg/m/s^3]
|
|
||||||
virtual tmp<volScalarField> Qdot() const;
|
|
||||||
|
|
||||||
|
|
||||||
// ODE functions (overriding abstract functions in ODE.H)
|
|
||||||
|
|
||||||
//- Number of ODE's to solve
|
|
||||||
virtual label nEqns() const = 0;
|
|
||||||
|
|
||||||
virtual void derivatives
|
|
||||||
(
|
|
||||||
const scalar t,
|
|
||||||
const scalarField& c,
|
|
||||||
const label li,
|
|
||||||
scalarField& dcdt
|
|
||||||
) const = 0;
|
|
||||||
|
|
||||||
virtual void jacobian
|
|
||||||
(
|
|
||||||
const scalar t,
|
|
||||||
const scalarField& c,
|
|
||||||
const label li,
|
|
||||||
scalarField& dcdt,
|
|
||||||
scalarSquareMatrix& dfdc
|
|
||||||
) const = 0;
|
|
||||||
|
|
||||||
virtual void solve
|
|
||||||
(
|
|
||||||
scalar& p,
|
|
||||||
scalar& T,
|
|
||||||
scalarField& c,
|
|
||||||
const label li,
|
|
||||||
scalar& deltaT,
|
|
||||||
scalar& subDeltaT
|
|
||||||
) const = 0;
|
|
||||||
|
|
||||||
|
|
||||||
// Member Operators
|
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
|
||||||
void operator=(const solidChemistryModel&) = delete;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#include "solidChemistryModelI.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#ifdef NoRepository
|
|
||||||
#include "solidChemistryModel.C"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,91 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2013-2018 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/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "volFields.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo>
|
|
||||||
inline Foam::PtrList<Foam::DimensionedField<Foam::scalar, Foam::volMesh>>&
|
|
||||||
Foam::solidChemistryModel<CompType, SolidThermo>::RRs()
|
|
||||||
{
|
|
||||||
return RRs_;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo>
|
|
||||||
inline const Foam::PtrList<Foam::Reaction<SolidThermo>>&
|
|
||||||
Foam::solidChemistryModel<CompType, SolidThermo>::reactions() const
|
|
||||||
{
|
|
||||||
return reactions_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo>
|
|
||||||
inline Foam::label
|
|
||||||
Foam::solidChemistryModel<CompType, SolidThermo>::
|
|
||||||
nReaction() const
|
|
||||||
{
|
|
||||||
return nReaction_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo>
|
|
||||||
inline const Foam::DimensionedField<Foam::scalar, Foam::volMesh>&
|
|
||||||
Foam::solidChemistryModel<CompType, SolidThermo>::RRs
|
|
||||||
(
|
|
||||||
const label i
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return RRs_[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo>
|
|
||||||
inline Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh>>
|
|
||||||
Foam::solidChemistryModel<CompType, SolidThermo>::RRs() const
|
|
||||||
{
|
|
||||||
tmp<volScalarField::Internal> tRRs
|
|
||||||
(
|
|
||||||
volScalarField::Internal::New
|
|
||||||
(
|
|
||||||
"RRs",
|
|
||||||
this->mesh(),
|
|
||||||
dimensionedScalar(dimMass/dimVolume/dimTime, 0)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (this->chemistry_)
|
|
||||||
{
|
|
||||||
volScalarField::Internal& RRs = tRRs.ref();
|
|
||||||
for (label i=0; i < nSolids_; i++)
|
|
||||||
{
|
|
||||||
RRs += RRs_[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return tRRs;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,97 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2018 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/>.
|
|
||||||
|
|
||||||
Description
|
|
||||||
Macros for instantiating solid chemistry models based on compressibility
|
|
||||||
and transport types
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef makeSolidChemistrySolverType_H
|
|
||||||
#define makeSolidChemistrySolverType_H
|
|
||||||
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
#include "noChemistrySolver.H"
|
|
||||||
#include "EulerImplicit.H"
|
|
||||||
#include "ode.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#define makeSolidChemistrySolverType(SS, Schem, Comp, SThermo, GThermo) \
|
|
||||||
\
|
|
||||||
typedef SS<Schem<Comp, SThermo, GThermo>> \
|
|
||||||
SS##Schem##Comp##SThermo##GThermo; \
|
|
||||||
\
|
|
||||||
defineTemplateTypeNameAndDebugWithName \
|
|
||||||
( \
|
|
||||||
SS##Schem##Comp##SThermo##GThermo, \
|
|
||||||
(#SS"<" + word(Schem<Comp, SThermo, GThermo>::typeName_()) \
|
|
||||||
+ "<"#Comp"," + SThermo::typeName() \
|
|
||||||
+ "," + GThermo::typeName() + ">>").c_str(), \
|
|
||||||
0 \
|
|
||||||
); \
|
|
||||||
\
|
|
||||||
addToRunTimeSelectionTable \
|
|
||||||
( \
|
|
||||||
Comp, \
|
|
||||||
SS##Schem##Comp##SThermo##GThermo, \
|
|
||||||
thermo \
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
#define makeSolidChemistrySolverTypes(SolidChem, Comp, SThermo, GThermo) \
|
|
||||||
\
|
|
||||||
makeSolidChemistrySolverType \
|
|
||||||
( \
|
|
||||||
noChemistrySolver, \
|
|
||||||
SolidChem, \
|
|
||||||
Comp, \
|
|
||||||
SThermo, \
|
|
||||||
GThermo \
|
|
||||||
); \
|
|
||||||
\
|
|
||||||
makeSolidChemistrySolverType \
|
|
||||||
( \
|
|
||||||
ode, \
|
|
||||||
SolidChem, \
|
|
||||||
Comp, \
|
|
||||||
SThermo, \
|
|
||||||
GThermo \
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,63 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2018 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/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "makeSolidChemistrySolverType.H"
|
|
||||||
#include "solidThermoPhysicsTypes.H"
|
|
||||||
#include "thermoPhysicsTypes.H"
|
|
||||||
|
|
||||||
#include "pyrolysisChemistryModel.H"
|
|
||||||
#include "basicSolidChemistryModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
makeSolidChemistrySolverTypes
|
|
||||||
(
|
|
||||||
pyrolysisChemistryModel,
|
|
||||||
basicSolidChemistryModel,
|
|
||||||
hConstSolidThermoPhysics,
|
|
||||||
gasHThermoPhysics
|
|
||||||
)
|
|
||||||
|
|
||||||
makeSolidChemistrySolverTypes
|
|
||||||
(
|
|
||||||
pyrolysisChemistryModel,
|
|
||||||
basicSolidChemistryModel,
|
|
||||||
hPowerSolidThermoPhysics,
|
|
||||||
gasHThermoPhysics
|
|
||||||
)
|
|
||||||
|
|
||||||
makeSolidChemistrySolverTypes
|
|
||||||
(
|
|
||||||
pyrolysisChemistryModel,
|
|
||||||
basicSolidChemistryModel,
|
|
||||||
hExpKappaConstSolidThermoPhysics,
|
|
||||||
gasHThermoPhysics
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
reaction/reactions/makeSolidReactions.C
|
|
||||||
|
|
||||||
LIB = $(FOAM_LIBBIN)/libsolidSpecie
|
|
||||||
@ -1,192 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2019 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/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "SolidReaction.H"
|
|
||||||
#include "DynamicList.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class ReactionThermo>
|
|
||||||
Foam::SolidReaction<ReactionThermo>::SolidReaction
|
|
||||||
(
|
|
||||||
const Reaction<ReactionThermo>& reaction,
|
|
||||||
const speciesTable& pyrolisisGases,
|
|
||||||
const List<specieCoeffs>& glhs,
|
|
||||||
const List<specieCoeffs>& grhs
|
|
||||||
)
|
|
||||||
:
|
|
||||||
Reaction<ReactionThermo>(reaction),
|
|
||||||
pyrolisisGases_(pyrolisisGases),
|
|
||||||
glhs_(glhs),
|
|
||||||
grhs_(grhs)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
template<class ReactionThermo>
|
|
||||||
Foam::SolidReaction<ReactionThermo>::SolidReaction
|
|
||||||
(
|
|
||||||
const SolidReaction<ReactionThermo>& r,
|
|
||||||
const speciesTable& pyrolisisGases
|
|
||||||
)
|
|
||||||
:
|
|
||||||
Reaction<ReactionThermo>(r),
|
|
||||||
pyrolisisGases_(pyrolisisGases),
|
|
||||||
glhs_(r.glhs_),
|
|
||||||
grhs_(r.grhs_)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
template<class ReactionThermo>
|
|
||||||
Foam::SolidReaction<ReactionThermo>::SolidReaction
|
|
||||||
(
|
|
||||||
const speciesTable& species,
|
|
||||||
const HashPtrTable<ReactionThermo>& thermoDatabase,
|
|
||||||
const dictionary& dict
|
|
||||||
)
|
|
||||||
:
|
|
||||||
Reaction<ReactionThermo>(species, thermoDatabase, dict),
|
|
||||||
pyrolisisGases_(dict.parent().parent().lookup("gaseousSpecies")),
|
|
||||||
glhs_(),
|
|
||||||
grhs_()
|
|
||||||
{
|
|
||||||
specieCoeffs::setLRhs
|
|
||||||
(
|
|
||||||
IStringStream(dict.lookup("reaction"))(),
|
|
||||||
pyrolisisGases_,
|
|
||||||
glhs_,
|
|
||||||
grhs_
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class ReactionThermo>
|
|
||||||
const Foam::List<Foam::specieCoeffs>&
|
|
||||||
Foam::SolidReaction<ReactionThermo>::glhs() const
|
|
||||||
{
|
|
||||||
return glhs_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class ReactionThermo>
|
|
||||||
const Foam::List<Foam::specieCoeffs>&
|
|
||||||
Foam::SolidReaction<ReactionThermo>::grhs() const
|
|
||||||
{
|
|
||||||
return grhs_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class ReactionThermo>
|
|
||||||
const Foam::speciesTable& Foam::SolidReaction<ReactionThermo>::
|
|
||||||
gasSpecies() const
|
|
||||||
{
|
|
||||||
return pyrolisisGases_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class ReactionThermo>
|
|
||||||
void Foam::SolidReaction<ReactionThermo>::write(Ostream& os) const
|
|
||||||
{
|
|
||||||
OStringStream reaction;
|
|
||||||
writeEntry(os, "reaction", solidReactionStr(reaction));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class ReactionThermo>
|
|
||||||
Foam::string Foam::SolidReaction<ReactionThermo>::solidReactionStr
|
|
||||||
(
|
|
||||||
OStringStream& reaction
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
specieCoeffs::reactionStr(reaction, this->species(), this->lhs());
|
|
||||||
if (glhs().size() > 0)
|
|
||||||
{
|
|
||||||
reaction << " + ";
|
|
||||||
solidReactionStrLeft(reaction);
|
|
||||||
}
|
|
||||||
reaction << " = ";
|
|
||||||
specieCoeffs::reactionStr(reaction, this->species(), this->rhs());
|
|
||||||
if (grhs().size() > 0)
|
|
||||||
{
|
|
||||||
reaction << " + ";
|
|
||||||
solidReactionStrRight(reaction);
|
|
||||||
}
|
|
||||||
return reaction.str();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class ReactionThermo>
|
|
||||||
void Foam::SolidReaction<ReactionThermo>::solidReactionStrLeft
|
|
||||||
(
|
|
||||||
OStringStream& reaction
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
for (label i = 0; i < glhs().size(); ++i)
|
|
||||||
{
|
|
||||||
if (i > 0)
|
|
||||||
{
|
|
||||||
reaction << " + ";
|
|
||||||
}
|
|
||||||
if (mag(glhs()[i].stoichCoeff - 1) > small)
|
|
||||||
{
|
|
||||||
reaction << glhs()[i].stoichCoeff;
|
|
||||||
}
|
|
||||||
reaction << gasSpecies()[glhs()[i].index];
|
|
||||||
if (mag(glhs()[i].exponent - glhs()[i].stoichCoeff) > small)
|
|
||||||
{
|
|
||||||
reaction << "^" << glhs()[i].exponent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class ReactionThermo>
|
|
||||||
void Foam::SolidReaction<ReactionThermo>::solidReactionStrRight
|
|
||||||
(
|
|
||||||
OStringStream& reaction
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
|
|
||||||
for (label i = 0; i < grhs().size(); ++i)
|
|
||||||
{
|
|
||||||
if (i > 0)
|
|
||||||
{
|
|
||||||
reaction << " + ";
|
|
||||||
}
|
|
||||||
if (mag(grhs()[i].stoichCoeff - 1) > small)
|
|
||||||
{
|
|
||||||
reaction << grhs()[i].stoichCoeff;
|
|
||||||
}
|
|
||||||
reaction << gasSpecies()[grhs()[i].index];
|
|
||||||
if (mag(grhs()[i].exponent - grhs()[i].stoichCoeff) > small)
|
|
||||||
{
|
|
||||||
reaction << "^" << grhs()[i].exponent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,181 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2019 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/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::SolidReaction
|
|
||||||
|
|
||||||
Description
|
|
||||||
|
|
||||||
Read solid reactions of the type S1 = S2 + G1
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
SolidReactionI.H
|
|
||||||
SolidReaction.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef SolidReaction_H
|
|
||||||
#define SolidReaction_H
|
|
||||||
|
|
||||||
#include "speciesTable.H"
|
|
||||||
#include "Reaction.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// Forward declaration of friend functions and operators
|
|
||||||
template<class ReactionThermo>
|
|
||||||
class SolidReaction;
|
|
||||||
|
|
||||||
template<class ReactionThermo>
|
|
||||||
inline Ostream& operator<<(Ostream&, const SolidReaction<ReactionThermo>&);
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class SolidReaction Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
template<class ReactionThermo>
|
|
||||||
class SolidReaction
|
|
||||||
:
|
|
||||||
public Reaction<ReactionThermo>
|
|
||||||
{
|
|
||||||
// Private Data
|
|
||||||
|
|
||||||
//- List of gas species present in reaction system
|
|
||||||
speciesTable pyrolisisGases_;
|
|
||||||
|
|
||||||
//- Gas specie index for the left-hand-side of the reaction
|
|
||||||
List<specieCoeffs> glhs_;
|
|
||||||
|
|
||||||
//- Gas specie index for the right-hand-side of the reaction
|
|
||||||
List<specieCoeffs> grhs_;
|
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
|
|
||||||
//- Return string representation of reaction
|
|
||||||
string solidReactionStr(OStringStream&) const;
|
|
||||||
|
|
||||||
//- Return string representation of the left of the reaction
|
|
||||||
void solidReactionStrLeft(OStringStream&) const;
|
|
||||||
|
|
||||||
//- Return string representation of the right of the reaction
|
|
||||||
void solidReactionStrRight(OStringStream&) const;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("SolidReaction");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from components
|
|
||||||
SolidReaction
|
|
||||||
(
|
|
||||||
const Reaction<ReactionThermo>& reaction,
|
|
||||||
const speciesTable& pyrolisisGases,
|
|
||||||
const List<specieCoeffs>& glhs,
|
|
||||||
const List<specieCoeffs>& grhs
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Construct as copy given new speciesTable
|
|
||||||
SolidReaction
|
|
||||||
(
|
|
||||||
const SolidReaction<ReactionThermo>&,
|
|
||||||
const speciesTable& pyrolisisGases
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Construct from dictionary
|
|
||||||
SolidReaction
|
|
||||||
(
|
|
||||||
const speciesTable& species,
|
|
||||||
const HashPtrTable<ReactionThermo>& thermoDatabase,
|
|
||||||
const dictionary& dict
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~SolidReaction()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
// Access
|
|
||||||
|
|
||||||
//- Access to the gas components of the left hand side
|
|
||||||
virtual const List<specieCoeffs>& grhs() const;
|
|
||||||
|
|
||||||
//- Access to the gas components of the right hand side
|
|
||||||
virtual const List<specieCoeffs>& glhs() const;
|
|
||||||
|
|
||||||
//- Access to gas specie list
|
|
||||||
virtual const speciesTable& gasSpecies() const;
|
|
||||||
|
|
||||||
|
|
||||||
//- Write
|
|
||||||
virtual void write(Ostream&) const;
|
|
||||||
|
|
||||||
|
|
||||||
// Member Operators
|
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
|
||||||
void operator=(const SolidReaction&) = delete;
|
|
||||||
|
|
||||||
|
|
||||||
// Ostream Operator
|
|
||||||
|
|
||||||
friend Ostream& operator<< <ReactionThermo>
|
|
||||||
(
|
|
||||||
Ostream&,
|
|
||||||
const SolidReaction<ReactionThermo>&
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#include "SolidReactionI.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#ifdef NoRepository
|
|
||||||
#include "SolidReaction.C"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,52 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2018 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/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "SolidReaction.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class ReactionThermo>
|
|
||||||
inline Ostream& operator<<
|
|
||||||
(
|
|
||||||
Ostream& os,
|
|
||||||
const SolidReaction<ReactionThermo>& r
|
|
||||||
)
|
|
||||||
{
|
|
||||||
OStringStream reaction;
|
|
||||||
os << r.solidReactionStr(reaction)<< token::END_STATEMENT <<nl;
|
|
||||||
return os;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,169 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2019 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/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::solidArrheniusReactionRate
|
|
||||||
|
|
||||||
Description
|
|
||||||
Arrhenius reaction rate for solids
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
solidArrheniusReactionRateI.H
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef solidArrheniusReactionRate_H
|
|
||||||
#define solidArrheniusReactionRate_H
|
|
||||||
|
|
||||||
#include "scalarField.H"
|
|
||||||
#include "typeInfo.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// Forward declaration of friend functions and operators
|
|
||||||
|
|
||||||
class solidArrheniusReactionRate;
|
|
||||||
|
|
||||||
Ostream& operator<<(Ostream&, const solidArrheniusReactionRate&);
|
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class solidArrheniusReactionRate Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class solidArrheniusReactionRate
|
|
||||||
{
|
|
||||||
// Private Data
|
|
||||||
|
|
||||||
scalar A_;
|
|
||||||
scalar Ta_;
|
|
||||||
scalar Tcrit_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from components
|
|
||||||
inline solidArrheniusReactionRate
|
|
||||||
(
|
|
||||||
const scalar A,
|
|
||||||
const scalar Ta,
|
|
||||||
const scalar Tcrit
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Construct from dictionary
|
|
||||||
inline solidArrheniusReactionRate
|
|
||||||
(
|
|
||||||
const speciesTable& species,
|
|
||||||
const dictionary& dict
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~solidArrheniusReactionRate()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Return the type name
|
|
||||||
static word type()
|
|
||||||
{
|
|
||||||
return "Arrhenius";
|
|
||||||
}
|
|
||||||
|
|
||||||
inline scalar operator()
|
|
||||||
(
|
|
||||||
const scalar p,
|
|
||||||
const scalar T,
|
|
||||||
const scalarField& c,
|
|
||||||
const label li
|
|
||||||
) const;
|
|
||||||
|
|
||||||
inline scalar ddT
|
|
||||||
(
|
|
||||||
const scalar p,
|
|
||||||
const scalar T,
|
|
||||||
const scalarField& c,
|
|
||||||
const label li
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Third-body efficiencies (beta = 1-alpha)
|
|
||||||
// non-empty only for third-body reactions
|
|
||||||
// with enhanced molecularity (alpha != 1)
|
|
||||||
inline const List<Tuple2<label, scalar>>& beta() const;
|
|
||||||
|
|
||||||
//- Species concentration derivative of the pressure dependent term
|
|
||||||
// By default this value is 1 as it multiplies the third-body term
|
|
||||||
inline void dcidc
|
|
||||||
(
|
|
||||||
const scalar p,
|
|
||||||
const scalar T,
|
|
||||||
const scalarField& c,
|
|
||||||
const label li,
|
|
||||||
scalarField& dcidc
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Temperature derivative of the pressure dependent term
|
|
||||||
// By default this value is 0 since ddT of molecularity is approx.0
|
|
||||||
inline scalar dcidT
|
|
||||||
(
|
|
||||||
const scalar p,
|
|
||||||
const scalar T,
|
|
||||||
const scalarField& c,
|
|
||||||
const label li
|
|
||||||
) const;
|
|
||||||
|
|
||||||
|
|
||||||
//- Write to stream
|
|
||||||
inline void write(Ostream& os) const;
|
|
||||||
|
|
||||||
|
|
||||||
// Ostream Operator
|
|
||||||
|
|
||||||
inline friend Ostream& operator<<
|
|
||||||
(
|
|
||||||
Ostream&,
|
|
||||||
const solidArrheniusReactionRate&
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#include "solidArrheniusReactionRateI.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,143 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2019 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/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
inline Foam::solidArrheniusReactionRate::solidArrheniusReactionRate
|
|
||||||
(
|
|
||||||
const scalar A,
|
|
||||||
const scalar Ta,
|
|
||||||
const scalar Tcrit
|
|
||||||
// const scalar nReact
|
|
||||||
)
|
|
||||||
:
|
|
||||||
A_(A),
|
|
||||||
Ta_(Ta),
|
|
||||||
Tcrit_(Tcrit)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::solidArrheniusReactionRate::solidArrheniusReactionRate
|
|
||||||
(
|
|
||||||
const speciesTable&,
|
|
||||||
const dictionary& dict
|
|
||||||
)
|
|
||||||
:
|
|
||||||
A_(readScalar(dict.lookup("A"))),
|
|
||||||
Ta_(readScalar(dict.lookup("Ta"))),
|
|
||||||
Tcrit_(readScalar(dict.lookup("Tcrit")))
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
inline Foam::scalar Foam::solidArrheniusReactionRate::operator()
|
|
||||||
(
|
|
||||||
const scalar,
|
|
||||||
const scalar T,
|
|
||||||
const scalarField&,
|
|
||||||
const label li
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
if (T < Tcrit_)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return A_*exp(-Ta_/T);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::scalar Foam::solidArrheniusReactionRate::ddT
|
|
||||||
(
|
|
||||||
const scalar p,
|
|
||||||
const scalar T,
|
|
||||||
const scalarField&,
|
|
||||||
const label li
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
if (T < Tcrit_)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return A_*exp(-Ta_/T)*Ta_/sqr(T);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::List<Foam::Tuple2<Foam::label, Foam::scalar>>&
|
|
||||||
Foam::solidArrheniusReactionRate::beta() const
|
|
||||||
{
|
|
||||||
return NullObjectRef<List<Tuple2<label, scalar>>>();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline void Foam::solidArrheniusReactionRate::dcidc
|
|
||||||
(
|
|
||||||
const scalar p,
|
|
||||||
const scalar T,
|
|
||||||
const scalarField& c,
|
|
||||||
const label li,
|
|
||||||
scalarField& dcidc
|
|
||||||
) const
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::scalar Foam::solidArrheniusReactionRate::dcidT
|
|
||||||
(
|
|
||||||
const scalar p,
|
|
||||||
const scalar T,
|
|
||||||
const scalarField& c,
|
|
||||||
const label li
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline void Foam::solidArrheniusReactionRate::write(Ostream& os) const
|
|
||||||
{
|
|
||||||
writeEntry(os, "A", A_);
|
|
||||||
writeEntry(os, "Ta", Ta_);
|
|
||||||
writeEntry(os, "Tcrit", Tcrit_);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::Ostream& Foam::operator<<
|
|
||||||
(
|
|
||||||
Ostream& os,
|
|
||||||
const solidArrheniusReactionRate& arr
|
|
||||||
)
|
|
||||||
{
|
|
||||||
arr.write(os);
|
|
||||||
return os;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,91 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2019 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/>.
|
|
||||||
|
|
||||||
InClass
|
|
||||||
Foam::makeSolidReaction
|
|
||||||
|
|
||||||
Description
|
|
||||||
Macros for instantiating reactions for solid
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef makeSolidReaction_H
|
|
||||||
#define makeSolidReaction_H
|
|
||||||
|
|
||||||
#include "SolidReaction.H"
|
|
||||||
#include "IrreversibleReaction.H"
|
|
||||||
#include "Reaction.H"
|
|
||||||
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#define makeSolidReaction(ReactionType, Thermo, ReactionRate) \
|
|
||||||
\
|
|
||||||
typedef SolidReaction<Thermo> SolidReaction##Thermo; \
|
|
||||||
\
|
|
||||||
typedef Reaction<Thermo> Reaction##Thermo; \
|
|
||||||
\
|
|
||||||
typedef ReactionType<SolidReaction, Thermo, ReactionRate> \
|
|
||||||
ReactionType##Thermo##ReactionRate; \
|
|
||||||
\
|
|
||||||
defineTemplateRunTimeSelectionTable(Reaction##Thermo, dictionary); \
|
|
||||||
defineTemplateRunTimeSelectionTable(Reaction##Thermo, objectRegistry); \
|
|
||||||
\
|
|
||||||
defineTemplateTypeNameAndDebug(SolidReaction##Thermo, 0); \
|
|
||||||
defineTemplateTypeNameAndDebug(Reaction##Thermo, 0); \
|
|
||||||
\
|
|
||||||
template<> \
|
|
||||||
const word ReactionType##Thermo##ReactionRate::typeName \
|
|
||||||
( \
|
|
||||||
ReactionType::typeName_() \
|
|
||||||
+ ReactionRate::type() \
|
|
||||||
+ SolidReaction##Thermo::typeName_() \
|
|
||||||
); \
|
|
||||||
\
|
|
||||||
addToRunTimeSelectionTable \
|
|
||||||
( \
|
|
||||||
Reaction##Thermo, \
|
|
||||||
ReactionType##Thermo##ReactionRate, \
|
|
||||||
dictionary \
|
|
||||||
);
|
|
||||||
|
|
||||||
#define makeSolidIRReactions(Thermo, ReactionRate) \
|
|
||||||
\
|
|
||||||
makeSolidReaction(IrreversibleReaction, Thermo, ReactionRate)
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,55 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2018 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/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "makeSolidReaction.H"
|
|
||||||
#include "solidArrheniusReactionRate.H"
|
|
||||||
#include "solidThermoPhysicsTypes.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Make Solid reactions * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
makeSolidIRReactions(hConstSolidThermoPhysics, solidArrheniusReactionRate)
|
|
||||||
|
|
||||||
makeSolidIRReactions
|
|
||||||
(
|
|
||||||
hPowerSolidThermoPhysics,
|
|
||||||
solidArrheniusReactionRate
|
|
||||||
)
|
|
||||||
|
|
||||||
makeSolidIRReactions
|
|
||||||
(
|
|
||||||
hExpKappaConstSolidThermoPhysics,
|
|
||||||
solidArrheniusReactionRate
|
|
||||||
)
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,7 +1,4 @@
|
|||||||
solidThermo/solidThermo.C
|
solidThermo/solidThermo.C
|
||||||
solidThermo/solidThermos.C
|
solidThermo/solidThermos.C
|
||||||
|
|
||||||
solidReactionThermo/solidReactionThermo.C
|
|
||||||
solidReactionThermo/solidReactionThermos.C
|
|
||||||
|
|
||||||
LIB = $(FOAM_LIBBIN)/libsolidThermo
|
LIB = $(FOAM_LIBBIN)/libsolidThermo
|
||||||
|
|||||||
@ -10,6 +10,5 @@ LIB_LIBS = \
|
|||||||
-lmeshTools \
|
-lmeshTools \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
-lspecie \
|
-lspecie \
|
||||||
-lsolidSpecie \
|
|
||||||
-lfluidThermophysicalModels \
|
-lfluidThermophysicalModels \
|
||||||
-lreactionThermophysicalModels
|
-lreactionThermophysicalModels
|
||||||
|
|||||||
@ -1,127 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2012-2018 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/>.
|
|
||||||
|
|
||||||
InClass
|
|
||||||
Foam::solidThermo
|
|
||||||
|
|
||||||
Description
|
|
||||||
Macros for creating reacting solid thermo packages
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef makeReactingSolidThermo_H
|
|
||||||
#define makeReactingSolidThermo_H
|
|
||||||
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
#include "SpecieMixture.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
#define makeSolidReactionMixtureThermo(BaseThermo,Cthermo,Mixture,ThermoPhys) \
|
|
||||||
\
|
|
||||||
typedef SpecieMixture \
|
|
||||||
< \
|
|
||||||
Mixture \
|
|
||||||
< \
|
|
||||||
ThermoPhys \
|
|
||||||
> \
|
|
||||||
> SpecieMixture##Mixture##ThermoPhys; \
|
|
||||||
\
|
|
||||||
typedef \
|
|
||||||
heThermo \
|
|
||||||
< \
|
|
||||||
BaseThermo, \
|
|
||||||
SpecieMixture##Mixture##ThermoPhys \
|
|
||||||
> heThermo##Mixture##ThermoPhys; \
|
|
||||||
\
|
|
||||||
typedef \
|
|
||||||
Cthermo \
|
|
||||||
< \
|
|
||||||
BaseThermo, \
|
|
||||||
SpecieMixture##Mixture##ThermoPhys \
|
|
||||||
> Cthermo##Mixture##ThermoPhys; \
|
|
||||||
\
|
|
||||||
\
|
|
||||||
defineTemplateTypeNameAndDebugWithName \
|
|
||||||
( \
|
|
||||||
Cthermo##Mixture##ThermoPhys, \
|
|
||||||
( \
|
|
||||||
#Cthermo"<"#Mixture"<" \
|
|
||||||
+ ThermoPhys::typeName() \
|
|
||||||
+ ">>" \
|
|
||||||
).c_str(), \
|
|
||||||
0 \
|
|
||||||
); \
|
|
||||||
\
|
|
||||||
addToRunTimeSelectionTable \
|
|
||||||
( \
|
|
||||||
basicThermo, \
|
|
||||||
Cthermo##Mixture##ThermoPhys, \
|
|
||||||
fvMesh \
|
|
||||||
); \
|
|
||||||
\
|
|
||||||
addToRunTimeSelectionTable \
|
|
||||||
( \
|
|
||||||
BaseThermo, \
|
|
||||||
Cthermo##Mixture##ThermoPhys, \
|
|
||||||
fvMesh \
|
|
||||||
); \
|
|
||||||
\
|
|
||||||
addToRunTimeSelectionTable \
|
|
||||||
( \
|
|
||||||
BaseThermo, \
|
|
||||||
Cthermo##Mixture##ThermoPhys, \
|
|
||||||
dictionary \
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
#define makeReactingSolidThermo(BaseThermo,CThermo,Mixture,Transport,Type,Thermo,EqnOfState,Specie) \
|
|
||||||
\
|
|
||||||
typedef \
|
|
||||||
Transport \
|
|
||||||
< \
|
|
||||||
species::thermo \
|
|
||||||
< \
|
|
||||||
Thermo \
|
|
||||||
< \
|
|
||||||
EqnOfState \
|
|
||||||
< \
|
|
||||||
Specie \
|
|
||||||
> \
|
|
||||||
>, \
|
|
||||||
Type \
|
|
||||||
> \
|
|
||||||
> Transport##Type##Thermo##EqnOfState##Specie; \
|
|
||||||
\
|
|
||||||
makeSolidReactionMixtureThermo \
|
|
||||||
( \
|
|
||||||
BaseThermo, \
|
|
||||||
CThermo, \
|
|
||||||
Mixture, \
|
|
||||||
Transport##Type##Thermo##EqnOfState##Specie \
|
|
||||||
);
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,91 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2018 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/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "solidReactionThermo.H"
|
|
||||||
#include "fvMesh.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(solidReactionThermo, 0);
|
|
||||||
defineRunTimeSelectionTable(solidReactionThermo, fvMesh);
|
|
||||||
defineRunTimeSelectionTable(solidReactionThermo, dictionary);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::solidReactionThermo::solidReactionThermo
|
|
||||||
(
|
|
||||||
const fvMesh& mesh,
|
|
||||||
const word& phaseName
|
|
||||||
)
|
|
||||||
:
|
|
||||||
solidThermo(mesh, phaseName)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::solidReactionThermo::solidReactionThermo
|
|
||||||
(
|
|
||||||
const fvMesh& mesh,
|
|
||||||
const dictionary& dict,
|
|
||||||
const word& phaseName
|
|
||||||
)
|
|
||||||
:
|
|
||||||
solidThermo(mesh, dict, phaseName)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::autoPtr<Foam::solidReactionThermo> Foam::solidReactionThermo::New
|
|
||||||
(
|
|
||||||
const fvMesh& mesh,
|
|
||||||
const word& phaseName
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return basicThermo::New<solidReactionThermo>(mesh, phaseName);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::autoPtr<Foam::solidReactionThermo> Foam::solidReactionThermo::New
|
|
||||||
(
|
|
||||||
const fvMesh& mesh,
|
|
||||||
const dictionary& dict,
|
|
||||||
const word& phaseName
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return basicThermo::New<solidReactionThermo>(mesh, dict, phaseName);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::solidReactionThermo::~solidReactionThermo()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,143 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2019 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/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::solidReactionThermo
|
|
||||||
|
|
||||||
Description
|
|
||||||
Foam::solidReactionThermo
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
solidReactionThermo.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef solidReactionThermo_H
|
|
||||||
#define solidReactionThermo_H
|
|
||||||
|
|
||||||
#include "basicSpecieMixture.H"
|
|
||||||
#include "solidThermo.H"
|
|
||||||
#include "autoPtr.H"
|
|
||||||
#include "runTimeSelectionTables.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class solidReactionThermo Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
|
|
||||||
class solidReactionThermo
|
|
||||||
:
|
|
||||||
public solidThermo
|
|
||||||
{
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("solidReactionThermo");
|
|
||||||
|
|
||||||
|
|
||||||
//- Declare run-time constructor selection tables
|
|
||||||
declareRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
autoPtr,
|
|
||||||
solidReactionThermo,
|
|
||||||
fvMesh,
|
|
||||||
(const fvMesh& mesh, const word& phaseName),
|
|
||||||
(mesh, phaseName)
|
|
||||||
);
|
|
||||||
|
|
||||||
// Declare run-time constructor selection tables
|
|
||||||
declareRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
autoPtr,
|
|
||||||
solidReactionThermo,
|
|
||||||
dictionary,
|
|
||||||
(const fvMesh& mesh, const dictionary& dict, const word& phaseName),
|
|
||||||
(mesh, dict, phaseName)
|
|
||||||
);
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from mesh and phase name
|
|
||||||
solidReactionThermo
|
|
||||||
(
|
|
||||||
const fvMesh&,
|
|
||||||
const word& phaseName
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct from mesh, dictionary and phase name
|
|
||||||
solidReactionThermo
|
|
||||||
(
|
|
||||||
const fvMesh&,
|
|
||||||
const dictionary&,
|
|
||||||
const word& phaseName
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// Selectors
|
|
||||||
|
|
||||||
//- Standard selection based on fvMesh
|
|
||||||
static autoPtr<solidReactionThermo> New
|
|
||||||
(
|
|
||||||
const fvMesh&,
|
|
||||||
const word& phaseName=word::null
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Standard selection based on fvMesh amd dictionary
|
|
||||||
static autoPtr<solidReactionThermo> New
|
|
||||||
(
|
|
||||||
const fvMesh&,
|
|
||||||
const dictionary&,
|
|
||||||
const word& phaseName=word::null
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~solidReactionThermo();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Return the composition of the multi-component mixture
|
|
||||||
virtual basicSpecieMixture& composition() = 0;
|
|
||||||
|
|
||||||
//- Return the composition of the multi-component mixture
|
|
||||||
virtual const basicSpecieMixture& composition() const = 0;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,81 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2019 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/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "makeReactingSolidThermo.H"
|
|
||||||
#include "solidReactionThermo.H"
|
|
||||||
#include "heSolidThermo.H"
|
|
||||||
|
|
||||||
#include "specie.H"
|
|
||||||
#include "rhoConst.H"
|
|
||||||
#include "hConstThermo.H"
|
|
||||||
#include "hPowerThermo.H"
|
|
||||||
#include "constIsoSolidTransport.H"
|
|
||||||
#include "constAnIsoSolidTransport.H"
|
|
||||||
#include "exponentialSolidTransport.H"
|
|
||||||
|
|
||||||
#include "multiComponentMixture.H"
|
|
||||||
|
|
||||||
#include "sensibleEnthalpy.H"
|
|
||||||
#include "thermo.H"
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/* * * * * * * * * * * * * * * * * Enthalpy-based * * * * * * * * * * * * * */
|
|
||||||
|
|
||||||
makeReactingSolidThermo
|
|
||||||
(
|
|
||||||
solidReactionThermo,
|
|
||||||
heSolidThermo,
|
|
||||||
multiComponentMixture,
|
|
||||||
constIsoSolidTransport,
|
|
||||||
sensibleEnthalpy,
|
|
||||||
hConstThermo,
|
|
||||||
rhoConst,
|
|
||||||
specie
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
makeReactingSolidThermo
|
|
||||||
(
|
|
||||||
solidReactionThermo,
|
|
||||||
heSolidThermo,
|
|
||||||
multiComponentMixture,
|
|
||||||
constIsoSolidTransport,
|
|
||||||
sensibleEnthalpy,
|
|
||||||
hPowerThermo,
|
|
||||||
rhoConst,
|
|
||||||
specie
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,61 +0,0 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Version: dev
|
|
||||||
\\/ M anipulation |
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
FoamFile
|
|
||||||
{
|
|
||||||
version 2.0;
|
|
||||||
format ascii;
|
|
||||||
class volScalarField;
|
|
||||||
location "0";
|
|
||||||
object C3H8;
|
|
||||||
}
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
dimensions [0 0 0 0 0 0 0];
|
|
||||||
|
|
||||||
internalField uniform 0;
|
|
||||||
|
|
||||||
boundaryField
|
|
||||||
{
|
|
||||||
outlet
|
|
||||||
{
|
|
||||||
type inletOutlet;
|
|
||||||
inletValue $internalField;
|
|
||||||
value $internalField;
|
|
||||||
}
|
|
||||||
|
|
||||||
ground
|
|
||||||
{
|
|
||||||
type zeroGradient;
|
|
||||||
}
|
|
||||||
|
|
||||||
side
|
|
||||||
{
|
|
||||||
type inletOutlet;
|
|
||||||
inletValue $internalField;
|
|
||||||
value $internalField;
|
|
||||||
}
|
|
||||||
|
|
||||||
inlet
|
|
||||||
{
|
|
||||||
type totalFlowRateAdvectiveDiffusive;
|
|
||||||
value uniform 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
region0_to_pyrolysisRegion_coupledWall
|
|
||||||
{
|
|
||||||
type totalFlowRateAdvectiveDiffusive;
|
|
||||||
massFluxFraction 1.0;
|
|
||||||
value $internalField;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,46 +0,0 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Version: dev
|
|
||||||
\\/ M anipulation |
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
FoamFile
|
|
||||||
{
|
|
||||||
version 2.0;
|
|
||||||
format ascii;
|
|
||||||
class volScalarField;
|
|
||||||
object IDefault;
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
dimensions [1 0 -3 0 0 0 0];
|
|
||||||
|
|
||||||
internalField uniform 0;
|
|
||||||
|
|
||||||
boundaryField
|
|
||||||
{
|
|
||||||
|
|
||||||
region0_to_pyrolysisRegion_coupledWall
|
|
||||||
{
|
|
||||||
type greyDiffusiveRadiation;
|
|
||||||
emissivityMode solidRadiation;
|
|
||||||
emissivity uniform 1.0;
|
|
||||||
value uniform 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
frontAndBack
|
|
||||||
{
|
|
||||||
type cyclic;
|
|
||||||
}
|
|
||||||
|
|
||||||
".*"
|
|
||||||
{
|
|
||||||
type greyDiffusiveRadiation;
|
|
||||||
emissivityMode lookup;
|
|
||||||
emissivity uniform 1.0;
|
|
||||||
value uniform 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,58 +0,0 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Version: dev
|
|
||||||
\\/ M anipulation |
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
FoamFile
|
|
||||||
{
|
|
||||||
version 2.0;
|
|
||||||
format ascii;
|
|
||||||
class volScalarField;
|
|
||||||
location "0";
|
|
||||||
object N2;
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
dimensions [0 0 0 0 0 0 0];
|
|
||||||
|
|
||||||
internalField uniform 0.76699;
|
|
||||||
|
|
||||||
boundaryField
|
|
||||||
{
|
|
||||||
|
|
||||||
outlet
|
|
||||||
{
|
|
||||||
type calculated;
|
|
||||||
value $internalField;
|
|
||||||
}
|
|
||||||
|
|
||||||
ground
|
|
||||||
{
|
|
||||||
type calculated;
|
|
||||||
value $internalField;
|
|
||||||
}
|
|
||||||
|
|
||||||
side
|
|
||||||
{
|
|
||||||
type calculated;
|
|
||||||
value $internalField;
|
|
||||||
}
|
|
||||||
|
|
||||||
inlet
|
|
||||||
{
|
|
||||||
type calculated;
|
|
||||||
value $internalField;
|
|
||||||
}
|
|
||||||
|
|
||||||
region0_to_pyrolysisRegion_coupledWall
|
|
||||||
{
|
|
||||||
type calculated;
|
|
||||||
value $internalField;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,60 +0,0 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Version: dev
|
|
||||||
\\/ M anipulation |
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
FoamFile
|
|
||||||
{
|
|
||||||
version 2.0;
|
|
||||||
format ascii;
|
|
||||||
class volScalarField;
|
|
||||||
location "0";
|
|
||||||
object O2;
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
dimensions [0 0 0 0 0 0 0];
|
|
||||||
|
|
||||||
internalField uniform 0.23301;
|
|
||||||
|
|
||||||
boundaryField
|
|
||||||
{
|
|
||||||
|
|
||||||
outlet
|
|
||||||
{
|
|
||||||
type inletOutlet;
|
|
||||||
inletValue $internalField;
|
|
||||||
value $internalField;
|
|
||||||
}
|
|
||||||
|
|
||||||
ground
|
|
||||||
{
|
|
||||||
type zeroGradient;
|
|
||||||
}
|
|
||||||
|
|
||||||
side
|
|
||||||
{
|
|
||||||
type inletOutlet;
|
|
||||||
inletValue $internalField;
|
|
||||||
value $internalField;
|
|
||||||
}
|
|
||||||
|
|
||||||
inlet
|
|
||||||
{
|
|
||||||
type fixedValue;
|
|
||||||
value uniform 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
region0_to_pyrolysisRegion_coupledWall
|
|
||||||
{
|
|
||||||
type totalFlowRateAdvectiveDiffusive;
|
|
||||||
massFluxFraction 0.0;
|
|
||||||
value $internalField;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,64 +0,0 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Version: dev
|
|
||||||
\\/ M anipulation |
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
FoamFile
|
|
||||||
{
|
|
||||||
version 2.0;
|
|
||||||
format ascii;
|
|
||||||
class volScalarField;
|
|
||||||
location "0";
|
|
||||||
object T;
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
dimensions [0 0 0 1 0 0 0];
|
|
||||||
|
|
||||||
internalField uniform 298;
|
|
||||||
|
|
||||||
boundaryField
|
|
||||||
{
|
|
||||||
outlet
|
|
||||||
{
|
|
||||||
type inletOutlet;
|
|
||||||
inletValue $internalField;
|
|
||||||
value $internalField;
|
|
||||||
}
|
|
||||||
|
|
||||||
ground
|
|
||||||
{
|
|
||||||
type zeroGradient;
|
|
||||||
}
|
|
||||||
|
|
||||||
side
|
|
||||||
{
|
|
||||||
type inletOutlet;
|
|
||||||
inletValue $internalField;
|
|
||||||
value $internalField;
|
|
||||||
}
|
|
||||||
|
|
||||||
inlet
|
|
||||||
{
|
|
||||||
type fixedValue;
|
|
||||||
value $internalField;
|
|
||||||
}
|
|
||||||
|
|
||||||
region0_to_pyrolysisRegion_coupledWall
|
|
||||||
{
|
|
||||||
type filmPyrolysisRadiativeCoupledMixed;
|
|
||||||
pyrolysisRegion pyrolysisRegion;
|
|
||||||
filmRegion filmRegion;
|
|
||||||
Tnbr T;
|
|
||||||
qrNbr none;
|
|
||||||
qr qr;
|
|
||||||
filmDeltaDry 0.0;
|
|
||||||
filmDeltaWet 2e-4;
|
|
||||||
value $internalField;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,60 +0,0 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Version: dev
|
|
||||||
\\/ M anipulation |
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
FoamFile
|
|
||||||
{
|
|
||||||
version 2.0;
|
|
||||||
format ascii;
|
|
||||||
class volVectorField;
|
|
||||||
location "0";
|
|
||||||
object U;
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
dimensions [0 1 -1 0 0 0 0];
|
|
||||||
|
|
||||||
internalField uniform (0 0 0);
|
|
||||||
|
|
||||||
boundaryField
|
|
||||||
{
|
|
||||||
|
|
||||||
outlet
|
|
||||||
{
|
|
||||||
type inletOutlet;
|
|
||||||
inletValue $internalField;
|
|
||||||
value $internalField;
|
|
||||||
}
|
|
||||||
|
|
||||||
ground
|
|
||||||
{
|
|
||||||
type fixedValue;
|
|
||||||
value $internalField;
|
|
||||||
}
|
|
||||||
|
|
||||||
side
|
|
||||||
{
|
|
||||||
type pressureInletOutletVelocity;
|
|
||||||
value $internalField;
|
|
||||||
}
|
|
||||||
|
|
||||||
inlet
|
|
||||||
{
|
|
||||||
type flowRateInletVelocity;
|
|
||||||
massFlowRate constant 0.01;
|
|
||||||
value uniform (0 0 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
region0_to_pyrolysisRegion_coupledWall
|
|
||||||
{
|
|
||||||
type mappedFlowRate;
|
|
||||||
nbrPhi phiGas;
|
|
||||||
value uniform (0 0 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,60 +0,0 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Version: dev
|
|
||||||
\\/ M anipulation |
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
FoamFile
|
|
||||||
{
|
|
||||||
version 2.0;
|
|
||||||
format ascii;
|
|
||||||
class volScalarField;
|
|
||||||
location "0";
|
|
||||||
object Ydefault;
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
dimensions [0 0 0 0 0 0 0];
|
|
||||||
|
|
||||||
internalField uniform 0.0;
|
|
||||||
|
|
||||||
boundaryField
|
|
||||||
{
|
|
||||||
|
|
||||||
outlet
|
|
||||||
{
|
|
||||||
type inletOutlet;
|
|
||||||
inletValue $internalField;
|
|
||||||
value $internalField;
|
|
||||||
}
|
|
||||||
|
|
||||||
ground
|
|
||||||
{
|
|
||||||
type zeroGradient;
|
|
||||||
}
|
|
||||||
|
|
||||||
side
|
|
||||||
{
|
|
||||||
type inletOutlet;
|
|
||||||
inletValue $internalField;
|
|
||||||
value $internalField;
|
|
||||||
}
|
|
||||||
|
|
||||||
inlet
|
|
||||||
{
|
|
||||||
type fixedValue;
|
|
||||||
value uniform 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
region0_to_pyrolysisRegion_coupledWall
|
|
||||||
{
|
|
||||||
type totalFlowRateAdvectiveDiffusive;
|
|
||||||
massFluxFraction 0.0;
|
|
||||||
value $internalField;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,56 +0,0 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Version: dev
|
|
||||||
\\/ M anipulation |
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
FoamFile
|
|
||||||
{
|
|
||||||
version 2.0;
|
|
||||||
format ascii;
|
|
||||||
class volScalarField;
|
|
||||||
location "0";
|
|
||||||
object alphat;
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
dimensions [1 -1 -1 0 0 0 0];
|
|
||||||
|
|
||||||
internalField uniform 0;
|
|
||||||
|
|
||||||
boundaryField
|
|
||||||
{
|
|
||||||
outlet
|
|
||||||
{
|
|
||||||
type calculated;
|
|
||||||
value uniform 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
ground
|
|
||||||
{
|
|
||||||
type compressible::alphatWallFunction;
|
|
||||||
value uniform 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
side
|
|
||||||
{
|
|
||||||
type calculated;
|
|
||||||
value uniform 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
inlet
|
|
||||||
{
|
|
||||||
type calculated;
|
|
||||||
value uniform 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
region0_to_pyrolysisRegion_coupledWall
|
|
||||||
{
|
|
||||||
type compressible::alphatWallFunction;
|
|
||||||
value uniform 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,62 +0,0 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Version: dev
|
|
||||||
\\/ M anipulation |
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
FoamFile
|
|
||||||
{
|
|
||||||
|
|
||||||
version 2.0;
|
|
||||||
format ascii;
|
|
||||||
class volScalarField;
|
|
||||||
location "0/filmRegion";
|
|
||||||
object Tf;
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
dimensions [0 0 0 1 0 0 0];
|
|
||||||
|
|
||||||
internalField uniform 298;
|
|
||||||
|
|
||||||
boundaryField
|
|
||||||
{
|
|
||||||
region0_to_filmRegion_coupledWall // Patch to pyrolysis
|
|
||||||
{
|
|
||||||
type mappedField;
|
|
||||||
sampleRegion pyrolysisRegion;
|
|
||||||
sampleMode nearestPatchFace;
|
|
||||||
samplePatch region0_to_pyrolysisRegion_coupledWall;
|
|
||||||
offset (0 0 0);
|
|
||||||
field T;
|
|
||||||
setAverage no;
|
|
||||||
average 0;
|
|
||||||
value uniform 298;
|
|
||||||
}
|
|
||||||
|
|
||||||
coupledWall_top // Patch to Region0
|
|
||||||
{
|
|
||||||
type zeroGradient;
|
|
||||||
}
|
|
||||||
|
|
||||||
"side.*"
|
|
||||||
{
|
|
||||||
type inletOutlet;
|
|
||||||
inletValue uniform 298;
|
|
||||||
value uniform 298;
|
|
||||||
}
|
|
||||||
|
|
||||||
outlet
|
|
||||||
{
|
|
||||||
type zeroGradient;
|
|
||||||
}
|
|
||||||
|
|
||||||
inlet
|
|
||||||
{
|
|
||||||
type fixedValue;
|
|
||||||
value uniform 298.0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,52 +0,0 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Version: dev
|
|
||||||
\\/ M anipulation |
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
FoamFile
|
|
||||||
{
|
|
||||||
version 2.0;
|
|
||||||
format ascii;
|
|
||||||
class volVectorField;
|
|
||||||
location "0/filmRegion";
|
|
||||||
object Uf;
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
dimensions [0 1 -1 0 0 0 0];
|
|
||||||
|
|
||||||
internalField uniform (0 0 0);
|
|
||||||
|
|
||||||
boundaryField
|
|
||||||
{
|
|
||||||
coupledWall_top // Patch to Region0
|
|
||||||
{
|
|
||||||
type slip;
|
|
||||||
}
|
|
||||||
|
|
||||||
region0_to_filmRegion_coupledWall // Patch to pyrolysis
|
|
||||||
{
|
|
||||||
type noSlip;
|
|
||||||
}
|
|
||||||
|
|
||||||
outlet
|
|
||||||
{
|
|
||||||
type zeroGradient;
|
|
||||||
}
|
|
||||||
|
|
||||||
"side.*"
|
|
||||||
{
|
|
||||||
type noSlip;
|
|
||||||
}
|
|
||||||
|
|
||||||
inlet
|
|
||||||
{
|
|
||||||
type fixedValue;
|
|
||||||
rho rhof;
|
|
||||||
value uniform (0 0 -0.01);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,51 +0,0 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Version: dev
|
|
||||||
\\/ M anipulation |
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
FoamFile
|
|
||||||
{
|
|
||||||
version 2.0;
|
|
||||||
format ascii;
|
|
||||||
class volScalarField;
|
|
||||||
location "0/filmRegion";
|
|
||||||
object deltaf;
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
dimensions [0 1 0 0 0 0 0];
|
|
||||||
|
|
||||||
internalField uniform 1e-6;
|
|
||||||
|
|
||||||
boundaryField
|
|
||||||
{
|
|
||||||
coupledWall_top
|
|
||||||
{
|
|
||||||
type zeroGradient;
|
|
||||||
}
|
|
||||||
|
|
||||||
region0_to_filmRegion_coupledWall
|
|
||||||
{
|
|
||||||
type zeroGradient;
|
|
||||||
}
|
|
||||||
|
|
||||||
"side.*"
|
|
||||||
{
|
|
||||||
type zeroGradient;
|
|
||||||
}
|
|
||||||
|
|
||||||
inlet
|
|
||||||
{
|
|
||||||
type fixedValue;
|
|
||||||
value uniform 6e-4;
|
|
||||||
}
|
|
||||||
|
|
||||||
outlet
|
|
||||||
{
|
|
||||||
type zeroGradient;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,55 +0,0 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Version: dev
|
|
||||||
\\/ M anipulation |
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
FoamFile
|
|
||||||
{
|
|
||||||
version 2.0;
|
|
||||||
format ascii;
|
|
||||||
class volScalarField;
|
|
||||||
location "0";
|
|
||||||
object k;
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
dimensions [0 2 -2 0 0 0 0];
|
|
||||||
|
|
||||||
internalField uniform 1e-5;
|
|
||||||
|
|
||||||
boundaryField
|
|
||||||
{
|
|
||||||
outlet
|
|
||||||
{
|
|
||||||
type inletOutlet;
|
|
||||||
inletValue $internalField;
|
|
||||||
value $internalField;
|
|
||||||
}
|
|
||||||
ground
|
|
||||||
{
|
|
||||||
type zeroGradient;
|
|
||||||
}
|
|
||||||
|
|
||||||
side
|
|
||||||
{
|
|
||||||
type inletOutlet;
|
|
||||||
inletValue $internalField;
|
|
||||||
value $internalField;
|
|
||||||
}
|
|
||||||
inlet
|
|
||||||
{
|
|
||||||
type fixedValue;
|
|
||||||
value $internalField;
|
|
||||||
}
|
|
||||||
region0_to_pyrolysisRegion_coupledWall
|
|
||||||
{
|
|
||||||
type zeroGradient;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,60 +0,0 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Version: dev
|
|
||||||
\\/ M anipulation |
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
FoamFile
|
|
||||||
{
|
|
||||||
version 2.0;
|
|
||||||
format ascii;
|
|
||||||
location "0";
|
|
||||||
class volScalarField;
|
|
||||||
object nut;
|
|
||||||
}
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
dimensions [0 2 -1 0 0 0 0];
|
|
||||||
|
|
||||||
internalField uniform 0;
|
|
||||||
|
|
||||||
boundaryField
|
|
||||||
{
|
|
||||||
outlet
|
|
||||||
{
|
|
||||||
type calculated;
|
|
||||||
value uniform 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
ground
|
|
||||||
{
|
|
||||||
type nutUSpaldingWallFunction;
|
|
||||||
value uniform 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
side
|
|
||||||
{
|
|
||||||
type calculated;
|
|
||||||
value uniform 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
inlet
|
|
||||||
{
|
|
||||||
type calculated;
|
|
||||||
value uniform 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
region0_to_pyrolysisRegion_coupledWall
|
|
||||||
{
|
|
||||||
type nutUSpaldingWallFunction;
|
|
||||||
value uniform 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,58 +0,0 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Version: dev
|
|
||||||
\\/ M anipulation |
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
FoamFile
|
|
||||||
{
|
|
||||||
version 2.0;
|
|
||||||
format ascii;
|
|
||||||
class volScalarField;
|
|
||||||
object p;
|
|
||||||
}
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
dimensions [1 -1 -2 0 0 0 0];
|
|
||||||
|
|
||||||
internalField uniform 101325;
|
|
||||||
|
|
||||||
boundaryField
|
|
||||||
{
|
|
||||||
|
|
||||||
outlet
|
|
||||||
{
|
|
||||||
type calculated;
|
|
||||||
value $internalField;
|
|
||||||
}
|
|
||||||
|
|
||||||
ground
|
|
||||||
{
|
|
||||||
type calculated;
|
|
||||||
value $internalField;
|
|
||||||
}
|
|
||||||
|
|
||||||
side
|
|
||||||
{
|
|
||||||
type calculated;
|
|
||||||
value $internalField;
|
|
||||||
}
|
|
||||||
|
|
||||||
inlet
|
|
||||||
{
|
|
||||||
type calculated;
|
|
||||||
value $internalField;
|
|
||||||
}
|
|
||||||
region0_to_pyrolysisRegion_coupledWall
|
|
||||||
{
|
|
||||||
type calculated;
|
|
||||||
value $internalField;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,49 +0,0 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Version: dev
|
|
||||||
\\/ M anipulation |
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
FoamFile
|
|
||||||
{
|
|
||||||
version 2.0;
|
|
||||||
format ascii;
|
|
||||||
class volScalarField;
|
|
||||||
location "0";
|
|
||||||
object p_rgh;
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
dimensions [1 -1 -2 0 0 0 0];
|
|
||||||
|
|
||||||
internalField uniform 0;
|
|
||||||
|
|
||||||
boundaryField
|
|
||||||
{
|
|
||||||
"(side|outlet)"
|
|
||||||
{
|
|
||||||
type prghTotalHydrostaticPressure;
|
|
||||||
p0 $internalField;
|
|
||||||
value $internalField;
|
|
||||||
}
|
|
||||||
|
|
||||||
ground
|
|
||||||
{
|
|
||||||
type fixedFluxPressure;
|
|
||||||
}
|
|
||||||
|
|
||||||
inlet
|
|
||||||
{
|
|
||||||
type fixedFluxPressure;
|
|
||||||
}
|
|
||||||
|
|
||||||
region0_to_pyrolysisRegion_coupledWall
|
|
||||||
{
|
|
||||||
type fixedFluxPressure;
|
|
||||||
value $internalField;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,55 +0,0 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Version: dev
|
|
||||||
\\/ M anipulation |
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
FoamFile
|
|
||||||
{
|
|
||||||
version 2.0;
|
|
||||||
format ascii;
|
|
||||||
class volScalarField;
|
|
||||||
location "0";
|
|
||||||
object ph_rgh;
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
dimensions [1 -1 -2 0 0 0 0];
|
|
||||||
|
|
||||||
internalField uniform 0;
|
|
||||||
|
|
||||||
boundaryField
|
|
||||||
{
|
|
||||||
outlet
|
|
||||||
{
|
|
||||||
type fixedValue;
|
|
||||||
value $internalField;
|
|
||||||
}
|
|
||||||
|
|
||||||
side
|
|
||||||
{
|
|
||||||
type fixedFluxPressure;
|
|
||||||
value $internalField;
|
|
||||||
}
|
|
||||||
|
|
||||||
ground
|
|
||||||
{
|
|
||||||
type fixedFluxPressure;
|
|
||||||
}
|
|
||||||
|
|
||||||
inlet
|
|
||||||
{
|
|
||||||
type fixedFluxPressure;
|
|
||||||
value $internalField;
|
|
||||||
}
|
|
||||||
|
|
||||||
region0_to_pyrolysisRegion_coupledWall
|
|
||||||
{
|
|
||||||
type fixedFluxPressure;
|
|
||||||
value $internalField;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,54 +0,0 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Version: dev
|
|
||||||
\\/ M anipulation |
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
FoamFile
|
|
||||||
{
|
|
||||||
version 2.0;
|
|
||||||
format ascii;
|
|
||||||
class volScalarField;
|
|
||||||
location "0/pyrolysisRegion";
|
|
||||||
object T;
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
dimensions [0 0 0 1 0 0 0];
|
|
||||||
|
|
||||||
internalField uniform 298;
|
|
||||||
|
|
||||||
boundaryField
|
|
||||||
{
|
|
||||||
coupledWall_top
|
|
||||||
{
|
|
||||||
type zeroGradient;
|
|
||||||
}
|
|
||||||
|
|
||||||
coupledWall_side
|
|
||||||
{
|
|
||||||
type empty;
|
|
||||||
}
|
|
||||||
|
|
||||||
region0_to_pyrolysisRegion_coupledWall
|
|
||||||
{
|
|
||||||
type filmPyrolysisRadiativeCoupledMixed;
|
|
||||||
pyrolysisRegion pyrolysisRegion;
|
|
||||||
filmRegion filmRegion;
|
|
||||||
Tnbr T;
|
|
||||||
qrNbr qr;
|
|
||||||
qr none;
|
|
||||||
filmDeltaDry 0.0;
|
|
||||||
filmDeltaWet 2e-4;
|
|
||||||
value uniform 298;
|
|
||||||
}
|
|
||||||
oneDEmptyPatch
|
|
||||||
{
|
|
||||||
type empty;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,40 +0,0 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Version: dev
|
|
||||||
\\/ M anipulation |
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
FoamFile
|
|
||||||
{
|
|
||||||
version 2.0;
|
|
||||||
format ascii;
|
|
||||||
class volScalarField;
|
|
||||||
location "0/pyrolysisRegion";
|
|
||||||
object Ydefault;
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
dimensions [0 0 0 0 0 0 0];
|
|
||||||
|
|
||||||
internalField uniform 0;
|
|
||||||
|
|
||||||
boundaryField
|
|
||||||
{
|
|
||||||
coupledWall_top
|
|
||||||
{
|
|
||||||
type zeroGradient;
|
|
||||||
}
|
|
||||||
region0_to_pyrolysisRegion_coupledWall
|
|
||||||
{
|
|
||||||
type zeroGradient;
|
|
||||||
}
|
|
||||||
oneDEmptyPatch
|
|
||||||
{
|
|
||||||
type empty;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,41 +0,0 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Version: dev
|
|
||||||
\\/ M anipulation |
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
FoamFile
|
|
||||||
{
|
|
||||||
version 2.0;
|
|
||||||
format ascii;
|
|
||||||
class volScalarField;
|
|
||||||
location "0/pyrolysisRegion";
|
|
||||||
object Ychar;
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
dimensions [0 0 0 0 0 0 0];
|
|
||||||
|
|
||||||
internalField uniform 0;
|
|
||||||
|
|
||||||
boundaryField
|
|
||||||
{
|
|
||||||
coupledWall_top
|
|
||||||
{
|
|
||||||
type zeroGradient;
|
|
||||||
}
|
|
||||||
|
|
||||||
region0_to_pyrolysisRegion_coupledWall
|
|
||||||
{
|
|
||||||
type zeroGradient;
|
|
||||||
}
|
|
||||||
|
|
||||||
oneDEmptyPatch
|
|
||||||
{
|
|
||||||
type empty;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,32 +0,0 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Version: dev
|
|
||||||
\\/ M anipulation |
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
FoamFile
|
|
||||||
{
|
|
||||||
version 2.0;
|
|
||||||
format ascii;
|
|
||||||
class volScalarField;
|
|
||||||
location "0";
|
|
||||||
object p;
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
dimensions [1 -1 -2 0 0 0 0];
|
|
||||||
|
|
||||||
internalField uniform 1e5;
|
|
||||||
|
|
||||||
boundaryField
|
|
||||||
{
|
|
||||||
|
|
||||||
".*"
|
|
||||||
{
|
|
||||||
type zeroGradient;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,49 +0,0 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Version: dev
|
|
||||||
\\/ M anipulation |
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
FoamFile
|
|
||||||
{
|
|
||||||
version 2.0;
|
|
||||||
format ascii;
|
|
||||||
class volScalarField;
|
|
||||||
location "0";
|
|
||||||
object qr;
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
dimensions [1 0 -3 0 0 0 0];
|
|
||||||
|
|
||||||
internalField uniform 0;
|
|
||||||
|
|
||||||
boundaryField
|
|
||||||
{
|
|
||||||
coupledWall_top
|
|
||||||
{
|
|
||||||
type zeroGradient;
|
|
||||||
}
|
|
||||||
|
|
||||||
coupledWall_side
|
|
||||||
{
|
|
||||||
type empty;
|
|
||||||
}
|
|
||||||
|
|
||||||
region0_to_pyrolysisRegion_coupledWall
|
|
||||||
{
|
|
||||||
type mappedField;
|
|
||||||
sampleRegion region0;
|
|
||||||
sampleMode nearestPatchFace;
|
|
||||||
samplePatch region0_to_pyrolysisRegion_coupledWall;
|
|
||||||
offset (0 0 0);
|
|
||||||
field qr; // this is the name of qr field in region0
|
|
||||||
setAverage no;
|
|
||||||
average 0;
|
|
||||||
value uniform 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,39 +0,0 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Version: dev
|
|
||||||
\\/ M anipulation |
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
FoamFile
|
|
||||||
{
|
|
||||||
version 2.0;
|
|
||||||
format ascii;
|
|
||||||
class volScalarField;
|
|
||||||
location "0/pyrolysisRegion";
|
|
||||||
object wood;
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
dimensions [0 0 0 0 0 0 0];
|
|
||||||
|
|
||||||
internalField uniform 1;
|
|
||||||
|
|
||||||
boundaryField
|
|
||||||
{
|
|
||||||
coupledWall_top
|
|
||||||
{
|
|
||||||
type zeroGradient;
|
|
||||||
}
|
|
||||||
region0_to_pyrolysisRegion_coupledWall
|
|
||||||
{
|
|
||||||
type zeroGradient;
|
|
||||||
}
|
|
||||||
oneDEmptyPatch
|
|
||||||
{
|
|
||||||
type empty;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
cd ${0%/*} || exit 1 # Run from this directory
|
|
||||||
|
|
||||||
# Source tutorial clean functions
|
|
||||||
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
|
|
||||||
|
|
||||||
cleanCase
|
|
||||||
|
|
||||||
rm -f 0/ph_rgh
|
|
||||||
rm -rf constant/filmRegion/polyMesh
|
|
||||||
rm -rf constant/pyrolysisRegion/polyMesh
|
|
||||||
rm -rf system/pyrolysisRegion/filmRegion
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
|
||||||
@ -1,43 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
cd ${0%/*} || exit 1 # Run from this directory
|
|
||||||
|
|
||||||
# Source tutorial run functions
|
|
||||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
|
||||||
|
|
||||||
# create the underlying block mesh
|
|
||||||
runApplication blockMesh
|
|
||||||
|
|
||||||
# create faceSet for burner inlet and faceZone for coupled wall
|
|
||||||
runApplication topoSet
|
|
||||||
|
|
||||||
# create burner inlet
|
|
||||||
runApplication createPatch -overwrite
|
|
||||||
|
|
||||||
# extrude Film
|
|
||||||
runApplication extrudeToRegionMesh -dict system/extrudeToRegionMeshDictFilm -overwrite
|
|
||||||
|
|
||||||
rm log.extrudeToRegionMesh
|
|
||||||
|
|
||||||
# extrude pyrolysis
|
|
||||||
runApplication extrudeToRegionMesh -dict system/extrudeToRegionMeshDictPyr -overwrite
|
|
||||||
|
|
||||||
# change samplePatch in the boundary to coupled patch betwee region0 and
|
|
||||||
# pyrolysis
|
|
||||||
foamDictionary constant/filmRegion/polyMesh/boundary \
|
|
||||||
-entry entry0/region0_to_filmRegion_coupledWall/samplePatch \
|
|
||||||
-set region0_to_pyrolysisRegion_coupledWall
|
|
||||||
|
|
||||||
# create faceSets for inlet, outlet, sides for the Film
|
|
||||||
rm log.topoSet
|
|
||||||
runApplication topoSet -region filmRegion
|
|
||||||
|
|
||||||
rm log.createPatch
|
|
||||||
# create actual patches
|
|
||||||
runApplication createPatch -region filmRegion -overwrite
|
|
||||||
|
|
||||||
# Run
|
|
||||||
runApplication $(getApplication)
|
|
||||||
|
|
||||||
paraFoam -touchAll
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
|
||||||
@ -1,20 +0,0 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Version: dev
|
|
||||||
\\/ M anipulation |
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
FoamFile
|
|
||||||
{
|
|
||||||
version 2.0;
|
|
||||||
format ascii;
|
|
||||||
class dictionary;
|
|
||||||
location "constant";
|
|
||||||
object additionalControls;
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
solvePrimaryRegion true;
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,28 +0,0 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Version: dev
|
|
||||||
\\/ M anipulation |
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
FoamFile
|
|
||||||
{
|
|
||||||
version 2.0;
|
|
||||||
format ascii;
|
|
||||||
class dictionary;
|
|
||||||
location "constant";
|
|
||||||
object combustionProperties;
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
combustionModel infinitelyFastChemistry;
|
|
||||||
|
|
||||||
infinitelyFastChemistryCoeffs
|
|
||||||
{
|
|
||||||
semiImplicit no;
|
|
||||||
C 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "reaction"
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,21 +0,0 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Version: dev
|
|
||||||
\\/ M anipulation |
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
FoamFile
|
|
||||||
{
|
|
||||||
version 2.0;
|
|
||||||
format ascii;
|
|
||||||
class uniformDimensionedVectorField;
|
|
||||||
location "constant";
|
|
||||||
object g;
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
dimensions [0 1 -2 0 0 0 0];
|
|
||||||
value (0 0 -9.8);
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,21 +0,0 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Version: dev
|
|
||||||
\\/ M anipulation |
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
FoamFile
|
|
||||||
{
|
|
||||||
version 2.0;
|
|
||||||
format ascii;
|
|
||||||
class uniformDimensionedScalarField;
|
|
||||||
location "constant";
|
|
||||||
object pRef;
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
dimensions [1 -1 -2 0 0 0 0];
|
|
||||||
value 101325;
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,36 +0,0 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Version: dev
|
|
||||||
\\/ M anipulation |
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
FoamFile
|
|
||||||
{
|
|
||||||
version 2.0;
|
|
||||||
format ascii;
|
|
||||||
class dictionary;
|
|
||||||
location "constant";
|
|
||||||
object chemistryProperties;
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
chemistryType
|
|
||||||
{
|
|
||||||
chemistrySolver ode;
|
|
||||||
chemistryThermo pyrolysis;
|
|
||||||
}
|
|
||||||
|
|
||||||
chemistry on;
|
|
||||||
|
|
||||||
initialChemicalTimeStep 1e-07;
|
|
||||||
|
|
||||||
odeCoeffs
|
|
||||||
{
|
|
||||||
solver seulex;
|
|
||||||
eps 0.05;
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "reactions"
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,41 +0,0 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Version: dev
|
|
||||||
\\/ M anipulation |
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
FoamFile
|
|
||||||
{
|
|
||||||
version 2.0;
|
|
||||||
format ascii;
|
|
||||||
class dictionary;
|
|
||||||
location "constant";
|
|
||||||
object radiationProperties;
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
radiationModel opaqueSolid;
|
|
||||||
|
|
||||||
absorptionEmissionModel greyMeanSolid;
|
|
||||||
|
|
||||||
|
|
||||||
greyMeanSolidCoeffs
|
|
||||||
{
|
|
||||||
wood
|
|
||||||
{
|
|
||||||
absorptivity 0.17;
|
|
||||||
emissivity 0.17;
|
|
||||||
}
|
|
||||||
|
|
||||||
char
|
|
||||||
{
|
|
||||||
absorptivity 0.85;
|
|
||||||
emissivity 0.85;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
scatterModel none;
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,36 +0,0 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Version: dev
|
|
||||||
\\/ M anipulation |
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
FoamFile
|
|
||||||
{
|
|
||||||
version 2.0;
|
|
||||||
format ascii;
|
|
||||||
class dictionary;
|
|
||||||
location "constant";
|
|
||||||
object reactions;
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
gaseousSpecies
|
|
||||||
(
|
|
||||||
gas
|
|
||||||
);
|
|
||||||
|
|
||||||
reactions
|
|
||||||
{
|
|
||||||
charReaction
|
|
||||||
{
|
|
||||||
type irreversibleArrheniusSolidReaction;
|
|
||||||
reaction "wood^4.86 = char + gas";
|
|
||||||
A 7.83e10;
|
|
||||||
Ta 15274.57;
|
|
||||||
Tcrit 400;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,66 +0,0 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Version: dev
|
|
||||||
\\/ M anipulation |
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
FoamFile
|
|
||||||
{
|
|
||||||
version 2.0;
|
|
||||||
format binary;
|
|
||||||
class dictionary;
|
|
||||||
location "constant";
|
|
||||||
object thermo.solid;
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
species
|
|
||||||
(
|
|
||||||
wood
|
|
||||||
char
|
|
||||||
);
|
|
||||||
|
|
||||||
wood
|
|
||||||
{
|
|
||||||
specie
|
|
||||||
{
|
|
||||||
molWeight 100;
|
|
||||||
}
|
|
||||||
transport
|
|
||||||
{
|
|
||||||
kappa 0.135;
|
|
||||||
}
|
|
||||||
thermodynamics
|
|
||||||
{
|
|
||||||
Cp 696;
|
|
||||||
Hf -1.41e6;
|
|
||||||
}
|
|
||||||
equationOfState
|
|
||||||
{
|
|
||||||
rho 114.7;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
char
|
|
||||||
{
|
|
||||||
specie
|
|
||||||
{
|
|
||||||
molWeight 50;
|
|
||||||
}
|
|
||||||
transport
|
|
||||||
{
|
|
||||||
kappa 0.4;
|
|
||||||
}
|
|
||||||
thermodynamics
|
|
||||||
{
|
|
||||||
Cp 611;
|
|
||||||
Hf 0;
|
|
||||||
}
|
|
||||||
equationOfState
|
|
||||||
{
|
|
||||||
rho 11.5;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,60 +0,0 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Version: dev
|
|
||||||
\\/ M anipulation |
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
FoamFile
|
|
||||||
{
|
|
||||||
version 2.0;
|
|
||||||
format ascii;
|
|
||||||
class dictionary;
|
|
||||||
object thermophysicalProperties;
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
thermoType
|
|
||||||
{
|
|
||||||
type heSolidThermo;
|
|
||||||
mixture multiComponentMixture;
|
|
||||||
transport constIso;
|
|
||||||
thermo hConst;
|
|
||||||
equationOfState rhoConst;
|
|
||||||
specie specie;
|
|
||||||
energy sensibleEnthalpy;
|
|
||||||
}
|
|
||||||
|
|
||||||
gasThermoType
|
|
||||||
{
|
|
||||||
transport sutherland;
|
|
||||||
thermo janaf;
|
|
||||||
equationOfState perfectGas;
|
|
||||||
specie specie;
|
|
||||||
energy sensibleEnthalpy;
|
|
||||||
}
|
|
||||||
|
|
||||||
gas
|
|
||||||
{
|
|
||||||
specie
|
|
||||||
{
|
|
||||||
molWeight 18.0153;
|
|
||||||
}
|
|
||||||
thermodynamics
|
|
||||||
{
|
|
||||||
Tlow 200;
|
|
||||||
Thigh 5000;
|
|
||||||
Tcommon 1000;
|
|
||||||
highCpCoeffs ( 2.67215 0.00305629 -8.73026e-07 1.20100e-10 -6.39162e-15 -29899.2 6.86282 );
|
|
||||||
lowCpCoeffs ( 3.38684 0.00347498 -6.35470e-06 6.96858e-09 -2.50659e-12 -30208.1 2.59023 );
|
|
||||||
}
|
|
||||||
transport
|
|
||||||
{
|
|
||||||
As 1.67212e-06;
|
|
||||||
Ts 170.672;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "thermo.solid"
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,43 +0,0 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Version: dev
|
|
||||||
\\/ M anipulation |
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
FoamFile
|
|
||||||
{
|
|
||||||
version 2.0;
|
|
||||||
format binary;
|
|
||||||
class dictionary;
|
|
||||||
location "constant";
|
|
||||||
object pyrolysisProperties;
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
pyrolysis
|
|
||||||
{
|
|
||||||
active true;
|
|
||||||
|
|
||||||
pyrolysisModel reactingOneDim;
|
|
||||||
|
|
||||||
regionName pyrolysisRegion;
|
|
||||||
|
|
||||||
reactingOneDimCoeffs
|
|
||||||
{
|
|
||||||
filmCoupled true;
|
|
||||||
|
|
||||||
gasHSource true;
|
|
||||||
qrHSource false;
|
|
||||||
|
|
||||||
radFluxName qr;
|
|
||||||
|
|
||||||
moveMesh false; // true;
|
|
||||||
minimumDelta 1e-6;
|
|
||||||
|
|
||||||
useChemistrySolvers true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,50 +0,0 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Version: dev
|
|
||||||
\\/ M anipulation |
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
FoamFile
|
|
||||||
{
|
|
||||||
version 2.0;
|
|
||||||
format ascii;
|
|
||||||
class dictionary;
|
|
||||||
location "constant";
|
|
||||||
object radiationProperties;
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
radiation on;
|
|
||||||
|
|
||||||
radiationModel fvDOM;
|
|
||||||
|
|
||||||
|
|
||||||
fvDOMCoeffs
|
|
||||||
{
|
|
||||||
nPhi 2; // azimuthal angles in PI/2 on X-Y.(from Y to X)
|
|
||||||
nTheta 2; // polar angles in PI (from Z to X-Y plane)
|
|
||||||
tolerance 1e-2; // convergence tolerance for radiation iteration
|
|
||||||
maxIter 3; // maximum number of iterations
|
|
||||||
}
|
|
||||||
|
|
||||||
// Number of flow iterations per radiation iteration
|
|
||||||
solverFreq 10;
|
|
||||||
|
|
||||||
absorptionEmissionModel constant;
|
|
||||||
|
|
||||||
constantCoeffs
|
|
||||||
{
|
|
||||||
absorptivity 0.1;
|
|
||||||
emissivity 0.1;
|
|
||||||
E 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
scatterModel none;
|
|
||||||
|
|
||||||
|
|
||||||
sootModel none;
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,20 +0,0 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Version: dev
|
|
||||||
\\/ M anipulation |
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
FoamFile
|
|
||||||
{
|
|
||||||
version 2.0;
|
|
||||||
format ascii;
|
|
||||||
class vectorField;
|
|
||||||
location "constant";
|
|
||||||
object reactingCloud1Positions;
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
(
|
|
||||||
|
|
||||||
)
|
|
||||||
// ************************************************************************* //
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user