mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -1,5 +1,4 @@
|
||||
EXE_INC = \
|
||||
-I../rhoPorousMRFPimpleFoam \
|
||||
-I.. \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
|
||||
|
||||
@ -269,9 +269,10 @@ void selectCurvatureCells
|
||||
querySurf.surface(),
|
||||
querySurf,
|
||||
pointField(1, mesh.cellCentres()[0]),
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false, // includeCut
|
||||
false, // includeInside
|
||||
false, // includeOutside
|
||||
false, // geometricOnly
|
||||
nearDist,
|
||||
curvature
|
||||
);
|
||||
|
||||
@ -143,6 +143,9 @@ FoamFile
|
||||
// sourceInfo
|
||||
// {
|
||||
// file "www.avl.com-geometry.stl";
|
||||
// useSurfaceOrientation false; // use closed surface inside/outside
|
||||
// // test (ignores includeCut,
|
||||
// // outsidePoints)
|
||||
// outsidePoints ((-99 -99 -59)); // definition of outside
|
||||
// includeCut false; // cells cut by surface
|
||||
// includeInside false; // cells not on outside of surf
|
||||
|
||||
@ -165,6 +165,10 @@ surfaces
|
||||
|
||||
//- Optional: restrict to a particular zone
|
||||
// zone zone1;
|
||||
|
||||
//- Optional: do not triangulate (only for surfaceFormats that support
|
||||
// polygons)
|
||||
//triangulate false;
|
||||
}
|
||||
|
||||
interpolatedPlane
|
||||
|
||||
@ -39,6 +39,14 @@ namespace functionEntries
|
||||
{
|
||||
defineTypeNameAndDebug(codeStream, 0);
|
||||
|
||||
addToMemberFunctionSelectionTable
|
||||
(
|
||||
functionEntry,
|
||||
codeStream,
|
||||
execute,
|
||||
dictionaryIstream
|
||||
);
|
||||
|
||||
addToMemberFunctionSelectionTable
|
||||
(
|
||||
functionEntry,
|
||||
@ -364,6 +372,38 @@ bool Foam::functionEntries::codeStream::execute
|
||||
IStringStream resultStream(os.str());
|
||||
entry.read(parentDict, resultStream);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::functionEntries::codeStream::execute
|
||||
(
|
||||
dictionary& parentDict,
|
||||
Istream& is
|
||||
)
|
||||
{
|
||||
Info<< "Using #codeStream at line " << is.lineNumber()
|
||||
<< " in file " << parentDict.name() << endl;
|
||||
|
||||
dynamicCode::checkSecurity
|
||||
(
|
||||
"functionEntries::codeStream::execute(..)",
|
||||
parentDict
|
||||
);
|
||||
|
||||
// get code dictionary
|
||||
// must reference parent for stringOps::expand to work nicely
|
||||
dictionary codeDict("#codeStream", parentDict, is);
|
||||
|
||||
streamingFunctionType function = getFunction(parentDict, codeDict);
|
||||
|
||||
// use function to write stream
|
||||
OStringStream os(is.format());
|
||||
(*function)(os, parentDict);
|
||||
|
||||
// get the entry from this stream
|
||||
IStringStream resultStream(os.str());
|
||||
parentDict.read(resultStream);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -160,6 +160,10 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Execute the functionEntry in a sub-dict context
|
||||
static bool execute(dictionary& parentDict, Istream&);
|
||||
|
||||
//- Execute the functionEntry in a primitiveEntry context
|
||||
static bool execute
|
||||
(
|
||||
const dictionary& parentDict,
|
||||
|
||||
@ -157,7 +157,30 @@ void Foam::surfaceToCell::combine(topoSet& set, const bool add) const
|
||||
{
|
||||
cpuTime timer;
|
||||
|
||||
if (includeCut_ || includeInside_ || includeOutside_)
|
||||
|
||||
if (useSurfaceOrientation_ && (includeInside_ || includeOutside_))
|
||||
{
|
||||
const meshSearch queryMesh(mesh_);
|
||||
|
||||
//- Calculate for each searchPoint inside/outside status.
|
||||
boolList isInside(querySurf().calcInside(mesh_.cellCentres()));
|
||||
|
||||
Info<< " Marked inside/outside using surface orientation in = "
|
||||
<< timer.cpuTimeIncrement() << " s" << endl << endl;
|
||||
|
||||
forAll(isInside, cellI)
|
||||
{
|
||||
if (isInside[cellI] && includeInside_)
|
||||
{
|
||||
addOrDelete(set, cellI, add);
|
||||
}
|
||||
else if (!isInside[cellI] && includeOutside_)
|
||||
{
|
||||
addOrDelete(set, cellI, add);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (includeCut_ || includeInside_ || includeOutside_)
|
||||
{
|
||||
//
|
||||
// Cut cells with surface and classify cells
|
||||
@ -166,7 +189,7 @@ void Foam::surfaceToCell::combine(topoSet& set, const bool add) const
|
||||
|
||||
// Construct search engine on mesh
|
||||
|
||||
meshSearch queryMesh(mesh_);
|
||||
const meshSearch queryMesh(mesh_);
|
||||
|
||||
|
||||
// Check all 'outside' points
|
||||
@ -196,10 +219,10 @@ void Foam::surfaceToCell::combine(topoSet& set, const bool add) const
|
||||
);
|
||||
|
||||
|
||||
Info<< " Marked inside/outside in = "
|
||||
Info<< " Marked inside/outside using surface intersection in = "
|
||||
<< timer.cpuTimeIncrement() << " s" << endl << endl;
|
||||
|
||||
|
||||
//- Add/remove cells using set
|
||||
forAll(cellType, cellI)
|
||||
{
|
||||
label cType = cellType[cellI];
|
||||
@ -326,6 +349,18 @@ void Foam::surfaceToCell::checkSettings() const
|
||||
<< " or set curvature to a value -1 .. 1."
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
if (useSurfaceOrientation_ && includeCut_)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"surfaceToCell:checkSettings()"
|
||||
) << "Illegal include cell specification."
|
||||
<< " You cannot specify both 'useSurfaceOrientation'"
|
||||
<< " and 'includeCut'"
|
||||
<< " since 'includeCut' specifies a topological split"
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -340,6 +375,7 @@ Foam::surfaceToCell::surfaceToCell
|
||||
const bool includeCut,
|
||||
const bool includeInside,
|
||||
const bool includeOutside,
|
||||
const bool useSurfaceOrientation,
|
||||
const scalar nearDist,
|
||||
const scalar curvature
|
||||
)
|
||||
@ -350,6 +386,7 @@ Foam::surfaceToCell::surfaceToCell
|
||||
includeCut_(includeCut),
|
||||
includeInside_(includeInside),
|
||||
includeOutside_(includeOutside),
|
||||
useSurfaceOrientation_(useSurfaceOrientation),
|
||||
nearDist_(nearDist),
|
||||
curvature_(curvature),
|
||||
surfPtr_(new triSurface(surfName_)),
|
||||
@ -371,6 +408,7 @@ Foam::surfaceToCell::surfaceToCell
|
||||
const bool includeCut,
|
||||
const bool includeInside,
|
||||
const bool includeOutside,
|
||||
const bool useSurfaceOrientation,
|
||||
const scalar nearDist,
|
||||
const scalar curvature
|
||||
)
|
||||
@ -381,6 +419,7 @@ Foam::surfaceToCell::surfaceToCell
|
||||
includeCut_(includeCut),
|
||||
includeInside_(includeInside),
|
||||
includeOutside_(includeOutside),
|
||||
useSurfaceOrientation_(useSurfaceOrientation),
|
||||
nearDist_(nearDist),
|
||||
curvature_(curvature),
|
||||
surfPtr_(&surf),
|
||||
@ -404,6 +443,10 @@ Foam::surfaceToCell::surfaceToCell
|
||||
includeCut_(readBool(dict.lookup("includeCut"))),
|
||||
includeInside_(readBool(dict.lookup("includeInside"))),
|
||||
includeOutside_(readBool(dict.lookup("includeOutside"))),
|
||||
useSurfaceOrientation_
|
||||
(
|
||||
dict.lookupOrDefault<bool>("useSurfaceOrientation", false)
|
||||
),
|
||||
nearDist_(readScalar(dict.lookup("nearDistance"))),
|
||||
curvature_(readScalar(dict.lookup("curvature"))),
|
||||
surfPtr_(new triSurface(surfName_)),
|
||||
@ -427,6 +470,7 @@ Foam::surfaceToCell::surfaceToCell
|
||||
includeCut_(readBool(checkIs(is))),
|
||||
includeInside_(readBool(checkIs(is))),
|
||||
includeOutside_(readBool(checkIs(is))),
|
||||
useSurfaceOrientation_(false),
|
||||
nearDist_(readScalar(checkIs(is))),
|
||||
curvature_(readScalar(checkIs(is))),
|
||||
surfPtr_(new triSurface(surfName_)),
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -29,6 +29,8 @@ Description
|
||||
|
||||
Selects:
|
||||
- all cells inside/outside/cut by surface
|
||||
- all cells inside/outside surface ('useSurfaceOrientation', requires closed
|
||||
surface)
|
||||
- cells with centre nearer than XXX to surface
|
||||
- cells with centre nearer than XXX to surface \b and with normal
|
||||
at nearest point to centre and cell-corners differing by
|
||||
@ -67,27 +69,31 @@ class surfaceToCell
|
||||
static addToUsageTable usage_;
|
||||
|
||||
//- Name of surface file
|
||||
fileName surfName_;
|
||||
const fileName surfName_;
|
||||
|
||||
//- Points which are outside
|
||||
pointField outsidePoints_;
|
||||
const pointField outsidePoints_;
|
||||
|
||||
//- Include cut cells
|
||||
bool includeCut_;
|
||||
const bool includeCut_;
|
||||
|
||||
//- Include inside cells
|
||||
bool includeInside_;
|
||||
const bool includeInside_;
|
||||
|
||||
//- Include outside cells
|
||||
bool includeOutside_;
|
||||
const bool includeOutside_;
|
||||
|
||||
//- Determine inside/outside purely using geometric test
|
||||
// (does not allow includeCut)
|
||||
const bool useSurfaceOrientation_;
|
||||
|
||||
//- if > 0 : include cells with distance from cellCentre to surface
|
||||
// less than nearDist.
|
||||
scalar nearDist_;
|
||||
const scalar nearDist_;
|
||||
|
||||
//- if > -1 : include cells with normals at nearest surface points
|
||||
// varying more than curvature_.
|
||||
scalar curvature_;
|
||||
const scalar curvature_;
|
||||
|
||||
//- triSurface to search on. On pointer since can be external.
|
||||
const triSurface* surfPtr_;
|
||||
@ -97,7 +103,7 @@ class surfaceToCell
|
||||
|
||||
//- whether I allocated above surface ptrs or whether they are
|
||||
// external.
|
||||
bool IOwnPtrs_;
|
||||
const bool IOwnPtrs_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
@ -155,6 +161,7 @@ public:
|
||||
const bool includeCut,
|
||||
const bool includeInside,
|
||||
const bool includeOutside,
|
||||
const bool useSurfaceOrientation,
|
||||
const scalar nearDist,
|
||||
const scalar curvature
|
||||
);
|
||||
@ -170,6 +177,7 @@ public:
|
||||
const bool includeCut,
|
||||
const bool includeInside,
|
||||
const bool includeOutside,
|
||||
const bool useSurfaceOrientation,
|
||||
const scalar nearDist,
|
||||
const scalar curvature
|
||||
);
|
||||
|
||||
@ -472,7 +472,6 @@ void Foam::topoSet::invert(const label maxLen)
|
||||
insert(cellI);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -550,20 +549,6 @@ void Foam::topoSet::writeDebug(Ostream& os, const label maxLen) const
|
||||
}
|
||||
|
||||
|
||||
//void Foam::topoSet::writeDebug
|
||||
//(
|
||||
// Ostream&,
|
||||
// const primitiveMesh&,
|
||||
// const label
|
||||
//) const
|
||||
//{
|
||||
// notImplemented
|
||||
// (
|
||||
// "topoSet::writeDebug(Ostream&, const primitiveMesh&, const label)"
|
||||
// );
|
||||
//}
|
||||
|
||||
|
||||
bool Foam::topoSet::writeData(Ostream& os) const
|
||||
{
|
||||
return (os << *this).good();
|
||||
@ -576,14 +561,6 @@ void Foam::topoSet::updateMesh(const mapPolyMesh&)
|
||||
}
|
||||
|
||||
|
||||
////- Return max index+1.
|
||||
//label topoSet::maxSize(const polyMesh&) const
|
||||
//{
|
||||
// notImplemented("topoSet::maxSize(const polyMesh&)");
|
||||
//
|
||||
// return -1;
|
||||
//}
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::topoSet::operator=(const topoSet& rhs)
|
||||
|
||||
@ -32,6 +32,7 @@ License
|
||||
#include "fvcVolumeIntegrate.H"
|
||||
#include "fvMatrices.H"
|
||||
#include "absorptionEmissionModel.H"
|
||||
#include "fvcLaplacian.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -61,6 +62,9 @@ void reactingOneDim::readReactingOneDimControls()
|
||||
|
||||
coeffs().lookup("gasHSource") >> gasHSource_;
|
||||
coeffs().lookup("QrHSource") >> QrHSource_;
|
||||
useChemistrySolvers_ =
|
||||
coeffs().lookupOrDefault<bool>("useChemistrySolvers", true);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -321,6 +325,8 @@ void reactingOneDim::solveEnergy()
|
||||
(
|
||||
fvm::ddt(rho_, h_)
|
||||
- fvm::laplacian(alpha, h_)
|
||||
+ fvc::laplacian(alpha, h_)
|
||||
- fvc::laplacian(kappa(), T())
|
||||
==
|
||||
chemistrySh_
|
||||
- fvm::Sp(solidChemistry_->RRg(), h_)
|
||||
@ -462,7 +468,8 @@ reactingOneDim::reactingOneDim(const word& modelType, const fvMesh& mesh)
|
||||
totalGasMassFlux_(0.0),
|
||||
totalHeatRR_(dimensionedScalar("zero", dimEnergy/dimTime, 0.0)),
|
||||
gasHSource_(false),
|
||||
QrHSource_(false)
|
||||
QrHSource_(false),
|
||||
useChemistrySolvers_(true)
|
||||
{
|
||||
if (active_)
|
||||
{
|
||||
@ -560,7 +567,8 @@ reactingOneDim::reactingOneDim
|
||||
totalGasMassFlux_(0.0),
|
||||
totalHeatRR_(dimensionedScalar("zero", dimEnergy/dimTime, 0.0)),
|
||||
gasHSource_(false),
|
||||
QrHSource_(false)
|
||||
QrHSource_(false),
|
||||
useChemistrySolvers_(true)
|
||||
{
|
||||
if (active_)
|
||||
{
|
||||
@ -681,11 +689,18 @@ void reactingOneDim::evolveRegion()
|
||||
{
|
||||
Info<< "\nEvolving pyrolysis in region: " << regionMesh().name() << endl;
|
||||
|
||||
if (useChemistrySolvers_)
|
||||
{
|
||||
solidChemistry_->solve
|
||||
(
|
||||
time().value() - time().deltaTValue(),
|
||||
time().deltaTValue()
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
solidChemistry_->calculate();
|
||||
}
|
||||
|
||||
solveContinuity();
|
||||
|
||||
|
||||
@ -154,6 +154,9 @@ protected:
|
||||
//- Add in depth radiation source term
|
||||
bool QrHSource_;
|
||||
|
||||
//- Use chemistry solvers (ode or sequential)
|
||||
bool useChemistrySolvers_;
|
||||
|
||||
|
||||
// Protected member functions
|
||||
|
||||
|
||||
@ -45,12 +45,14 @@ Foam::sampledPlane::sampledPlane
|
||||
const word& name,
|
||||
const polyMesh& mesh,
|
||||
const plane& planeDesc,
|
||||
const keyType& zoneKey
|
||||
const keyType& zoneKey,
|
||||
const bool triangulate
|
||||
)
|
||||
:
|
||||
sampledSurface(name, mesh),
|
||||
cuttingPlane(planeDesc),
|
||||
zoneKey_(zoneKey),
|
||||
triangulate_(triangulate),
|
||||
needsUpdate_(true)
|
||||
{
|
||||
if (debug && zoneKey_.size() && mesh.cellZones().findIndex(zoneKey_) < 0)
|
||||
@ -71,6 +73,7 @@ Foam::sampledPlane::sampledPlane
|
||||
sampledSurface(name, mesh, dict),
|
||||
cuttingPlane(plane(dict.lookup("basePoint"), dict.lookup("normalVector"))),
|
||||
zoneKey_(keyType::null),
|
||||
triangulate_(dict.lookupOrDefault("triangulate", true)),
|
||||
needsUpdate_(true)
|
||||
{
|
||||
// make plane relative to the coordinateSystem (Cartesian)
|
||||
@ -138,11 +141,11 @@ bool Foam::sampledPlane::update()
|
||||
|
||||
if (selectedCells.empty())
|
||||
{
|
||||
reCut(mesh(), true); // always triangulate. Note:Make option?
|
||||
reCut(mesh(), triangulate_);
|
||||
}
|
||||
else
|
||||
{
|
||||
reCut(mesh(), true, selectedCells);
|
||||
reCut(mesh(), triangulate_, selectedCells);
|
||||
}
|
||||
|
||||
if (debug)
|
||||
@ -250,6 +253,7 @@ void Foam::sampledPlane::print(Ostream& os) const
|
||||
os << "sampledPlane: " << name() << " :"
|
||||
<< " base:" << refPoint()
|
||||
<< " normal:" << normal()
|
||||
<< " triangulate:" << triangulate_
|
||||
<< " faces:" << faces().size()
|
||||
<< " points:" << points().size();
|
||||
}
|
||||
|
||||
@ -25,7 +25,7 @@ Class
|
||||
Foam::sampledPlane
|
||||
|
||||
Description
|
||||
A sampledSurface defined by a cuttingPlane. Always triangulated.
|
||||
A sampledSurface defined by a cuttingPlane. Triangulated by default.
|
||||
|
||||
Note
|
||||
Does not actually cut until update() called.
|
||||
@ -60,6 +60,9 @@ class sampledPlane
|
||||
//- If restricted to zones, name of this zone or a regular expression
|
||||
keyType zoneKey_;
|
||||
|
||||
//- Triangulated faces or keep faces as is
|
||||
const bool triangulate_;
|
||||
|
||||
//- Track if the surface needs an update
|
||||
mutable bool needsUpdate_;
|
||||
|
||||
@ -92,7 +95,8 @@ public:
|
||||
const word& name,
|
||||
const polyMesh& mesh,
|
||||
const plane& planeDesc,
|
||||
const keyType& zoneKey = word::null
|
||||
const keyType& zoneKey = word::null,
|
||||
const bool triangulate = true
|
||||
);
|
||||
|
||||
//- Construct from dictionary
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -140,6 +140,12 @@ public:
|
||||
const label i
|
||||
) const = 0;
|
||||
|
||||
//- Return access to chemical source terms [kg/m3/s]
|
||||
virtual DimensionedField<scalar, volMesh>& RR
|
||||
(
|
||||
const label i
|
||||
) = 0;
|
||||
|
||||
|
||||
// Chemistry solution
|
||||
|
||||
|
||||
@ -211,6 +211,12 @@ public:
|
||||
const label i
|
||||
) const;
|
||||
|
||||
//- Return non const access to chemical source terms [kg/m3/s]
|
||||
virtual DimensionedField<scalar, volMesh>& RR
|
||||
(
|
||||
const label i
|
||||
);
|
||||
|
||||
//- 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);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -78,5 +78,15 @@ Foam::chemistryModel<CompType, ThermoType>::RR
|
||||
return RR_[i];
|
||||
}
|
||||
|
||||
template<class CompType, class ThermoType>
|
||||
Foam::DimensionedField<Foam::scalar, Foam::volMesh>&
|
||||
Foam::chemistryModel<CompType, ThermoType>::RR
|
||||
(
|
||||
const label i
|
||||
)
|
||||
{
|
||||
return RR_[i];
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -53,4 +53,35 @@ Foam::basicSolidChemistryModel::~basicSolidChemistryModel()
|
||||
{}
|
||||
|
||||
|
||||
const Foam::DimensionedField<Foam::scalar, Foam::volMesh>&
|
||||
Foam::basicSolidChemistryModel::RR(const label i) const
|
||||
{
|
||||
notImplemented
|
||||
(
|
||||
"const Foam::DimensionedField<Foam::scalar, Foam::volMesh>&"
|
||||
"basicSolidChemistryModel::RR(const label)"
|
||||
);
|
||||
return (DimensionedField<scalar, volMesh>::null());
|
||||
}
|
||||
|
||||
|
||||
Foam::DimensionedField<Foam::scalar, Foam::volMesh>&
|
||||
Foam::basicSolidChemistryModel::RR(const label i)
|
||||
{
|
||||
notImplemented
|
||||
(
|
||||
"Foam::DimensionedField<Foam::scalar, Foam::volMesh>&"
|
||||
"basicSolidChemistryModel::RR(const label)"
|
||||
);
|
||||
|
||||
return dynamic_cast<DimensionedField<scalar, volMesh>&>
|
||||
(
|
||||
const_cast<DimensionedField<scalar, volMesh>& >
|
||||
(
|
||||
DimensionedField<scalar, volMesh>::null()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -149,6 +149,15 @@ public:
|
||||
|
||||
//- Calculates the reaction rates
|
||||
virtual void calculate() = 0;
|
||||
|
||||
//- Return const access to the total source terms
|
||||
virtual const DimensionedField<scalar, volMesh>& RR
|
||||
(
|
||||
const label i
|
||||
) const;
|
||||
|
||||
//- Return non-const access to the total source terms
|
||||
virtual DimensionedField<scalar, volMesh>& RR(const label i);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -535,14 +535,21 @@ updateConcsInReactionI
|
||||
c[si] = max(0.0, c[si]);
|
||||
}
|
||||
|
||||
scalar sr = 0.0;
|
||||
forAll(R.rhs(), s)
|
||||
{
|
||||
label si = R.rhs()[s].index;
|
||||
const scalar rhoR = this->solidThermo_[si].rho(p, T);
|
||||
const scalar sr = rhoR/rhoL;
|
||||
sr = rhoR/rhoL;
|
||||
c[si] += dt*sr*omeg;
|
||||
c[si] = max(0.0, c[si]);
|
||||
}
|
||||
|
||||
forAll(R.grhs(), g)
|
||||
{
|
||||
label gi = R.grhs()[g].index;
|
||||
c[gi + this->nSolids_] += (1.0 - sr)*omeg*dt;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -561,24 +568,11 @@ updateRRInReactionI
|
||||
simpleMatrix<scalar>& RR
|
||||
) const
|
||||
{
|
||||
const Reaction<SolidThermo>& R = this->reactions_[index];
|
||||
scalar rhoL = 0.0;
|
||||
forAll(R.lhs(), s)
|
||||
{
|
||||
label si = R.lhs()[s].index;
|
||||
rhoL = this->solidThermo_[si].rho(p, T);
|
||||
RR[si][rRef] -= pr*corr;
|
||||
RR[si][lRef] += pf*corr;
|
||||
}
|
||||
|
||||
forAll(R.rhs(), s)
|
||||
{
|
||||
label si = R.rhs()[s].index;
|
||||
const scalar rhoR = this->solidThermo_[si].rho(p, T);
|
||||
const scalar sr = rhoR/rhoL;
|
||||
RR[si][lRef] -= sr*pf*corr;
|
||||
RR[si][rRef] += sr*pr*corr;
|
||||
}
|
||||
notImplemented
|
||||
(
|
||||
"void Foam::pyrolysisChemistryModel<CompType, SolidThermo,GasThermo>::"
|
||||
"updateRRInReactionI"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -666,7 +660,6 @@ Foam::pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::solve
|
||||
|
||||
scalar newCp = 0.0;
|
||||
scalar newhi = 0.0;
|
||||
scalar invRho = 0.0;
|
||||
scalarList dcdt = (c - c0)/dt;
|
||||
|
||||
for (label i=0; i<this->nSolids_; i++)
|
||||
@ -675,7 +668,6 @@ Foam::pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::solve
|
||||
scalar Yi = c[i]/cTot;
|
||||
newCp += Yi*this->solidThermo_[i].Cp(pi, Ti);
|
||||
newhi -= dYi*this->solidThermo_[i].Hc();
|
||||
invRho += Yi/this->solidThermo_[i].rho(pi, Ti);
|
||||
}
|
||||
|
||||
scalar dTi = (newhi/newCp)*dt;
|
||||
|
||||
@ -137,8 +137,9 @@ public:
|
||||
const bool updateC0 = false
|
||||
) const;
|
||||
|
||||
//- Return the reaction rate for reaction r and the reference
|
||||
// species and charateristic times
|
||||
//- 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,
|
||||
@ -153,8 +154,10 @@ public:
|
||||
label& rRef
|
||||
) const;
|
||||
|
||||
//- Return the reaction rate for iReaction and the reference
|
||||
// species and charateristic times
|
||||
|
||||
//- 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,
|
||||
@ -169,6 +172,7 @@ public:
|
||||
label& rRef
|
||||
) const;
|
||||
|
||||
|
||||
//- Calculates the reaction rates
|
||||
virtual void calculate();
|
||||
|
||||
@ -186,6 +190,7 @@ public:
|
||||
|
||||
|
||||
//- Update matrix RR for reaction i. Used by EulerImplicit
|
||||
// (Not implemented)
|
||||
virtual void updateRRInReactionI
|
||||
(
|
||||
const label i,
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -65,6 +65,9 @@ class solidChemistryModel
|
||||
{
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow copy constructor
|
||||
solidChemistryModel(const solidChemistryModel&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const solidChemistryModel&);
|
||||
|
||||
@ -151,6 +154,7 @@ public:
|
||||
label& rRef
|
||||
) const = 0;
|
||||
|
||||
|
||||
//- Return the reaction rate for iReaction and the reference
|
||||
// species and charateristic times
|
||||
virtual scalar omegaI
|
||||
@ -167,6 +171,10 @@ public:
|
||||
label& rRef
|
||||
) const = 0;
|
||||
|
||||
//- Calculates the reaction rates
|
||||
virtual void calculate() = 0;
|
||||
|
||||
|
||||
//- Update concentrations in reaction i given dt and reaction rate
|
||||
// omega used by sequential solver
|
||||
virtual void updateConcsInReactionI
|
||||
@ -194,11 +202,8 @@ public:
|
||||
simpleMatrix<scalar>& RR
|
||||
) const = 0;
|
||||
|
||||
//- Calculates the reaction rates
|
||||
virtual void calculate() = 0;
|
||||
|
||||
|
||||
// Chemistry model functions
|
||||
// Solid Chemistry model functions
|
||||
|
||||
//- Return const access to the chemical source terms for solids
|
||||
inline const DimensionedField<scalar, volMesh>& RRs
|
||||
@ -209,13 +214,6 @@ public:
|
||||
//- 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;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -95,16 +95,4 @@ Foam::solidChemistryModel<CompType, SolidThermo>::RRs() const
|
||||
}
|
||||
|
||||
|
||||
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());
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -52,9 +52,8 @@ namespace Foam
|
||||
defineTemplateTypeNameAndDebugWithName \
|
||||
( \
|
||||
SS##Schem##Comp##SThermo##GThermo, \
|
||||
(#SS"<" + word(Schem::typeName_()) \
|
||||
+ "<"#Comp"," + SThermo::typeName() \
|
||||
+ "," + GThermo::typeName() + ">>").c_str(), \
|
||||
(#SS"<"#Schem"<"#Comp"," + SThermo::typeName() + "," \
|
||||
+ GThermo::typeName() + ">>").c_str(), \
|
||||
0 \
|
||||
); \
|
||||
\
|
||||
@ -77,14 +76,6 @@ namespace Foam
|
||||
GThermo \
|
||||
); \
|
||||
\
|
||||
makeSolidChemistrySolverType \
|
||||
( \
|
||||
EulerImplicit, \
|
||||
SolidChem, \
|
||||
Comp, \
|
||||
SThermo, \
|
||||
GThermo \
|
||||
); \
|
||||
\
|
||||
makeSolidChemistrySolverType \
|
||||
( \
|
||||
@ -104,7 +95,6 @@ namespace Foam
|
||||
GThermo \
|
||||
);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
@ -30,7 +30,7 @@ Description
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef makeSolidThermo_H
|
||||
#define makesolidThermo_H
|
||||
#define makeSolidThermo_H
|
||||
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ FoamFile
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class volScalarField;
|
||||
object alpha1;
|
||||
object alpha.air;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -10,7 +10,7 @@ FoamFile
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class volScalarField;
|
||||
object alpha1;
|
||||
object alpha.mercury;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -10,7 +10,7 @@ FoamFile
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class volScalarField;
|
||||
object alpha1;
|
||||
object alpha.oil;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -1,44 +0,0 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: dev |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class volScalarField;
|
||||
object alpha1;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [0 0 0 0 0 0 0];
|
||||
|
||||
internalField uniform 0;
|
||||
|
||||
boundaryField
|
||||
{
|
||||
rotor
|
||||
{
|
||||
type zeroGradient;
|
||||
}
|
||||
|
||||
stator
|
||||
{
|
||||
type zeroGradient;
|
||||
}
|
||||
|
||||
front
|
||||
{
|
||||
type empty;
|
||||
}
|
||||
|
||||
back
|
||||
{
|
||||
type empty;
|
||||
}
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -11,7 +11,7 @@ FoamFile
|
||||
format ascii;
|
||||
class volScalarField;
|
||||
location "0";
|
||||
object alphaair;
|
||||
object alpha.air;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -11,7 +11,7 @@ FoamFile
|
||||
format ascii;
|
||||
class volScalarField;
|
||||
location "0";
|
||||
object alphamercury;
|
||||
object alpha.mercury;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -11,7 +11,7 @@ FoamFile
|
||||
format ascii;
|
||||
class volScalarField;
|
||||
location "0";
|
||||
object alphaoil;
|
||||
object alpha.oil;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -11,7 +11,7 @@ FoamFile
|
||||
format ascii;
|
||||
class volScalarField;
|
||||
location "0";
|
||||
object alphawater;
|
||||
object alpha.water;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -32,12 +32,14 @@ FoamFile
|
||||
front
|
||||
{
|
||||
type empty;
|
||||
inGroups 1(empty);
|
||||
nFaces 3072;
|
||||
startFace 6336;
|
||||
}
|
||||
back
|
||||
{
|
||||
type empty;
|
||||
inGroups 1(empty);
|
||||
nFaces 3072;
|
||||
startFace 9408;
|
||||
}
|
||||
|
||||
@ -46,8 +46,6 @@ phases
|
||||
}
|
||||
);
|
||||
|
||||
refPhase air;
|
||||
|
||||
sigmas
|
||||
(
|
||||
(air water) 0.07
|
||||
|
||||
@ -17,10 +17,10 @@ FoamFile
|
||||
|
||||
defaultFieldValues
|
||||
(
|
||||
volScalarFieldValue alphaair 1
|
||||
volScalarFieldValue alphawater 0
|
||||
volScalarFieldValue alphaoil 0
|
||||
volScalarFieldValue alphamercury 0
|
||||
volScalarFieldValue alpha.air 1
|
||||
volScalarFieldValue alpha.water 0
|
||||
volScalarFieldValue alpha.oil 0
|
||||
volScalarFieldValue alpha.mercury 0
|
||||
);
|
||||
|
||||
regions
|
||||
@ -30,10 +30,10 @@ regions
|
||||
box (0 0 -1) (1 1 1);
|
||||
fieldValues
|
||||
(
|
||||
volScalarFieldValue alphawater 1
|
||||
volScalarFieldValue alphaoil 0
|
||||
volScalarFieldValue alphamercury 0
|
||||
volScalarFieldValue alphaair 0
|
||||
volScalarFieldValue alpha.water 1
|
||||
volScalarFieldValue alpha.oil 0
|
||||
volScalarFieldValue alpha.mercury 0
|
||||
volScalarFieldValue alpha.air 0
|
||||
);
|
||||
}
|
||||
boxToCell
|
||||
@ -41,10 +41,10 @@ regions
|
||||
box (0 -1 -1) (1 0 1);
|
||||
fieldValues
|
||||
(
|
||||
volScalarFieldValue alphawater 0
|
||||
volScalarFieldValue alphaoil 1
|
||||
volScalarFieldValue alphamercury 0
|
||||
volScalarFieldValue alphaair 0
|
||||
volScalarFieldValue alpha.water 0
|
||||
volScalarFieldValue alpha.oil 1
|
||||
volScalarFieldValue alpha.mercury 0
|
||||
volScalarFieldValue alpha.air 0
|
||||
);
|
||||
}
|
||||
boxToCell
|
||||
@ -52,10 +52,10 @@ regions
|
||||
box (-1 -1 -1) (0 0 1);
|
||||
fieldValues
|
||||
(
|
||||
volScalarFieldValue alphawater 0
|
||||
volScalarFieldValue alphaoil 0
|
||||
volScalarFieldValue alphamercury 1
|
||||
volScalarFieldValue alphaair 0
|
||||
volScalarFieldValue alpha.water 0
|
||||
volScalarFieldValue alpha.oil 0
|
||||
volScalarFieldValue alpha.mercury 1
|
||||
volScalarFieldValue alpha.air 0
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user