mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Changing name from ODESolidChemistryModel to solidChemistryModel,
adding a base class basicSolidChemistryModel and deriving pyrolysisSolidChemistry model for solid
This commit is contained in:
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -49,7 +49,7 @@ void noPyrolysis::constructThermoChemistry()
|
|||||||
{
|
{
|
||||||
solidChemistry_.reset
|
solidChemistry_.reset
|
||||||
(
|
(
|
||||||
solidChemistryModel::New(regionMesh()).ptr()
|
basicSolidChemistryModel::New(regionMesh()).ptr()
|
||||||
);
|
);
|
||||||
|
|
||||||
solidThermo_.reset(&solidChemistry_->solidThermo());
|
solidThermo_.reset(&solidChemistry_->solidThermo());
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -37,7 +37,7 @@ SourceFiles
|
|||||||
|
|
||||||
#include "pyrolysisModel.H"
|
#include "pyrolysisModel.H"
|
||||||
#include "volFieldsFwd.H"
|
#include "volFieldsFwd.H"
|
||||||
#include "solidChemistryModel.H"
|
#include "basicSolidChemistryModel.H"
|
||||||
#include "radiationModel.H"
|
#include "radiationModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -82,7 +82,7 @@ protected:
|
|||||||
void constructThermoChemistry();
|
void constructThermoChemistry();
|
||||||
|
|
||||||
//- Reference to the solid chemistry model
|
//- Reference to the solid chemistry model
|
||||||
autoPtr<solidChemistryModel> solidChemistry_;
|
autoPtr<basicSolidChemistryModel> solidChemistry_;
|
||||||
|
|
||||||
//- Reference to solid thermo
|
//- Reference to solid thermo
|
||||||
autoPtr<solidReactionThermo> solidThermo_;
|
autoPtr<solidReactionThermo> solidThermo_;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -303,7 +303,7 @@ void reactingOneDim::calculateMassTransfer()
|
|||||||
reactingOneDim::reactingOneDim(const word& modelType, const fvMesh& mesh)
|
reactingOneDim::reactingOneDim(const word& modelType, const fvMesh& mesh)
|
||||||
:
|
:
|
||||||
pyrolysisModel(modelType, mesh),
|
pyrolysisModel(modelType, mesh),
|
||||||
solidChemistry_(solidChemistryModel::New(regionMesh())),
|
solidChemistry_(basicSolidChemistryModel::New(regionMesh())),
|
||||||
solidThermo_(solidChemistry_->solidThermo()),
|
solidThermo_(solidChemistry_->solidThermo()),
|
||||||
radiation_(radiation::radiationModel::New(solidThermo_.T())),
|
radiation_(radiation::radiationModel::New(solidThermo_.T())),
|
||||||
rho_
|
rho_
|
||||||
@ -386,7 +386,7 @@ reactingOneDim::reactingOneDim
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
pyrolysisModel(modelType, mesh, dict),
|
pyrolysisModel(modelType, mesh, dict),
|
||||||
solidChemistry_(solidChemistryModel::New(regionMesh())),
|
solidChemistry_(basicSolidChemistryModel::New(regionMesh())),
|
||||||
solidThermo_(solidChemistry_->solidThermo()),
|
solidThermo_(solidChemistry_->solidThermo()),
|
||||||
radiation_(radiation::radiationModel::New(solidThermo_.T())),
|
radiation_(radiation::radiationModel::New(solidThermo_.T())),
|
||||||
rho_
|
rho_
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -36,7 +36,7 @@ SourceFiles
|
|||||||
#define reactingOneDim_H
|
#define reactingOneDim_H
|
||||||
|
|
||||||
#include "pyrolysisModel.H"
|
#include "pyrolysisModel.H"
|
||||||
#include "solidChemistryModel.H"
|
#include "basicSolidChemistryModel.H"
|
||||||
#include "radiationModel.H"
|
#include "radiationModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -76,7 +76,7 @@ protected:
|
|||||||
// Protected data
|
// Protected data
|
||||||
|
|
||||||
//- Reference to the solid chemistry model
|
//- Reference to the solid chemistry model
|
||||||
autoPtr<solidChemistryModel> solidChemistry_;
|
autoPtr<basicSolidChemistryModel> solidChemistry_;
|
||||||
|
|
||||||
//- Reference to solid thermo
|
//- Reference to solid thermo
|
||||||
solidReactionThermo& solidThermo_;
|
solidReactionThermo& solidThermo_;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
solidChemistryModel/solidChemistryModel.C
|
basicSolidChemistryModel/basicSolidChemistryModel.C
|
||||||
solidChemistryModel/solidChemistryModelNew.C
|
basicSolidChemistryModel/basicSolidChemistryModelNew.C
|
||||||
solidChemistryModel/solidChemistryModels.C
|
basicSolidChemistryModel/basicSolidChemistryModels.C
|
||||||
|
|
||||||
solidChemistrySolver/makeSolidChemistrySolvers.C
|
solidChemistrySolver/makeSolidChemistrySolvers.C
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,56 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "basicSolidChemistryModel.H"
|
||||||
|
#include "fvMesh.H"
|
||||||
|
#include "Time.H"
|
||||||
|
|
||||||
|
/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(basicSolidChemistryModel, 0);
|
||||||
|
defineRunTimeSelectionTable(basicSolidChemistryModel, fvMesh);
|
||||||
|
}
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::basicSolidChemistryModel::basicSolidChemistryModel
|
||||||
|
(
|
||||||
|
const fvMesh& mesh
|
||||||
|
)
|
||||||
|
:
|
||||||
|
basicChemistryModel(mesh),
|
||||||
|
solidThermo_(solidReactionThermo::New(mesh))
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::basicSolidChemistryModel::~basicSolidChemistryModel()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,167 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
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
|
||||||
|
{
|
||||||
|
// Private Member Functions
|
||||||
|
|
||||||
|
//- Construct as copy (not implemented)
|
||||||
|
basicSolidChemistryModel(const basicSolidChemistryModel&);
|
||||||
|
|
||||||
|
//- Disallow default bitwise assignment
|
||||||
|
void operator=(const basicSolidChemistryModel&);
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Protected data
|
||||||
|
|
||||||
|
//- Solid thermo package
|
||||||
|
autoPtr<solidReactionThermo> solidThermo_;
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("basicSolidChemistryModel");
|
||||||
|
|
||||||
|
|
||||||
|
//- Declare run-time constructor selection tables
|
||||||
|
declareRunTimeSelectionTable
|
||||||
|
(
|
||||||
|
autoPtr,
|
||||||
|
basicSolidChemistryModel,
|
||||||
|
fvMesh,
|
||||||
|
(const fvMesh& mesh),
|
||||||
|
(mesh)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from mesh
|
||||||
|
basicSolidChemistryModel(const fvMesh& mesh);
|
||||||
|
|
||||||
|
|
||||||
|
//- Selector
|
||||||
|
static autoPtr<basicSolidChemistryModel> New(const fvMesh& mesh);
|
||||||
|
|
||||||
|
|
||||||
|
//- 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/m3/s]
|
||||||
|
virtual tmp<DimensionedField<scalar, volMesh> > RRg() const = 0;
|
||||||
|
|
||||||
|
//- Return total solids mass source term [kg/m3/s]
|
||||||
|
virtual tmp<DimensionedField<scalar, volMesh> > RRs() const = 0;
|
||||||
|
|
||||||
|
//- Return chemical source terms for solids [kg/m3/s]
|
||||||
|
virtual const DimensionedField<scalar, volMesh>& RRs
|
||||||
|
(
|
||||||
|
const label i
|
||||||
|
) const = 0;
|
||||||
|
|
||||||
|
//- Return chemical source terms for gases [kg/m3/s]
|
||||||
|
virtual const DimensionedField<scalar, volMesh>& RRg
|
||||||
|
(
|
||||||
|
const label i
|
||||||
|
) const = 0;
|
||||||
|
|
||||||
|
//- 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;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#include "basicSolidChemistryModelI.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,41 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
inline Foam::solidReactionThermo& Foam::basicSolidChemistryModel::solidThermo()
|
||||||
|
{
|
||||||
|
return solidThermo_();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline const Foam::solidReactionThermo&
|
||||||
|
Foam::basicSolidChemistryModel::solidThermo() const
|
||||||
|
{
|
||||||
|
return solidThermo_();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -23,11 +23,12 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "solidChemistryModel.H"
|
#include "basicSolidChemistryModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::autoPtr<Foam::solidChemistryModel> Foam::solidChemistryModel::New
|
Foam::autoPtr<Foam::basicSolidChemistryModel> Foam::basicSolidChemistryModel::
|
||||||
|
New
|
||||||
(
|
(
|
||||||
const fvMesh& mesh
|
const fvMesh& mesh
|
||||||
)
|
)
|
||||||
@ -160,7 +161,7 @@ Foam::autoPtr<Foam::solidChemistryModel> Foam::solidChemistryModel::New
|
|||||||
FatalError<< exit(FatalError);
|
FatalError<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
return autoPtr<solidChemistryModel>(cstrIter()(mesh));
|
return autoPtr<basicSolidChemistryModel>(cstrIter()(mesh));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -22,7 +22,7 @@ License
|
|||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
InClass
|
InClass
|
||||||
Foam::solidChemistryModel
|
Foam::basicSolidChemistryModel
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Creates solid chemistry model instances templated on the type of
|
Creates solid chemistry model instances templated on the type of
|
||||||
@ -32,7 +32,8 @@ Description
|
|||||||
|
|
||||||
#include "makeSolidChemistryModel.H"
|
#include "makeSolidChemistryModel.H"
|
||||||
|
|
||||||
#include "ODESolidChemistryModel.H"
|
#include "pyrolysisChemistryModel.H"
|
||||||
|
#include "basicSolidChemistryModel.H"
|
||||||
#include "solidChemistryModel.H"
|
#include "solidChemistryModel.H"
|
||||||
#include "solidThermoPhysicsTypes.H"
|
#include "solidThermoPhysicsTypes.H"
|
||||||
#include "thermoPhysicsTypes.H"
|
#include "thermoPhysicsTypes.H"
|
||||||
@ -43,16 +44,18 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
makeSolidChemistryModel
|
makeSolidChemistryModel
|
||||||
(
|
(
|
||||||
ODESolidChemistryModel,
|
|
||||||
solidChemistryModel,
|
solidChemistryModel,
|
||||||
|
pyrolysisChemistryModel,
|
||||||
|
basicSolidChemistryModel,
|
||||||
hConstSolidThermoPhysics,
|
hConstSolidThermoPhysics,
|
||||||
gasHThermoPhysics
|
gasHThermoPhysics
|
||||||
);
|
);
|
||||||
|
|
||||||
makeSolidChemistryModel
|
makeSolidChemistryModel
|
||||||
(
|
(
|
||||||
ODESolidChemistryModel,
|
|
||||||
solidChemistryModel,
|
solidChemistryModel,
|
||||||
|
pyrolysisChemistryModel,
|
||||||
|
basicSolidChemistryModel,
|
||||||
hExponentialSolidThermoPhysics,
|
hExponentialSolidThermoPhysics,
|
||||||
gasHThermoPhysics
|
gasHThermoPhysics
|
||||||
);
|
);
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -30,6 +30,7 @@ Description
|
|||||||
#define makeSolidChemistryModel_H
|
#define makeSolidChemistryModel_H
|
||||||
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
#include "solidChemistryModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -38,10 +39,19 @@ namespace Foam
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
#define makeSolidChemistryModel(SS, Comp, SThermo, GThermo) \
|
#define makeSolidChemistryModel(sChemistry, SS, Comp, SThermo, GThermo) \
|
||||||
\
|
\
|
||||||
typedef SS<Comp, SThermo, GThermo> SS##Comp##SThermo##GThermo; \
|
typedef SS<Comp, SThermo, GThermo> SS##Comp##SThermo##GThermo; \
|
||||||
\
|
\
|
||||||
|
typedef sChemistry<Comp, SThermo> sChemistryl##Comp##SThermo; \
|
||||||
|
\
|
||||||
|
defineTemplateTypeNameAndDebugWithName \
|
||||||
|
( \
|
||||||
|
sChemistryl##Comp##SThermo, \
|
||||||
|
(#sChemistry"<"#Comp"," + SThermo::typeName() + ">").c_str(), \
|
||||||
|
0 \
|
||||||
|
); \
|
||||||
|
\
|
||||||
defineTemplateTypeNameAndDebugWithName \
|
defineTemplateTypeNameAndDebugWithName \
|
||||||
( \
|
( \
|
||||||
SS##Comp##SThermo##GThermo, \
|
SS##Comp##SThermo##GThermo, \
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -23,73 +23,33 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "ODESolidChemistryModel.H"
|
#include "pyrolysisChemistryModel.H"
|
||||||
#include "reactingMixture.H"
|
|
||||||
#include "solidReaction.H"
|
#include "solidReaction.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class CompType, class SolidThermo, class GasThermo>
|
template<class CompType, class SolidThermo, class GasThermo>
|
||||||
Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::
|
Foam::pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::
|
||||||
ODESolidChemistryModel
|
pyrolysisChemistryModel
|
||||||
(
|
(
|
||||||
const fvMesh& mesh
|
const fvMesh& mesh
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
CompType(mesh),
|
solidChemistryModel<CompType, SolidThermo>(mesh),
|
||||||
ODE(),
|
pyrolisisGases_(this->reactions_[0].gasSpecies()),
|
||||||
Ys_(this->solidThermo().composition().Y()),
|
|
||||||
reactions_
|
|
||||||
(
|
|
||||||
dynamic_cast<const reactingMixture<SolidThermo>& >
|
|
||||||
(
|
|
||||||
this->solidThermo()
|
|
||||||
)
|
|
||||||
),
|
|
||||||
pyrolisisGases_(reactions_[0].gasSpecies()),
|
|
||||||
solidThermo_
|
|
||||||
(
|
|
||||||
dynamic_cast<const reactingMixture<SolidThermo>& >
|
|
||||||
(
|
|
||||||
this->solidThermo()
|
|
||||||
).speciesData()
|
|
||||||
),
|
|
||||||
gasThermo_(pyrolisisGases_.size()),
|
gasThermo_(pyrolisisGases_.size()),
|
||||||
nGases_(pyrolisisGases_.size()),
|
nGases_(pyrolisisGases_.size()),
|
||||||
nSpecie_(Ys_.size() + nGases_),
|
nSpecie_(this->Ys_.size() + nGases_),
|
||||||
nSolids_(Ys_.size()),
|
|
||||||
nReaction_(reactions_.size()),
|
|
||||||
RRs_(nSolids_),
|
|
||||||
RRg_(nGases_),
|
RRg_(nGases_),
|
||||||
Ys0_(nSolids_),
|
Ys0_(this->nSolids_),
|
||||||
cellCounter_(0),
|
cellCounter_(0)
|
||||||
reactingCells_(mesh.nCells(), true)
|
|
||||||
{
|
{
|
||||||
// create the fields for the chemistry sources
|
// create the fields for the chemistry sources
|
||||||
forAll(RRs_, fieldI)
|
forAll(this->RRs_, fieldI)
|
||||||
{
|
{
|
||||||
RRs_.set
|
|
||||||
(
|
|
||||||
fieldI,
|
|
||||||
new DimensionedField<scalar, volMesh>
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"RRs." + Ys_[fieldI].name(),
|
|
||||||
mesh.time().timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
mesh,
|
|
||||||
dimensionedScalar("zero", dimMass/dimVolume/dimTime, 0.0)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
IOobject header
|
IOobject header
|
||||||
(
|
(
|
||||||
Ys_[fieldI].name() + "0",
|
this->Ys_[fieldI].name() + "0",
|
||||||
mesh.time().timeName(),
|
mesh.time().timeName(),
|
||||||
mesh,
|
mesh,
|
||||||
IOobject::NO_READ
|
IOobject::NO_READ
|
||||||
@ -105,7 +65,7 @@ ODESolidChemistryModel
|
|||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
Ys_[fieldI].name() + "0",
|
this->Ys_[fieldI].name() + "0",
|
||||||
mesh.time().timeName(),
|
mesh.time().timeName(),
|
||||||
mesh,
|
mesh,
|
||||||
IOobject::MUST_READ,
|
IOobject::MUST_READ,
|
||||||
@ -137,7 +97,7 @@ ODESolidChemistryModel
|
|||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
Ys_[fieldI].name() + "0",
|
this->Ys_[fieldI].name() + "0",
|
||||||
mesh.time().timeName(),
|
mesh.time().timeName(),
|
||||||
mesh,
|
mesh,
|
||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
@ -150,7 +110,7 @@ ODESolidChemistryModel
|
|||||||
// Calculate inital values of Ysi0 = rho*delta*Yi
|
// Calculate inital values of Ysi0 = rho*delta*Yi
|
||||||
Ys0_[fieldI].internalField() =
|
Ys0_[fieldI].internalField() =
|
||||||
this->solidThermo().rho()
|
this->solidThermo().rho()
|
||||||
*max(Ys_[fieldI], scalar(0.001))*mesh.V();
|
*max(this->Ys_[fieldI], scalar(0.001))*mesh.V();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -190,23 +150,24 @@ ODESolidChemistryModel
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< "solidChemistryModel: Number of solids = " << nSolids_ << endl;
|
Info<< "pyrolysisChemistryModel: " << nl;
|
||||||
|
Info<< indent << "Number of solids = " << this->nSolids_ << nl;
|
||||||
Info<< "solidChemistryModel: Number of gases = " << nGases_ << endl;
|
Info<< indent << "Number of gases = " << nGases_ << nl;
|
||||||
|
forAll(this->reactions_, i)
|
||||||
forAll(reactions_, i)
|
|
||||||
{
|
{
|
||||||
Info<< indent << reactions_[i] << nl;
|
Info<< dynamic_cast<const solidReaction<SolidThermo>& >
|
||||||
|
(
|
||||||
|
this->reactions_[i]
|
||||||
|
) << nl;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class CompType, class SolidThermo, class GasThermo>
|
template<class CompType, class SolidThermo, class GasThermo>
|
||||||
Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::
|
Foam::pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::
|
||||||
~ODESolidChemistryModel()
|
~pyrolysisChemistryModel()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -214,7 +175,7 @@ Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::
|
|||||||
|
|
||||||
template<class CompType, class SolidThermo, class GasThermo>
|
template<class CompType, class SolidThermo, class GasThermo>
|
||||||
Foam::scalarField Foam::
|
Foam::scalarField Foam::
|
||||||
ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::omega
|
pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::omega
|
||||||
(
|
(
|
||||||
const scalarField& c,
|
const scalarField& c,
|
||||||
const scalar T,
|
const scalar T,
|
||||||
@ -229,9 +190,9 @@ ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::omega
|
|||||||
|
|
||||||
scalarField om(nEqns(), 0.0);
|
scalarField om(nEqns(), 0.0);
|
||||||
|
|
||||||
forAll(reactions_, i)
|
forAll(this->reactions_, i)
|
||||||
{
|
{
|
||||||
const Reaction<SolidThermo>& R = reactions_[i];
|
const Reaction<SolidThermo>& R = this->reactions_[i];
|
||||||
|
|
||||||
scalar omegai = omega
|
scalar omegai = omega
|
||||||
(
|
(
|
||||||
@ -242,13 +203,13 @@ ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::omega
|
|||||||
{
|
{
|
||||||
label si = R.lhs()[s].index;
|
label si = R.lhs()[s].index;
|
||||||
om[si] -= omegai;
|
om[si] -= omegai;
|
||||||
rhoL = solidThermo_[si].rho(p, T);
|
rhoL = this->solidThermo_[si].rho(p, T);
|
||||||
}
|
}
|
||||||
scalar sr = 0.0;
|
scalar sr = 0.0;
|
||||||
forAll(R.rhs(), s)
|
forAll(R.rhs(), s)
|
||||||
{
|
{
|
||||||
label si = R.rhs()[s].index;
|
label si = R.rhs()[s].index;
|
||||||
scalar rhoR = solidThermo_[si].rho(p, T);
|
scalar rhoR = this->solidThermo_[si].rho(p, T);
|
||||||
sr = rhoR/rhoL;
|
sr = rhoR/rhoL;
|
||||||
om[si] += sr*omegai;
|
om[si] += sr*omegai;
|
||||||
|
|
||||||
@ -260,7 +221,7 @@ ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::omega
|
|||||||
forAll(R.grhs(), g)
|
forAll(R.grhs(), g)
|
||||||
{
|
{
|
||||||
label gi = R.grhs()[g].index;
|
label gi = R.grhs()[g].index;
|
||||||
om[gi + nSolids_] += (1.0 - sr)*omegai;
|
om[gi + this->nSolids_] += (1.0 - sr)*omegai;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -270,7 +231,7 @@ ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::omega
|
|||||||
|
|
||||||
template<class CompType, class SolidThermo, class GasThermo>
|
template<class CompType, class SolidThermo, class GasThermo>
|
||||||
Foam::scalar
|
Foam::scalar
|
||||||
Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::omega
|
Foam::pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::omega
|
||||||
(
|
(
|
||||||
const Reaction<SolidThermo>& R,
|
const Reaction<SolidThermo>& R,
|
||||||
const scalarField& c,
|
const scalarField& c,
|
||||||
@ -314,7 +275,7 @@ Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::omega
|
|||||||
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo, class GasThermo>
|
template<class CompType, class SolidThermo, class GasThermo>
|
||||||
void Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::
|
void Foam::pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::
|
||||||
derivatives
|
derivatives
|
||||||
(
|
(
|
||||||
const scalar time,
|
const scalar time,
|
||||||
@ -331,19 +292,19 @@ derivatives
|
|||||||
|
|
||||||
//Total mass concentration
|
//Total mass concentration
|
||||||
scalar cTot = 0.0;
|
scalar cTot = 0.0;
|
||||||
for (label i=0; i<nSolids_; i++)
|
for (label i=0; i<this->nSolids_; i++)
|
||||||
{
|
{
|
||||||
cTot += c[i];
|
cTot += c[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
scalar newCp = 0.0;
|
scalar newCp = 0.0;
|
||||||
scalar newhi = 0.0;
|
scalar newhi = 0.0;
|
||||||
for (label i=0; i<nSolids_; i++)
|
for (label i=0; i<this->nSolids_; i++)
|
||||||
{
|
{
|
||||||
scalar dYidt = dcdt[i]/cTot;
|
scalar dYidt = dcdt[i]/cTot;
|
||||||
scalar Yi = c[i]/cTot;
|
scalar Yi = c[i]/cTot;
|
||||||
newCp += Yi*solidThermo_[i].Cp(p, T);
|
newCp += Yi*this->solidThermo_[i].Cp(p, T);
|
||||||
newhi -= dYidt*solidThermo_[i].Hc();
|
newhi -= dYidt*this->solidThermo_[i].Hc();
|
||||||
}
|
}
|
||||||
|
|
||||||
scalar dTdt = newhi/newCp;
|
scalar dTdt = newhi/newCp;
|
||||||
@ -356,7 +317,8 @@ derivatives
|
|||||||
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo, class GasThermo>
|
template<class CompType, class SolidThermo, class GasThermo>
|
||||||
void Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::jacobian
|
void Foam::pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::
|
||||||
|
jacobian
|
||||||
(
|
(
|
||||||
const scalar t,
|
const scalar t,
|
||||||
const scalarField& c,
|
const scalarField& c,
|
||||||
@ -369,7 +331,7 @@ void Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::jacobian
|
|||||||
|
|
||||||
scalarField c2(nSpecie_, 0.0);
|
scalarField c2(nSpecie_, 0.0);
|
||||||
|
|
||||||
for (label i=0; i<nSolids_; i++)
|
for (label i=0; i<this->nSolids_; i++)
|
||||||
{
|
{
|
||||||
c2[i] = max(c[i], 0.0);
|
c2[i] = max(c[i], 0.0);
|
||||||
}
|
}
|
||||||
@ -385,9 +347,9 @@ void Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::jacobian
|
|||||||
// length of the first argument must be nSolids
|
// length of the first argument must be nSolids
|
||||||
dcdt = omega(c2, T, p);
|
dcdt = omega(c2, T, p);
|
||||||
|
|
||||||
for (label ri=0; ri<reactions_.size(); ri++)
|
for (label ri=0; ri<this->reactions_.size(); ri++)
|
||||||
{
|
{
|
||||||
const Reaction<SolidThermo>& R = reactions_[ri];
|
const Reaction<SolidThermo>& R = this->reactions_[ri];
|
||||||
|
|
||||||
scalar kf0 = R.kf(p, T, c2);
|
scalar kf0 = R.kf(p, T, c2);
|
||||||
|
|
||||||
@ -451,96 +413,9 @@ void Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::jacobian
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo, class GasThermo>
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::tc() const
|
|
||||||
{
|
|
||||||
notImplemented
|
|
||||||
(
|
|
||||||
"ODESolidChemistryModel::tc()"
|
|
||||||
);
|
|
||||||
|
|
||||||
return volScalarField::null();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo, class GasThermo>
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::Sh() const
|
|
||||||
{
|
|
||||||
tmp<volScalarField> tSh
|
|
||||||
(
|
|
||||||
new volScalarField
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"Sh",
|
|
||||||
this->mesh_.time().timeName(),
|
|
||||||
this->mesh_,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::AUTO_WRITE,
|
|
||||||
false
|
|
||||||
),
|
|
||||||
this->mesh_,
|
|
||||||
dimensionedScalar("zero", dimEnergy/dimTime/dimVolume, 0.0),
|
|
||||||
zeroGradientFvPatchScalarField::typeName
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (this->chemistry_)
|
|
||||||
{
|
|
||||||
scalarField& Sh = tSh();
|
|
||||||
|
|
||||||
forAll(Ys_, i)
|
|
||||||
{
|
|
||||||
forAll(Sh, cellI)
|
|
||||||
{
|
|
||||||
scalar hf = solidThermo_[i].Hc();
|
|
||||||
Sh[cellI] -= hf*RRs_[i][cellI];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return tSh;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo, class GasThermo>
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::dQ() const
|
|
||||||
{
|
|
||||||
tmp<volScalarField> tdQ
|
|
||||||
(
|
|
||||||
new volScalarField
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"dQ",
|
|
||||||
this->mesh_.time().timeName(),
|
|
||||||
this->mesh_,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE,
|
|
||||||
false
|
|
||||||
),
|
|
||||||
this->mesh_,
|
|
||||||
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0),
|
|
||||||
zeroGradientFvPatchScalarField::typeName
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (this->chemistry_)
|
|
||||||
{
|
|
||||||
volScalarField& dQ = tdQ();
|
|
||||||
dQ.dimensionedInternalField() = this->mesh_.V()*Sh()();
|
|
||||||
}
|
|
||||||
|
|
||||||
return tdQ;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo, class GasThermo>
|
template<class CompType, class SolidThermo, class GasThermo>
|
||||||
Foam::label Foam::
|
Foam::label Foam::
|
||||||
ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::nEqns() const
|
pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::nEqns() const
|
||||||
{
|
{
|
||||||
// nEqns = number of solids + gases + temperature + pressure
|
// nEqns = number of solids + gases + temperature + pressure
|
||||||
return (nSpecie_ + 2);
|
return (nSpecie_ + 2);
|
||||||
@ -548,7 +423,7 @@ ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::nEqns() const
|
|||||||
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo, class GasThermo>
|
template<class CompType, class SolidThermo, class GasThermo>
|
||||||
void Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::
|
void Foam::pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::
|
||||||
calculate()
|
calculate()
|
||||||
{
|
{
|
||||||
if (!this->chemistry_)
|
if (!this->chemistry_)
|
||||||
@ -570,10 +445,11 @@ calculate()
|
|||||||
this->solidThermo().rho()
|
this->solidThermo().rho()
|
||||||
);
|
);
|
||||||
|
|
||||||
forAll(RRs_, i)
|
forAll(this->RRs_, i)
|
||||||
{
|
{
|
||||||
RRs_[i].field() = 0.0;
|
this->RRs_[i].field() = 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll(RRg_, i)
|
forAll(RRg_, i)
|
||||||
{
|
{
|
||||||
RRg_[i].field() = 0.0;
|
RRg_[i].field() = 0.0;
|
||||||
@ -585,28 +461,28 @@ calculate()
|
|||||||
|
|
||||||
const scalar delta = this->mesh().V()[celli];
|
const scalar delta = this->mesh().V()[celli];
|
||||||
|
|
||||||
if (reactingCells_[celli])
|
if (this->reactingCells_[celli])
|
||||||
{
|
{
|
||||||
scalar rhoi = rho[celli];
|
scalar rhoi = rho[celli];
|
||||||
scalar Ti = this->solidThermo().T()[celli];
|
scalar Ti = this->solidThermo().T()[celli];
|
||||||
scalar pi = this->solidThermo().p()[celli];
|
scalar pi = this->solidThermo().p()[celli];
|
||||||
|
|
||||||
scalarField c(nSpecie_, 0.0);
|
scalarField c(nSpecie_, 0.0);
|
||||||
for (label i=0; i<nSolids_; i++)
|
for (label i=0; i<this->nSolids_; i++)
|
||||||
{
|
{
|
||||||
c[i] = rhoi*Ys_[i][celli]*delta;
|
c[i] = rhoi*this->Ys_[i][celli]*delta;
|
||||||
}
|
}
|
||||||
|
|
||||||
const scalarField dcdt = omega(c, Ti, pi, true);
|
const scalarField dcdt = omega(c, Ti, pi, true);
|
||||||
|
|
||||||
forAll(RRs_, i)
|
forAll(this->RRs_, i)
|
||||||
{
|
{
|
||||||
RRs_[i][celli] = dcdt[i]/delta;
|
this->RRs_[i][celli] = dcdt[i]/delta;
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll(RRg_, i)
|
forAll(RRg_, i)
|
||||||
{
|
{
|
||||||
RRg_[i][celli] = dcdt[nSolids_ + i]/delta;
|
RRg_[i][celli] = dcdt[this->nSolids_ + i]/delta;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -615,7 +491,7 @@ calculate()
|
|||||||
|
|
||||||
template<class CompType, class SolidThermo, class GasThermo>
|
template<class CompType, class SolidThermo, class GasThermo>
|
||||||
Foam::scalar
|
Foam::scalar
|
||||||
Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::solve
|
Foam::pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::solve
|
||||||
(
|
(
|
||||||
const scalar t0,
|
const scalar t0,
|
||||||
const scalar deltaT
|
const scalar deltaT
|
||||||
@ -642,9 +518,9 @@ Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::solve
|
|||||||
this->solidThermo().rho()
|
this->solidThermo().rho()
|
||||||
);
|
);
|
||||||
|
|
||||||
forAll(RRs_, i)
|
forAll(this->RRs_, i)
|
||||||
{
|
{
|
||||||
RRs_[i].field() = 0.0;
|
this->RRs_[i].field() = 0.0;
|
||||||
}
|
}
|
||||||
forAll(RRg_, i)
|
forAll(RRg_, i)
|
||||||
{
|
{
|
||||||
@ -654,7 +530,7 @@ Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::solve
|
|||||||
|
|
||||||
forAll(rho, celli)
|
forAll(rho, celli)
|
||||||
{
|
{
|
||||||
if (reactingCells_[celli])
|
if (this->reactingCells_[celli])
|
||||||
{
|
{
|
||||||
cellCounter_ = celli;
|
cellCounter_ = celli;
|
||||||
|
|
||||||
@ -668,9 +544,9 @@ Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::solve
|
|||||||
|
|
||||||
scalar delta = this->mesh().V()[celli];
|
scalar delta = this->mesh().V()[celli];
|
||||||
|
|
||||||
for (label i=0; i<nSolids_; i++)
|
for (label i=0; i<this->nSolids_; i++)
|
||||||
{
|
{
|
||||||
c[i] = rhoi*Ys_[i][celli]*delta;
|
c[i] = rhoi*this->Ys_[i][celli]*delta;
|
||||||
}
|
}
|
||||||
|
|
||||||
c0 = c;
|
c0 = c;
|
||||||
@ -690,7 +566,7 @@ Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::solve
|
|||||||
scalar cTot = 0.0;
|
scalar cTot = 0.0;
|
||||||
|
|
||||||
//Total mass concentration
|
//Total mass concentration
|
||||||
for (label i=0; i<nSolids_; i++)
|
for (label i=0; i<this->nSolids_; i++)
|
||||||
{
|
{
|
||||||
cTot += c[i];
|
cTot += c[i];
|
||||||
}
|
}
|
||||||
@ -700,13 +576,13 @@ Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::solve
|
|||||||
scalar invRho = 0.0;
|
scalar invRho = 0.0;
|
||||||
scalarList dcdt = (c - c0)/dt;
|
scalarList dcdt = (c - c0)/dt;
|
||||||
|
|
||||||
for (label i=0; i<nSolids_; i++)
|
for (label i=0; i<this->nSolids_; i++)
|
||||||
{
|
{
|
||||||
scalar dYi = dcdt[i]/cTot;
|
scalar dYi = dcdt[i]/cTot;
|
||||||
scalar Yi = c[i]/cTot;
|
scalar Yi = c[i]/cTot;
|
||||||
newCp += Yi*solidThermo_[i].Cp(pi, Ti);
|
newCp += Yi*this->solidThermo_[i].Cp(pi, Ti);
|
||||||
newhi -= dYi*solidThermo_[i].Hc();
|
newhi -= dYi*this->solidThermo_[i].Hc();
|
||||||
invRho += Yi/solidThermo_[i].rho(pi, Ti);
|
invRho += Yi/this->solidThermo_[i].rho(pi, Ti);
|
||||||
}
|
}
|
||||||
|
|
||||||
scalar dTi = (newhi/newCp)*dt;
|
scalar dTi = (newhi/newCp)*dt;
|
||||||
@ -722,14 +598,14 @@ Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::solve
|
|||||||
deltaTMin = min(tauC, deltaTMin);
|
deltaTMin = min(tauC, deltaTMin);
|
||||||
dc = c - c0;
|
dc = c - c0;
|
||||||
|
|
||||||
forAll(RRs_, i)
|
forAll(this->RRs_, i)
|
||||||
{
|
{
|
||||||
RRs_[i][celli] = dc[i]/(deltaT*delta);
|
this->RRs_[i][celli] = dc[i]/(deltaT*delta);
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll(RRg_, i)
|
forAll(RRg_, i)
|
||||||
{
|
{
|
||||||
RRg_[i][celli] = dc[nSolids_ + i]/(deltaT*delta);
|
RRg_[i][celli] = dc[this->nSolids_ + i]/(deltaT*delta);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update Ys0_
|
// Update Ys0_
|
||||||
@ -746,7 +622,7 @@ Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::solve
|
|||||||
|
|
||||||
template<class CompType, class SolidThermo,class GasThermo>
|
template<class CompType, class SolidThermo,class GasThermo>
|
||||||
Foam::tmp<Foam::volScalarField>
|
Foam::tmp<Foam::volScalarField>
|
||||||
Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::gasHs
|
Foam::pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::gasHs
|
||||||
(
|
(
|
||||||
const volScalarField& p,
|
const volScalarField& p,
|
||||||
const volScalarField& T,
|
const volScalarField& T,
|
||||||
@ -785,9 +661,9 @@ Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::gasHs
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo,class GasThermo>
|
template<class CompType, class SolidThermo, class GasThermo>
|
||||||
Foam::scalar
|
Foam::scalar
|
||||||
Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::solve
|
Foam::pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::solve
|
||||||
(
|
(
|
||||||
scalarField &c,
|
scalarField &c,
|
||||||
const scalar T,
|
const scalar T,
|
||||||
@ -798,7 +674,7 @@ Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::solve
|
|||||||
{
|
{
|
||||||
notImplemented
|
notImplemented
|
||||||
(
|
(
|
||||||
"ODESolidChemistryModel::solve"
|
"pyrolysisChemistryModel::solve"
|
||||||
"("
|
"("
|
||||||
"scalarField&, "
|
"scalarField&, "
|
||||||
"const scalar, "
|
"const scalar, "
|
||||||
@ -809,14 +685,4 @@ Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::solve
|
|||||||
);
|
);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo,class GasThermo>
|
|
||||||
void Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::
|
|
||||||
setCellReacting(const label cellI, const bool active)
|
|
||||||
{
|
|
||||||
reactingCells_[cellI] = active;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -22,26 +22,24 @@ License
|
|||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Class
|
Class
|
||||||
Foam::ODESolidChemistryModel
|
Foam::pyrolysisChemistryModel
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Extends base chemistry model by adding a thermo package, and ODE functions.
|
Pyrolysis chemistry model. It includes gas phase in the solid
|
||||||
Introduces chemistry equation system and evaluation of chemical source
|
reaction.
|
||||||
terms.
|
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
ODESolidChemistryModelI.H
|
pyrolysisChemistryModelI.H
|
||||||
ODESolidChemistryModel.C
|
pyrolysisChemistryModel.C
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef ODESolidChemistryModel_H
|
#ifndef pyrolysisChemistryModel_H
|
||||||
#define ODESolidChemistryModel_H
|
#define pyrolysisChemistryModel_H
|
||||||
|
|
||||||
#include "Reaction.H"
|
|
||||||
#include "ODE.H"
|
|
||||||
#include "volFieldsFwd.H"
|
#include "volFieldsFwd.H"
|
||||||
#include "DimensionedField.H"
|
#include "DimensionedField.H"
|
||||||
|
#include "solidChemistryModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -52,35 +50,25 @@ namespace Foam
|
|||||||
class fvMesh;
|
class fvMesh;
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class ODESolidChemistryModel Declaration
|
Class pyrolysisChemistryModel Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
template<class CompType, class SolidThermo, class GasThermo>
|
template<class CompType, class SolidThermo, class GasThermo>
|
||||||
class ODESolidChemistryModel
|
class pyrolysisChemistryModel
|
||||||
:
|
:
|
||||||
public CompType,
|
public solidChemistryModel<CompType, SolidThermo>
|
||||||
public ODE
|
|
||||||
{
|
{
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
//- Disallow default bitwise assignment
|
||||||
void operator=(const ODESolidChemistryModel&);
|
void operator=(const pyrolysisChemistryModel&);
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
//- Reference to solid mass fractions
|
|
||||||
PtrList<volScalarField>& Ys_;
|
|
||||||
|
|
||||||
//- Reactions
|
|
||||||
const PtrList<Reaction<SolidThermo> >& reactions_;
|
|
||||||
|
|
||||||
//- List of gas species present in reaction system
|
//- List of gas species present in reaction system
|
||||||
speciesTable pyrolisisGases_;
|
speciesTable pyrolisisGases_;
|
||||||
|
|
||||||
//- Thermodynamic data of solids
|
|
||||||
const PtrList<SolidThermo>& solidThermo_;
|
|
||||||
|
|
||||||
//- Thermodynamic data of gases
|
//- Thermodynamic data of gases
|
||||||
PtrList<GasThermo> gasThermo_;
|
PtrList<GasThermo> gasThermo_;
|
||||||
|
|
||||||
@ -90,24 +78,12 @@ protected:
|
|||||||
//- Number of components being solved by ODE
|
//- Number of components being solved by ODE
|
||||||
label nSpecie_;
|
label nSpecie_;
|
||||||
|
|
||||||
//- Number of solid components
|
|
||||||
label nSolids_;
|
|
||||||
|
|
||||||
//- Number of solid reactions
|
|
||||||
label nReaction_;
|
|
||||||
|
|
||||||
//- List of reaction rate per solid [kg/m3/s]
|
|
||||||
PtrList<DimensionedField<scalar, volMesh> > RRs_;
|
|
||||||
|
|
||||||
//- List of reaction rate per gas [kg/m3/s]
|
//- List of reaction rate per gas [kg/m3/s]
|
||||||
PtrList<DimensionedField<scalar, volMesh> > RRg_;
|
PtrList<DimensionedField<scalar, volMesh> > RRg_;
|
||||||
|
|
||||||
|
|
||||||
// Protected Member Functions
|
// Protected Member Functions
|
||||||
|
|
||||||
//- Write access to source terms for solids
|
|
||||||
inline PtrList<DimensionedField<scalar, volMesh> >& RRs();
|
|
||||||
|
|
||||||
//- Write access to source terms for gases
|
//- Write access to source terms for gases
|
||||||
inline PtrList<DimensionedField<scalar, volMesh> >& RRg();
|
inline PtrList<DimensionedField<scalar, volMesh> >& RRg();
|
||||||
|
|
||||||
@ -120,37 +96,25 @@ private:
|
|||||||
//- Cell counter
|
//- Cell counter
|
||||||
label cellCounter_;
|
label cellCounter_;
|
||||||
|
|
||||||
//- List of active reacting cells
|
|
||||||
List<bool> reactingCells_;
|
|
||||||
|
|
||||||
|
|
||||||
// Private members
|
|
||||||
|
|
||||||
//- Set reacting status of cell, cellI
|
|
||||||
void setCellReacting(const label cellI, const bool active);
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
TypeName("ODESolidChemistryModel");
|
TypeName("pyrolysis");
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from mesh
|
//- Construct from mesh
|
||||||
ODESolidChemistryModel(const fvMesh& mesh);
|
pyrolysisChemistryModel(const fvMesh& mesh);
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~ODESolidChemistryModel();
|
virtual ~pyrolysisChemistryModel();
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- The reactions
|
|
||||||
inline const PtrList<Reaction<SolidThermo> >& reactions() const;
|
|
||||||
|
|
||||||
//- Thermodynamic data of gases
|
//- Thermodynamic data of gases
|
||||||
inline const PtrList<GasThermo>& gasThermo() const;
|
inline const PtrList<GasThermo>& gasThermo() const;
|
||||||
|
|
||||||
@ -163,9 +127,6 @@ public:
|
|||||||
//- The number of solids
|
//- The number of solids
|
||||||
inline label nGases() const;
|
inline label nGases() const;
|
||||||
|
|
||||||
//- The number of reactions
|
|
||||||
inline label nReaction() const;
|
|
||||||
|
|
||||||
|
|
||||||
//- dc/dt = omega, rate of change in concentration, for each species
|
//- dc/dt = omega, rate of change in concentration, for each species
|
||||||
virtual scalarField omega
|
virtual scalarField omega
|
||||||
@ -198,12 +159,6 @@ public:
|
|||||||
|
|
||||||
// Chemistry model functions
|
// Chemistry model functions
|
||||||
|
|
||||||
//- Return const access to the chemical source terms for solids
|
|
||||||
inline const DimensionedField<scalar, volMesh>& RRs
|
|
||||||
(
|
|
||||||
const label i
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Return const access to the chemical source terms for gases
|
//- Return const access to the chemical source terms for gases
|
||||||
inline const DimensionedField<scalar, volMesh>& RRg
|
inline const DimensionedField<scalar, volMesh>& RRg
|
||||||
(
|
(
|
||||||
@ -213,15 +168,6 @@ public:
|
|||||||
//- Return total gas source term
|
//- Return total gas source term
|
||||||
inline tmp<DimensionedField<scalar, volMesh> > RRg() const;
|
inline tmp<DimensionedField<scalar, volMesh> > RRg() const;
|
||||||
|
|
||||||
//- Return total solid source term
|
|
||||||
inline tmp<DimensionedField<scalar, volMesh> > RRs() const;
|
|
||||||
|
|
||||||
//- Return const access to the total source terms
|
|
||||||
inline const DimensionedField<scalar, volMesh>& RR
|
|
||||||
(
|
|
||||||
const label i
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Return sensible enthalpy for gas i [J/Kg]
|
//- Return sensible enthalpy for gas i [J/Kg]
|
||||||
virtual tmp<volScalarField> gasHs
|
virtual tmp<volScalarField> gasHs
|
||||||
(
|
(
|
||||||
@ -232,16 +178,7 @@ public:
|
|||||||
|
|
||||||
//- Solve the reaction system for the given start time and time
|
//- Solve the reaction system for the given start time and time
|
||||||
// step and return the characteristic time
|
// step and return the characteristic time
|
||||||
virtual scalar solve(const scalar t0, const scalar deltaT);
|
virtual scalar solve(const scalar t0, const scalar deltaT) ;
|
||||||
|
|
||||||
//- Return the chemical time scale
|
|
||||||
virtual tmp<volScalarField> tc() const;
|
|
||||||
|
|
||||||
//- Return source for enthalpy equation [kg/m/s3]
|
|
||||||
virtual tmp<volScalarField> Sh() const;
|
|
||||||
|
|
||||||
//- Return the heat release, i.e. enthalpy/sec [m2/s3]
|
|
||||||
virtual tmp<volScalarField> dQ() const;
|
|
||||||
|
|
||||||
|
|
||||||
// ODE functions (overriding abstract functions in ODE.H)
|
// ODE functions (overriding abstract functions in ODE.H)
|
||||||
@ -281,12 +218,12 @@ public:
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
# include "ODESolidChemistryModelI.H"
|
# include "pyrolysisChemistryModelI.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
#ifdef NoRepository
|
#ifdef NoRepository
|
||||||
# include "ODESolidChemistryModel.C"
|
# include "pyrolysisChemistryModel.C"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -24,37 +24,21 @@ License
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
#include "zeroGradientFvPatchFields.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class CompType, class SolidThermo, class GasThermo>
|
template<class CompType, class SolidThermo, class GasThermo>
|
||||||
inline Foam::PtrList<Foam::DimensionedField<Foam::scalar, Foam::volMesh> >&
|
inline Foam::PtrList<Foam::DimensionedField<Foam::scalar, Foam::volMesh> >&
|
||||||
Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::RRs()
|
Foam::pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::RRg()
|
||||||
{
|
|
||||||
return RRs_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo, class GasThermo>
|
|
||||||
inline Foam::PtrList<Foam::DimensionedField<Foam::scalar, Foam::volMesh> >&
|
|
||||||
Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::RRg()
|
|
||||||
{
|
{
|
||||||
return RRg_;
|
return RRg_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo, class GasThermo>
|
|
||||||
inline const Foam::PtrList<Foam::Reaction<SolidThermo> >&
|
|
||||||
Foam::ODESolidChemistryModel<CompType, SolidThermo,GasThermo>::reactions() const
|
|
||||||
{
|
|
||||||
return reactions_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo, class GasThermo>
|
template<class CompType, class SolidThermo, class GasThermo>
|
||||||
inline const Foam::PtrList<GasThermo>&
|
inline const Foam::PtrList<GasThermo>&
|
||||||
Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::
|
Foam::pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::
|
||||||
gasThermo() const
|
gasThermo() const
|
||||||
{
|
{
|
||||||
return gasThermo_;
|
return gasThermo_;
|
||||||
@ -63,7 +47,8 @@ gasThermo() const
|
|||||||
|
|
||||||
template<class CompType, class SolidThermo, class GasThermo>
|
template<class CompType, class SolidThermo, class GasThermo>
|
||||||
inline const Foam::speciesTable&
|
inline const Foam::speciesTable&
|
||||||
Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::gasTable() const
|
Foam::pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::
|
||||||
|
gasTable() const
|
||||||
{
|
{
|
||||||
return pyrolisisGases_;
|
return pyrolisisGases_;
|
||||||
}
|
}
|
||||||
@ -71,35 +56,16 @@ Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::gasTable() const
|
|||||||
|
|
||||||
template<class CompType, class SolidThermo, class GasThermo>
|
template<class CompType, class SolidThermo, class GasThermo>
|
||||||
inline Foam::label
|
inline Foam::label
|
||||||
Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::nSpecie() const
|
Foam::pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::
|
||||||
|
nSpecie() const
|
||||||
{
|
{
|
||||||
return nSpecie_;
|
return nSpecie_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo, class GasThermo>
|
|
||||||
inline Foam::label
|
|
||||||
Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::
|
|
||||||
nReaction() const
|
|
||||||
{
|
|
||||||
return nReaction_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo, class GasThermo>
|
template<class CompType, class SolidThermo, class GasThermo>
|
||||||
inline const Foam::DimensionedField<Foam::scalar, Foam::volMesh>&
|
inline const Foam::DimensionedField<Foam::scalar, Foam::volMesh>&
|
||||||
Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::RRs
|
Foam::pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::RRg
|
||||||
(
|
|
||||||
const label i
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return RRs_[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo, class GasThermo>
|
|
||||||
inline const Foam::DimensionedField<Foam::scalar, Foam::volMesh>&
|
|
||||||
Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::RRg
|
|
||||||
(
|
(
|
||||||
const label i
|
const label i
|
||||||
) const
|
) const
|
||||||
@ -110,7 +76,8 @@ Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::RRg
|
|||||||
|
|
||||||
template<class CompType, class SolidThermo, class GasThermo>
|
template<class CompType, class SolidThermo, class GasThermo>
|
||||||
inline Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> >
|
inline Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> >
|
||||||
Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::RRg() const
|
Foam::pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::
|
||||||
|
RRg() const
|
||||||
{
|
{
|
||||||
tmp<DimensionedField<scalar, volMesh> > tRRg
|
tmp<DimensionedField<scalar, volMesh> > tRRg
|
||||||
(
|
(
|
||||||
@ -139,51 +106,4 @@ Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::RRg() const
|
|||||||
}
|
}
|
||||||
return tRRg;
|
return tRRg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo, class GasThermo>
|
|
||||||
inline Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> >
|
|
||||||
Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::RRs() const
|
|
||||||
{
|
|
||||||
tmp<DimensionedField<scalar, volMesh> > tRRs
|
|
||||||
(
|
|
||||||
new DimensionedField<scalar, volMesh>
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"RRs",
|
|
||||||
this->time().timeName(),
|
|
||||||
this->mesh(),
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
this->mesh(),
|
|
||||||
dimensionedScalar("zero", dimMass/dimVolume/dimTime, 0.0)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (this->chemistry_)
|
|
||||||
{
|
|
||||||
DimensionedField<scalar, volMesh>& RRs = tRRs();
|
|
||||||
for (label i=0; i < nSolids_; i++)
|
|
||||||
{
|
|
||||||
RRs += RRs_[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return tRRs;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo, class GasThermo>
|
|
||||||
inline const Foam::DimensionedField<Foam::scalar, Foam::volMesh>&
|
|
||||||
Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::RR
|
|
||||||
(
|
|
||||||
const label i
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
notImplemented("ODESolidChemistryModel::RR(const label)");
|
|
||||||
return (DimensionedField<scalar, volMesh>::null());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -24,33 +24,193 @@ License
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "solidChemistryModel.H"
|
#include "solidChemistryModel.H"
|
||||||
#include "fvMesh.H"
|
#include "reactingMixture.H"
|
||||||
#include "Time.H"
|
#include "zeroGradientFvPatchFields.H"
|
||||||
|
|
||||||
/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(solidChemistryModel, 0);
|
|
||||||
defineRunTimeSelectionTable(solidChemistryModel, fvMesh);
|
|
||||||
}
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::solidChemistryModel::solidChemistryModel
|
template<class CompType, class SolidThermo>
|
||||||
|
Foam::solidChemistryModel<CompType, SolidThermo>::
|
||||||
|
solidChemistryModel
|
||||||
(
|
(
|
||||||
const fvMesh& mesh
|
const fvMesh& mesh
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
basicChemistryModel(mesh),
|
CompType(mesh),
|
||||||
solidThermo_(solidReactionThermo::New(mesh))
|
ODE(),
|
||||||
{}
|
Ys_(this->solidThermo().composition().Y()),
|
||||||
|
reactions_
|
||||||
|
(
|
||||||
|
dynamic_cast<const reactingMixture<SolidThermo>& >
|
||||||
|
(
|
||||||
|
this->solidThermo()
|
||||||
|
)
|
||||||
|
),
|
||||||
|
solidThermo_
|
||||||
|
(
|
||||||
|
dynamic_cast<const reactingMixture<SolidThermo>& >
|
||||||
|
(
|
||||||
|
this->solidThermo()
|
||||||
|
).speciesData()
|
||||||
|
),
|
||||||
|
nSolids_(Ys_.size()),
|
||||||
|
nReaction_(reactions_.size()),
|
||||||
|
RRs_(nSolids_),
|
||||||
|
reactingCells_(mesh.nCells(), true)
|
||||||
|
{
|
||||||
|
// create the fields for the chemistry sources
|
||||||
|
forAll(RRs_, fieldI)
|
||||||
|
{
|
||||||
|
RRs_.set
|
||||||
|
(
|
||||||
|
fieldI,
|
||||||
|
new DimensionedField<scalar, volMesh>
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"RRs." + Ys_[fieldI].name(),
|
||||||
|
mesh.time().timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
mesh,
|
||||||
|
dimensionedScalar("zero", dimMass/dimVolume/dimTime, 0.0)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::solidChemistryModel::~solidChemistryModel()
|
template<class CompType, class SolidThermo>
|
||||||
|
Foam::solidChemistryModel<CompType, SolidThermo>::
|
||||||
|
~solidChemistryModel()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class CompType, class SolidThermo>
|
||||||
|
Foam::tmp<Foam::volScalarField>
|
||||||
|
Foam::solidChemistryModel<CompType, SolidThermo>::tc() const
|
||||||
|
{
|
||||||
|
notImplemented
|
||||||
|
(
|
||||||
|
"solidChemistryModel::tc()"
|
||||||
|
);
|
||||||
|
return volScalarField::null();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class CompType, class SolidThermo>
|
||||||
|
Foam::tmp<Foam::volScalarField>
|
||||||
|
Foam::solidChemistryModel<CompType, SolidThermo>::Sh() const
|
||||||
|
{
|
||||||
|
tmp<volScalarField> tSh
|
||||||
|
(
|
||||||
|
new volScalarField
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"Sh",
|
||||||
|
this->mesh_.time().timeName(),
|
||||||
|
this->mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE,
|
||||||
|
false
|
||||||
|
),
|
||||||
|
this->mesh_,
|
||||||
|
dimensionedScalar("zero", dimEnergy/dimTime/dimVolume, 0.0),
|
||||||
|
zeroGradientFvPatchScalarField::typeName
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (this->chemistry_)
|
||||||
|
{
|
||||||
|
scalarField& Sh = tSh();
|
||||||
|
|
||||||
|
forAll(Ys_, i)
|
||||||
|
{
|
||||||
|
forAll(Sh, cellI)
|
||||||
|
{
|
||||||
|
scalar hf = solidThermo_[i].Hc();
|
||||||
|
Sh[cellI] -= hf*RRs_[i][cellI];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return tSh;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class CompType, class SolidThermo>
|
||||||
|
Foam::tmp<Foam::volScalarField>
|
||||||
|
Foam::solidChemistryModel<CompType, SolidThermo>::dQ() const
|
||||||
|
{
|
||||||
|
tmp<volScalarField> tdQ
|
||||||
|
(
|
||||||
|
new volScalarField
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"dQ",
|
||||||
|
this->mesh_.time().timeName(),
|
||||||
|
this->mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE,
|
||||||
|
false
|
||||||
|
),
|
||||||
|
this->mesh_,
|
||||||
|
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0),
|
||||||
|
zeroGradientFvPatchScalarField::typeName
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (this->chemistry_)
|
||||||
|
{
|
||||||
|
volScalarField& dQ = tdQ();
|
||||||
|
dQ.dimensionedInternalField() = this->mesh_.V()*Sh()();
|
||||||
|
}
|
||||||
|
|
||||||
|
return tdQ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class CompType, class SolidThermo>
|
||||||
|
Foam::scalar Foam::solidChemistryModel<CompType, SolidThermo>::solve
|
||||||
|
(
|
||||||
|
scalarField &c,
|
||||||
|
const scalar T,
|
||||||
|
const scalar p,
|
||||||
|
const scalar t0,
|
||||||
|
const scalar dt
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
notImplemented
|
||||||
|
(
|
||||||
|
"solidChemistryModel::solve"
|
||||||
|
"("
|
||||||
|
"scalarField&, "
|
||||||
|
"const scalar, "
|
||||||
|
"const scalar, "
|
||||||
|
"const scalar, "
|
||||||
|
"const scalar"
|
||||||
|
") const"
|
||||||
|
);
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class CompType, class SolidThermo>
|
||||||
|
void Foam::solidChemistryModel<CompType, SolidThermo>::setCellReacting
|
||||||
|
(
|
||||||
|
const label cellI,
|
||||||
|
const bool active
|
||||||
|
)
|
||||||
|
{
|
||||||
|
reactingCells_[cellI] = active;
|
||||||
|
}
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -25,23 +25,24 @@ Class
|
|||||||
Foam::solidChemistryModel
|
Foam::solidChemistryModel
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Chemistry model for solid thermodynamics
|
Extends base solid chemistry model by adding a thermo package, and ODE
|
||||||
|
functions.
|
||||||
|
Introduces chemistry equation system and evaluation of chemical source
|
||||||
|
terms.
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
solidChemistryModelI.H
|
solidChemistryModelI.H
|
||||||
solidChemistryModel.C
|
solidChemistryModel.C
|
||||||
newChemistrySolidModel.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef solidChemistryModel_H
|
#ifndef solidChemistryModel_H
|
||||||
#define solidChemistryModel_H
|
#define solidChemistryModel_H
|
||||||
|
|
||||||
#include "basicChemistryModel.H"
|
#include "Reaction.H"
|
||||||
#include "autoPtr.H"
|
#include "ODE.H"
|
||||||
#include "runTimeSelectionTables.H"
|
#include "volFieldsFwd.H"
|
||||||
#include "solidReactionThermo.H"
|
#include "DimensionedField.H"
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -52,45 +53,57 @@ namespace Foam
|
|||||||
class fvMesh;
|
class fvMesh;
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
class solidChemistryModel Declaration
|
Class solidChemistryModel Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
template<class CompType, class SolidThermo>
|
||||||
class solidChemistryModel
|
class solidChemistryModel
|
||||||
:
|
:
|
||||||
public basicChemistryModel
|
public CompType,
|
||||||
|
public ODE
|
||||||
{
|
{
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
//- Construct as copy (not implemented)
|
|
||||||
solidChemistryModel(const solidChemistryModel&);
|
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
//- Disallow default bitwise assignment
|
||||||
void operator=(const solidChemistryModel&);
|
void operator=(const solidChemistryModel&);
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Protected data
|
//- Reference to solid mass fractions
|
||||||
|
PtrList<volScalarField>& Ys_;
|
||||||
|
|
||||||
//- Solid thermo package
|
//- Reactions
|
||||||
autoPtr<solidReactionThermo> solidThermo_;
|
const PtrList<Reaction<SolidThermo> >& reactions_;
|
||||||
|
|
||||||
|
//- Thermodynamic data of solids
|
||||||
|
const PtrList<SolidThermo>& solidThermo_;
|
||||||
|
|
||||||
|
//- Number of solid components
|
||||||
|
label nSolids_;
|
||||||
|
|
||||||
|
//- Number of solid reactions
|
||||||
|
label nReaction_;
|
||||||
|
|
||||||
|
//- List of reaction rate per solid [kg/m3/s]
|
||||||
|
PtrList<DimensionedField<scalar, volMesh> > RRs_;
|
||||||
|
|
||||||
|
//- List of active reacting cells
|
||||||
|
List<bool> reactingCells_;
|
||||||
|
|
||||||
|
// Protected Member Functions
|
||||||
|
|
||||||
|
//- Write access to source terms for solids
|
||||||
|
inline PtrList<DimensionedField<scalar, volMesh> >& RRs();
|
||||||
|
|
||||||
|
//- Set reacting status of cell, cellI
|
||||||
|
void setCellReacting(const label cellI, const bool active);
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
TypeName("solid");
|
TypeName("solidChemistryModel");
|
||||||
|
|
||||||
|
|
||||||
//- Declare run-time constructor selection tables
|
|
||||||
declareRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
autoPtr,
|
|
||||||
solidChemistryModel,
|
|
||||||
fvMesh,
|
|
||||||
(const fvMesh& mesh),
|
|
||||||
(mesh)
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
@ -99,56 +112,108 @@ public:
|
|||||||
solidChemistryModel(const fvMesh& mesh);
|
solidChemistryModel(const fvMesh& mesh);
|
||||||
|
|
||||||
|
|
||||||
//- Selector
|
|
||||||
static autoPtr<solidChemistryModel> New(const fvMesh& mesh);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~solidChemistryModel();
|
virtual ~solidChemistryModel();
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- Return access to the solid thermo package
|
//- The reactions
|
||||||
inline solidReactionThermo& solidThermo();
|
inline const PtrList<Reaction<SolidThermo> >& reactions() const;
|
||||||
|
|
||||||
//- Return const access to the solid thermo package
|
//- The number of reactions
|
||||||
inline const solidReactionThermo& solidThermo() const;
|
inline label nReaction() const;
|
||||||
|
|
||||||
//- Return total gases mass source term [kg/m3/s]
|
|
||||||
virtual tmp<DimensionedField<scalar, volMesh> > RRg() const = 0;
|
|
||||||
|
|
||||||
//- Return total solids mass source term [kg/m3/s]
|
//- dc/dt = omega, rate of change in concentration, for each species
|
||||||
virtual tmp<DimensionedField<scalar, volMesh> > RRs() const = 0;
|
virtual scalarField omega
|
||||||
|
|
||||||
//- Return chemical source terms for solids [kg/m3/s]
|
|
||||||
virtual const DimensionedField<scalar, volMesh>& RRs
|
|
||||||
(
|
(
|
||||||
const label i
|
const scalarField& c,
|
||||||
|
const scalar T,
|
||||||
|
const scalar p,
|
||||||
|
const bool updateC0 = false
|
||||||
) const = 0;
|
) const = 0;
|
||||||
|
|
||||||
//- Return chemical source terms for gases [kg/m3/s]
|
//- Return the reaction rate for reaction r and the reference
|
||||||
virtual const DimensionedField<scalar, volMesh>& RRg
|
// species and charateristic times
|
||||||
|
virtual scalar omega
|
||||||
(
|
(
|
||||||
const label i
|
const Reaction<SolidThermo>& r,
|
||||||
|
const scalarField& c,
|
||||||
|
const scalar T,
|
||||||
|
const scalar p,
|
||||||
|
scalar& pf,
|
||||||
|
scalar& cf,
|
||||||
|
label& lRef,
|
||||||
|
scalar& pr,
|
||||||
|
scalar& cr,
|
||||||
|
label& rRef
|
||||||
) const = 0;
|
) const = 0;
|
||||||
|
|
||||||
//- 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
|
//- Calculates the reaction rates
|
||||||
virtual void calculate() = 0;
|
virtual void calculate() = 0;
|
||||||
|
|
||||||
|
|
||||||
|
// Chemistry model functions
|
||||||
|
|
||||||
|
//- Return const access to the chemical source terms for solids
|
||||||
|
inline const DimensionedField<scalar, volMesh>& RRs
|
||||||
|
(
|
||||||
|
const label i
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Return total solid source term
|
||||||
|
inline tmp<DimensionedField<scalar, volMesh> > RRs() const;
|
||||||
|
|
||||||
|
//- Return const access to the total source terms
|
||||||
|
inline const DimensionedField<scalar, volMesh>& RR
|
||||||
|
(
|
||||||
|
const label i
|
||||||
|
) const;
|
||||||
|
|
||||||
|
|
||||||
|
//- Solve the reaction system for the given start time and time
|
||||||
|
// step and return the characteristic time
|
||||||
|
virtual scalar solve(const scalar t0, const scalar deltaT) = 0;
|
||||||
|
|
||||||
|
//- Return the chemical time scale
|
||||||
|
virtual tmp<volScalarField> tc() const;
|
||||||
|
|
||||||
|
//- Return source for enthalpy equation [kg/m/s3]
|
||||||
|
virtual tmp<volScalarField> Sh() const;
|
||||||
|
|
||||||
|
//- Return the heat release, i.e. enthalpy/sec [m2/s3]
|
||||||
|
virtual tmp<volScalarField> dQ() 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,
|
||||||
|
scalarField& dcdt
|
||||||
|
) const = 0;
|
||||||
|
|
||||||
|
virtual void jacobian
|
||||||
|
(
|
||||||
|
const scalar t,
|
||||||
|
const scalarField& c,
|
||||||
|
scalarField& dcdt,
|
||||||
|
scalarSquareMatrix& dfdc
|
||||||
|
) const = 0;
|
||||||
|
|
||||||
|
virtual scalar solve
|
||||||
|
(
|
||||||
|
scalarField &c,
|
||||||
|
const scalar T,
|
||||||
|
const scalar p,
|
||||||
|
const scalar t0,
|
||||||
|
const scalar dt
|
||||||
|
) const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -158,7 +223,13 @@ public:
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
#include "solidChemistryModelI.H"
|
# include "solidChemistryModelI.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#ifdef NoRepository
|
||||||
|
# include "solidChemistryModel.C"
|
||||||
|
#endif
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -23,18 +23,87 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "volFields.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
inline Foam::solidReactionThermo& Foam::solidChemistryModel::solidThermo()
|
template<class CompType, class SolidThermo>
|
||||||
|
inline Foam::PtrList<Foam::DimensionedField<Foam::scalar, Foam::volMesh> >&
|
||||||
|
Foam::solidChemistryModel<CompType, SolidThermo>::RRs()
|
||||||
{
|
{
|
||||||
return solidThermo_();
|
return RRs_;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<class CompType, class SolidThermo>
|
||||||
|
inline const Foam::PtrList<Foam::Reaction<SolidThermo> >&
|
||||||
|
Foam::solidChemistryModel<CompType, SolidThermo>::reactions() const
|
||||||
|
{
|
||||||
|
return reactions_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::solidReactionThermo&
|
template<class CompType, class SolidThermo>
|
||||||
Foam::solidChemistryModel::solidThermo() const
|
inline Foam::label
|
||||||
|
Foam::solidChemistryModel<CompType, SolidThermo>::
|
||||||
|
nReaction() const
|
||||||
{
|
{
|
||||||
return solidThermo_();
|
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<DimensionedField<scalar, volMesh> > tRRs
|
||||||
|
(
|
||||||
|
new DimensionedField<scalar, volMesh>
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"RRs",
|
||||||
|
this->time().timeName(),
|
||||||
|
this->mesh(),
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
this->mesh(),
|
||||||
|
dimensionedScalar("zero", dimMass/dimVolume/dimTime, 0.0)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (this->chemistry_)
|
||||||
|
{
|
||||||
|
DimensionedField<scalar, volMesh>& RRs = tRRs();
|
||||||
|
for (label i=0; i < nSolids_; i++)
|
||||||
|
{
|
||||||
|
RRs += RRs_[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return tRRs;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class CompType, class SolidThermo>
|
||||||
|
inline const Foam::DimensionedField<Foam::scalar, Foam::volMesh>&
|
||||||
|
Foam::solidChemistryModel<CompType, SolidThermo>::RR
|
||||||
|
(
|
||||||
|
const label i
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
notImplemented("solidChemistryModel::RR(const label)");
|
||||||
|
return (DimensionedField<scalar, volMesh>::null());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -39,15 +39,15 @@ namespace Foam
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
#define makeSolidChemistrySolverType(SS, Comp, SThermo, GThermo) \
|
#define makeSolidChemistrySolverType(SS, Schem, Comp, SThermo, GThermo) \
|
||||||
\
|
\
|
||||||
typedef SS<ODESolidChemistryModel<Comp, SThermo, GThermo> > \
|
typedef SS<Schem<Comp, SThermo, GThermo> > \
|
||||||
SS##Comp##SThermo##GThermo; \
|
SS##Schem##Comp##SThermo##GThermo; \
|
||||||
\
|
\
|
||||||
defineTemplateTypeNameAndDebugWithName \
|
defineTemplateTypeNameAndDebugWithName \
|
||||||
( \
|
( \
|
||||||
SS##Comp##SThermo##GThermo, \
|
SS##Schem##Comp##SThermo##GThermo, \
|
||||||
(#SS"<" + word(Comp::typeName_()) \
|
(#SS"<" + word(Schem::typeName_()) \
|
||||||
+ "," + SThermo::typeName() + "," + GThermo::typeName() + ">").c_str(), \
|
+ "," + SThermo::typeName() + "," + GThermo::typeName() + ">").c_str(), \
|
||||||
0 \
|
0 \
|
||||||
); \
|
); \
|
||||||
@ -55,7 +55,7 @@ namespace Foam
|
|||||||
addToRunTimeSelectionTable \
|
addToRunTimeSelectionTable \
|
||||||
( \
|
( \
|
||||||
Comp, \
|
Comp, \
|
||||||
SS##Comp##SThermo##GThermo, \
|
SS##Schem##Comp##SThermo##GThermo, \
|
||||||
fvMesh \
|
fvMesh \
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -27,8 +27,8 @@ License
|
|||||||
#include "solidThermoPhysicsTypes.H"
|
#include "solidThermoPhysicsTypes.H"
|
||||||
#include "thermoPhysicsTypes.H"
|
#include "thermoPhysicsTypes.H"
|
||||||
|
|
||||||
#include "ODESolidChemistryModel.H"
|
#include "pyrolysisChemistryModel.H"
|
||||||
#include "solidChemistryModel.H"
|
#include "basicSolidChemistryModel.H"
|
||||||
|
|
||||||
#include "ode.H"
|
#include "ode.H"
|
||||||
|
|
||||||
@ -39,7 +39,8 @@ namespace Foam
|
|||||||
makeSolidChemistrySolverType
|
makeSolidChemistrySolverType
|
||||||
(
|
(
|
||||||
ode,
|
ode,
|
||||||
solidChemistryModel,
|
pyrolysisChemistryModel,
|
||||||
|
basicSolidChemistryModel,
|
||||||
hConstSolidThermoPhysics,
|
hConstSolidThermoPhysics,
|
||||||
gasHThermoPhysics
|
gasHThermoPhysics
|
||||||
)
|
)
|
||||||
@ -47,7 +48,8 @@ namespace Foam
|
|||||||
makeSolidChemistrySolverType
|
makeSolidChemistrySolverType
|
||||||
(
|
(
|
||||||
ode,
|
ode,
|
||||||
solidChemistryModel,
|
pyrolysisChemistryModel,
|
||||||
|
basicSolidChemistryModel,
|
||||||
hExponentialSolidThermoPhysics,
|
hExponentialSolidThermoPhysics,
|
||||||
gasHThermoPhysics
|
gasHThermoPhysics
|
||||||
)
|
)
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -150,12 +150,18 @@ Foam::string Foam::solidReaction<ReactionThermo>::solidReactionStr
|
|||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
this->reactionStrLeft(reaction);
|
this->reactionStrLeft(reaction);
|
||||||
|
if (glhs().size() > 0)
|
||||||
|
{
|
||||||
reaction << " + ";
|
reaction << " + ";
|
||||||
solidReactionStrLeft(reaction);
|
solidReactionStrLeft(reaction);
|
||||||
|
}
|
||||||
reaction << " = ";
|
reaction << " = ";
|
||||||
this->reactionStrRight(reaction);
|
this->reactionStrRight(reaction);
|
||||||
|
if (grhs().size() > 0)
|
||||||
|
{
|
||||||
reaction << " + ";
|
reaction << " + ";
|
||||||
solidReactionStrRight(reaction);
|
solidReactionStrRight(reaction);
|
||||||
|
}
|
||||||
return reaction.str();
|
return reaction.str();
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -169,8 +175,6 @@ void Foam::solidReaction<ReactionThermo>::solidReactionStrLeft
|
|||||||
{
|
{
|
||||||
for (label i = 0; i < glhs().size(); ++i)
|
for (label i = 0; i < glhs().size(); ++i)
|
||||||
{
|
{
|
||||||
reaction << " + ";
|
|
||||||
|
|
||||||
if (i > 0)
|
if (i > 0)
|
||||||
{
|
{
|
||||||
reaction << " + ";
|
reaction << " + ";
|
||||||
@ -197,8 +201,6 @@ void Foam::solidReaction<ReactionThermo>::solidReactionStrRight
|
|||||||
|
|
||||||
for (label i = 0; i < grhs().size(); ++i)
|
for (label i = 0; i < grhs().size(); ++i)
|
||||||
{
|
{
|
||||||
reaction << " + ";
|
|
||||||
|
|
||||||
if (i > 0)
|
if (i > 0)
|
||||||
{
|
{
|
||||||
reaction << " + ";
|
reaction << " + ";
|
||||||
|
|||||||
@ -18,7 +18,7 @@ FoamFile
|
|||||||
chemistryType
|
chemistryType
|
||||||
{
|
{
|
||||||
chemistrySolver ode;
|
chemistrySolver ode;
|
||||||
chemistryThermo solid;
|
chemistryThermo pyrolysis;
|
||||||
}
|
}
|
||||||
|
|
||||||
chemistry on;
|
chemistry on;
|
||||||
|
|||||||
Reference in New Issue
Block a user