Merge remote branch 'OpenCFD/master' into olesenm

This commit is contained in:
Mark Olesen
2010-11-25 11:24:10 +01:00
150 changed files with 34847 additions and 780 deletions

View File

@ -0,0 +1,3 @@
chemFoam.C
EXE = $(FOAM_APPBIN)/chemFoam

View File

@ -0,0 +1,21 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude \
-I$(LIB_SRC)/ODE/lnInclude\
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
EXE_LIBS = \
-lfiniteVolume \
-lcompressibleRASModels \
-lreactionThermophysicalModels \
-lbasicThermophysicalModels \
-lchemistryModel \
-lODE \
-lthermophysicalFunctions \
-lspecie

View File

@ -0,0 +1,12 @@
{
forAll(Y, specieI)
{
volScalarField& Yi = Y[specieI];
solve
(
fvm::ddt(rho, Yi) - chemistry.RR(specieI),
mesh.solver("Yi")
);
}
}

View File

@ -0,0 +1,93 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
chemFoam
Description
Solver for chemistry problems
- designed for use on single cell cases to provide comparison against
other chemistry solvers
- single cell mesh created on-the-fly
- fields created on the fly from the initial conditions
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "hCombustionThermo.H"
#include "turbulenceModel.H"
#include "psiChemistryModel.H"
#include "chemistrySolver.H"
#include "OFstream.H"
#include "thermoPhysicsTypes.H"
#include "basicMultiComponentMixture.H"
#include "cellModeller.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createSingleCellMesh.H"
#include "createFields.H"
#include "readInitialConditions.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
{
#include "readControls.H"
#include "setDeltaT.H"
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "solveChemistry.H"
{
#include "YEqn.H"
#include "hEqn.H"
#include "pEqn.H"
}
#include "output.H"
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
}
Info << "Number of steps = " << runTime.timeIndex() << endl;
Info << "End" << nl << endl;
return(0);
}
// ************************************************************************* //

View File

@ -0,0 +1,57 @@
// write base thermo fields - not registered since will be re-read by
// thermo package
Info<< "Creating base fields for time " << runTime.timeName() << endl;
{
volScalarField Ydefault
(
IOobject
(
"Ydefault",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE,
false
),
mesh,
dimensionedScalar("Ydefault", dimless, 1)
);
Ydefault.write();
volScalarField p
(
IOobject
(
"p",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE,
false
),
mesh,
dimensionedScalar("p", dimPressure, p0)
);
p.write();
volScalarField T
(
IOobject
(
"T",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE,
false
),
mesh,
dimensionedScalar("T", dimTemperature, T0)
);
T.write();
}

View File

@ -0,0 +1,84 @@
if (mesh.nCells() != 1)
{
FatalErrorIn(args.executable())
<< "Solver only applicable to single cell cases"
<< exit(FatalError);
}
Info<< "Reading initial conditions.\n" << endl;
IOdictionary initialConditions
(
IOobject
(
"initialConditions",
runTime.constant(),
runTime,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
scalar p0 = readScalar(initialConditions.lookup("p"));
scalar T0 = readScalar(initialConditions.lookup("T"));
#include "createBaseFields.H"
Info<< nl << "Reading thermophysicalProperties" << endl;
autoPtr<psiChemistryModel> pChemistry(psiChemistryModel::New(mesh));
psiChemistryModel& chemistry = pChemistry();
scalar dtChem = refCast<const psiChemistryModel>(chemistry).deltaTChem()[0];
hsCombustionThermo& thermo = chemistry.thermo();
basicMultiComponentMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y();
volScalarField rho
(
IOobject
(
"rho",
runTime.timeName(),
runTime,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
thermo.rho()
);
volScalarField& p = thermo.p();
volScalarField& hs = thermo.hs();
volVectorField U
(
IOobject
(
"U",
runTime.timeName(),
runTime,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedVector("zero", dimVelocity, vector::zero),
p.boundaryField().types()
);
#include "createPhi.H"
Info << "Creating turbulence model.\n" << endl;
autoPtr<compressible::turbulenceModel> turbulence
(
compressible::turbulenceModel::New
(
rho,
U,
phi,
thermo
)
);
OFstream post(args.path()/"chemFoam.out");
post<< "# Time" << token::TAB << "Temperature [K]" << token::TAB
<< "Pressure [Pa]" << endl;

View File

@ -0,0 +1,38 @@
Info<< "Constructing single cell mesh" << nl << endl;
labelList owner(6, 0);
labelList neighbour(0);
pointField points(8);
points[0] = vector(0, 0, 0);
points[1] = vector(1, 0, 0);
points[2] = vector(1, 1, 0);
points[3] = vector(0, 1, 0);
points[4] = vector(0, 0, 1);
points[5] = vector(1, 0, 1);
points[6] = vector(1, 1, 1);
points[7] = vector(0, 1, 1);
const cellModel& hexa = *(cellModeller::lookup("hex"));
faceList faces = hexa.modelFaces();
fvMesh mesh
(
IOobject
(
fvMesh::defaultRegion,
runTime.timeName(),
runTime,
IOobject::NO_READ
),
xferMove<Field<vector> >(points),
faces.xfer(),
owner.xfer(),
neighbour.xfer()
);
List<polyPatch*> patches(1);
patches[0] = new emptyPolyPatch("boundary", 6, 0, 0, mesh.boundaryMesh());
mesh.addFvPatches(patches);

View File

@ -0,0 +1,10 @@
{
if (constProp == "volume")
{
hs[0] = u0 + p[0]/rho[0] + integratedHeat;
}
else
{
hs[0] = hs0 + integratedHeat;
}
}

View File

@ -0,0 +1,11 @@
runTime.write();
Info<< "Sh = " << Sh
<< ", T = " << thermo.T()[0]
<< ", p = " << thermo.p()[0]
<< ", " << Y[0].name() << " = " << Y[0][0]
<< endl;
post<< runTime.value() << token::TAB << thermo.T()[0] << token::TAB
<< thermo.p()[0] << endl;

View File

@ -0,0 +1,9 @@
{
thermo.correct();
rho = thermo.rho();
if (constProp == "volume")
{
p[0] = rho0*R0*thermo.T()[0];
rho[0] = rho0;
}
}

View File

@ -0,0 +1,8 @@
if (runTime.controlDict().lookupOrDefault("suppressSolverInfo", false))
{
lduMatrix::debug = 0;
}
Switch adjustTimeStep(runTime.controlDict().lookup("adjustTimeStep"));
scalar maxDeltaT(readScalar(runTime.controlDict().lookup("maxDeltaT")));

View File

@ -0,0 +1,111 @@
word constProp(initialConditions.lookup("constantProperty"));
if (constProp == "pressure" || constProp == "volume")
{
Info << constProp << " will be held constant." << nl
<< " p = " << p[0] << " [Pa]" << nl
<< " T = " << thermo.T()[0] << " [K] " << nl
<< " rho = " << rho[0] << " [kg/m3]" << nl
<< endl;
}
else
{
FatalError << "in initialConditions, unknown constantProperty type "
<< constProp << nl << " Valid types are: pressure volume."
<< abort(FatalError);
}
word fractionBasis(initialConditions.lookup("fractionBasis"));
if ((fractionBasis != "mass") && (fractionBasis != "mole"))
{
FatalError << "in initialConditions, unknown fractionBasis type " << nl
<< "Valid types are: mass or mole."
<< fractionBasis << abort(FatalError);
}
label nSpecie = Y.size();
PtrList<gasThermoPhysics> specieData(Y.size());
forAll(specieData, i)
{
specieData.set
(
i,
new gasThermoPhysics
(
dynamic_cast<const reactingMixture<gasThermoPhysics>&>
(thermo).speciesData()[i]
)
);
}
scalarList Y0(nSpecie, 0.0);
scalarList X0(nSpecie, 0.0);
dictionary fractions(initialConditions.subDict("fractions"));
if (fractionBasis == "mole")
{
forAll(Y, i)
{
const word& name = Y[i].name();
if (fractions.found(name))
{
X0[i] = readScalar(fractions.lookup(name));
}
}
scalar mw = 0.0;
const scalar mTot = sum(X0);
forAll(Y, i)
{
X0[i] /= mTot;
mw += specieData[i].W()*X0[i];
}
forAll(Y, i)
{
Y0[i] = X0[i]*specieData[i].W()/mw;
}
}
else // mass fraction
{
forAll(Y, i)
{
const word& name = Y[i].name();
if (fractions.found(name))
{
Y0[i] = readScalar(fractions.lookup(name));
}
}
scalar invW = 0.0;
const scalar mTot = sum(Y0);
forAll(Y, i)
{
Y0[i] /= mTot;
invW += Y0[i]/specieData[i].W();
}
const scalar mw = 1.0/invW;
forAll(Y, i)
{
X0[i] = Y0[i]*mw/specieData[i].W();
}
}
scalar hs0 = 0.0;
forAll(Y, i)
{
Y[i] = Y0[i];
hs0 += Y0[i]*specieData[i].Hs(T0);
}
hs = dimensionedScalar("hs", dimEnergy/dimMass, hs0);
thermo.correct();
rho = thermo.rho();
scalar rho0 = rho[0];
scalar u0 = hs0 - p0/rho0;
scalar R0 = p0/(rho0*T0);
scalar integratedHeat = 0.0;

View File

@ -0,0 +1,6 @@
if (adjustTimeStep)
{
runTime.setDeltaT(min(dtChem, maxDeltaT));
Info<< "deltaT = " << runTime.deltaT().value() << endl;
}

View File

@ -0,0 +1,7 @@
dtChem = chemistry.solve
(
runTime.value() - runTime.deltaT().value(),
runTime.deltaT().value()
);
scalar Sh = chemistry.Sh()()[0]/rho[0];
integratedHeat += Sh*runTime.deltaT().value();

View File

@ -29,7 +29,7 @@ Description
#include "fvCFD.H" #include "fvCFD.H"
#include "wallFvPatch.H" #include "wallFvPatch.H"
#include "MeshWave.H" #include "FaceCellWave.H"
#include "wallPoint.H" #include "wallPoint.H"
@ -158,7 +158,7 @@ int main(int argc, char *argv[])
forAll(allCellInfo, cellI) forAll(allCellInfo, cellI)
{ {
scalar dist = allCellInfo[cellI].distSqr(); scalar dist = allCellInfo[cellI].distSqr();
if (allCellInfo[cellI].valid()) if (allCellInfo[cellI].valid(wallDistCalc.data()))
{ {
wallDistUncorrected[cellI] = Foam::sqrt(dist); wallDistUncorrected[cellI] = Foam::sqrt(dist);
} }
@ -180,7 +180,7 @@ int main(int argc, char *argv[])
const label meshFaceI = patchField.patch().start() + patchFaceI; const label meshFaceI = patchField.patch().start() + patchFaceI;
scalar dist = allFaceInfo[meshFaceI].distSqr(); scalar dist = allFaceInfo[meshFaceI].distSqr();
if (allFaceInfo[meshFaceI].valid()) if (allFaceInfo[meshFaceI].valid(wallDistCalc.data()))
{ {
patchField[patchFaceI] = Foam::sqrt(dist); patchField[patchFaceI] = Foam::sqrt(dist);
} }

View File

@ -158,7 +158,7 @@ int main(int argc, char *argv[])
blockMesh::verbose(true); blockMesh::verbose(true);
IOdictionary meshDict(meshDictIoPtr()); IOdictionary meshDict(meshDictIoPtr());
blockMesh blocks(meshDict); blockMesh blocks(meshDict, regionName);
if (args.optionFound("blockTopology")) if (args.optionFound("blockTopology"))

View File

@ -147,8 +147,8 @@ Foam::label Foam::checkTopology
} }
} }
faceSet oneCells(mesh, "oneInternalFaceCells", mesh.nCells()/100); cellSet oneCells(mesh, "oneInternalFaceCells", mesh.nCells()/100);
faceSet twoCells(mesh, "twoInternalFacesCells", mesh.nCells()/100); cellSet twoCells(mesh, "twoInternalFacesCells", mesh.nCells()/100);
forAll(nInternalFaces, cellI) forAll(nInternalFaces, cellI)
{ {

View File

@ -321,7 +321,7 @@ void Foam::vtkPV3blockMesh::updateFoamMesh()
) )
); );
meshPtr_ = new blockMesh(meshDict); meshPtr_ = new blockMesh(meshDict, polyMesh::defaultRegion);
} }

View File

@ -83,7 +83,7 @@ PtrList<List<Type> > readFields
{ {
Info<< " reading field " << obj.name() << endl; Info<< " reading field " << obj.name() << endl;
IOField<Type> newField(obj); IOField<Type> newField(obj);
values.set(fieldI++, new List<Type>(newField.xferList())); values.set(fieldI++, new List<Type>(newField.xfer()));
break; break;
} }
} }

View File

@ -67,6 +67,7 @@ cleanCase()
rm -rf forces* > /dev/null 2>&1 rm -rf forces* > /dev/null 2>&1
rm -rf sets > /dev/null 2>&1 rm -rf sets > /dev/null 2>&1
rm -rf system/machines > /dev/null 2>&1 rm -rf system/machines > /dev/null 2>&1
if [ -d "constant/polyMesh" ]; then
(cd constant/polyMesh && \ (cd constant/polyMesh && \
rm -rf \ rm -rf \
allOwner* cell* face* meshModifiers* \ allOwner* cell* face* meshModifiers* \
@ -74,6 +75,7 @@ cleanCase()
cellLevel* pointLevel* refinementHistory* surfaceIndex* sets \ cellLevel* pointLevel* refinementHistory* surfaceIndex* sets \
> /dev/null 2>&1 \ > /dev/null 2>&1 \
) )
fi
(cd constant && \ (cd constant && \
rm -rf \ rm -rf \
cellToRegion cellLevel* pointLevel* \ cellToRegion cellLevel* pointLevel* \

View File

@ -21,16 +21,16 @@ OSspecific/$WM_OSTYPE/Allwmake
wmake libso OpenFOAM wmake libso OpenFOAM
wmake libso fileFormats wmake libso fileFormats
wmake libso triSurface
wmake libso meshTools
wmake libso edgeMesh wmake libso edgeMesh
wmake libso surfMesh wmake libso surfMesh
wmake libso triSurface
# Decomposition methods needed by dummyThirdParty # Decomposition methods needed by dummyThirdParty
parallel/decompose/AllwmakeLnInclude parallel/decompose/AllwmakeLnInclude
# dummyThirdParty (dummy metisDecomp, scotchDecomp etc) needed by e.g. meshTools # dummyThirdParty (dummy metisDecomp, scotchDecomp etc) needed by e.g. meshTools
dummyThirdParty/Allwmake dummyThirdParty/Allwmake
wmake libso meshTools
wmake libso lagrangian/basic wmake libso lagrangian/basic
wmake libso finiteVolume wmake libso finiteVolume
wmake libso genericPatchFields wmake libso genericPatchFields

View File

@ -35,75 +35,16 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
template <class Type> template <class Type, class TrackingData>
const Foam::scalar Foam::FaceCellWave<Type>::geomTol_ = 1e-6; const Foam::scalar
Foam::FaceCellWave<Type, TrackingData>::geomTol_ = 1e-6;
template <class Type> template <class Type, class TrackingData>
Foam::scalar Foam::FaceCellWave<Type>::propagationTol_ = 0.01; const Foam::scalar
Foam::FaceCellWave<Type, TrackingData>::propagationTol_ = 0.01;
// Write to ostream template <class Type, class TrackingData>
template <class Type> Foam::label Foam::FaceCellWave<Type, TrackingData>::dummyTrackData_ = 12345;
Foam::Ostream& Foam::FaceCellWave<Type>::writeFaces
(
const label nFaces,
const labelList& faceLabels,
const List<Type>& faceInfo,
Ostream& os
)
{
// Write list contents depending on data format
if (os.format() == IOstream::ASCII)
{
os << nFaces;
for (label i = 0; i < nFaces; i++)
{
os << ' ' << faceLabels[i];
}
for (label i = 0; i < nFaces; i++)
{
os << ' ' << faceInfo[i];
}
}
else
{
os << nFaces;
for (label i = 0; i < nFaces; i++)
{
os << faceLabels[i];
}
for (label i = 0; i < nFaces; i++)
{
os << faceInfo[i];
}
}
return os;
}
// Read from istream
template <class Type>
Foam::Istream& Foam::FaceCellWave<Type>::readFaces
(
label& nFaces,
labelList& faceLabels,
List<Type>& faceInfo,
Istream& is
)
{
is >> nFaces;
for (label i = 0; i < nFaces; i++)
{
is >> faceLabels[i];
}
for (label i = 0; i < nFaces; i++)
{
is >> faceInfo[i];
}
return is;
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -113,8 +54,8 @@ Foam::Istream& Foam::FaceCellWave<Type>::readFaces
// Updates: // Updates:
// - changedCell_, changedCells_, nChangedCells_, // - changedCell_, changedCells_, nChangedCells_,
// - statistics: nEvals_, nUnvisitedCells_ // - statistics: nEvals_, nUnvisitedCells_
template <class Type> template <class Type, class TrackingData>
bool Foam::FaceCellWave<Type>::updateCell bool Foam::FaceCellWave<Type, TrackingData>::updateCell
( (
const label cellI, const label cellI,
const label neighbourFaceI, const label neighbourFaceI,
@ -125,7 +66,7 @@ bool Foam::FaceCellWave<Type>::updateCell
{ {
nEvals_++; nEvals_++;
bool wasValid = cellInfo.valid(); bool wasValid = cellInfo.valid(td_);
bool propagate = bool propagate =
cellInfo.updateCell cellInfo.updateCell
@ -134,7 +75,8 @@ bool Foam::FaceCellWave<Type>::updateCell
cellI, cellI,
neighbourFaceI, neighbourFaceI,
neighbourInfo, neighbourInfo,
tol tol,
td_
); );
if (propagate) if (propagate)
@ -146,7 +88,7 @@ bool Foam::FaceCellWave<Type>::updateCell
} }
} }
if (!wasValid && cellInfo.valid()) if (!wasValid && cellInfo.valid(td_))
{ {
--nUnvisitedCells_; --nUnvisitedCells_;
} }
@ -160,8 +102,8 @@ bool Foam::FaceCellWave<Type>::updateCell
// Updates: // Updates:
// - changedFace_, changedFaces_, nChangedFaces_, // - changedFace_, changedFaces_, nChangedFaces_,
// - statistics: nEvals_, nUnvisitedFaces_ // - statistics: nEvals_, nUnvisitedFaces_
template <class Type> template <class Type, class TrackingData>
bool Foam::FaceCellWave<Type>::updateFace bool Foam::FaceCellWave<Type, TrackingData>::updateFace
( (
const label faceI, const label faceI,
const label neighbourCellI, const label neighbourCellI,
@ -172,7 +114,7 @@ bool Foam::FaceCellWave<Type>::updateFace
{ {
nEvals_++; nEvals_++;
bool wasValid = faceInfo.valid(); bool wasValid = faceInfo.valid(td_);
bool propagate = bool propagate =
faceInfo.updateFace faceInfo.updateFace
@ -181,7 +123,8 @@ bool Foam::FaceCellWave<Type>::updateFace
faceI, faceI,
neighbourCellI, neighbourCellI,
neighbourInfo, neighbourInfo,
tol tol,
td_
); );
if (propagate) if (propagate)
@ -193,7 +136,7 @@ bool Foam::FaceCellWave<Type>::updateFace
} }
} }
if (!wasValid && faceInfo.valid()) if (!wasValid && faceInfo.valid(td_))
{ {
--nUnvisitedFaces_; --nUnvisitedFaces_;
} }
@ -207,8 +150,8 @@ bool Foam::FaceCellWave<Type>::updateFace
// Updates: // Updates:
// - changedFace_, changedFaces_, nChangedFaces_, // - changedFace_, changedFaces_, nChangedFaces_,
// - statistics: nEvals_, nUnvisitedFaces_ // - statistics: nEvals_, nUnvisitedFaces_
template <class Type> template <class Type, class TrackingData>
bool Foam::FaceCellWave<Type>::updateFace bool Foam::FaceCellWave<Type, TrackingData>::updateFace
( (
const label faceI, const label faceI,
const Type& neighbourInfo, const Type& neighbourInfo,
@ -218,7 +161,7 @@ bool Foam::FaceCellWave<Type>::updateFace
{ {
nEvals_++; nEvals_++;
bool wasValid = faceInfo.valid(); bool wasValid = faceInfo.valid(td_);
bool propagate = bool propagate =
faceInfo.updateFace faceInfo.updateFace
@ -226,7 +169,8 @@ bool Foam::FaceCellWave<Type>::updateFace
mesh_, mesh_,
faceI, faceI,
neighbourInfo, neighbourInfo,
tol tol,
td_
); );
if (propagate) if (propagate)
@ -238,7 +182,7 @@ bool Foam::FaceCellWave<Type>::updateFace
} }
} }
if (!wasValid && faceInfo.valid()) if (!wasValid && faceInfo.valid(td_))
{ {
--nUnvisitedFaces_; --nUnvisitedFaces_;
} }
@ -248,8 +192,11 @@ bool Foam::FaceCellWave<Type>::updateFace
// For debugging: check status on both sides of cyclic // For debugging: check status on both sides of cyclic
template <class Type> template <class Type, class TrackingData>
void Foam::FaceCellWave<Type>::checkCyclic(const polyPatch& patch) const void Foam::FaceCellWave<Type, TrackingData>::checkCyclic
(
const polyPatch& patch
) const
{ {
const cyclicPolyPatch& nbrPatch = const cyclicPolyPatch& nbrPatch =
refCast<const cyclicPolyPatch>(patch).neighbPatch(); refCast<const cyclicPolyPatch>(patch).neighbPatch();
@ -259,10 +206,22 @@ void Foam::FaceCellWave<Type>::checkCyclic(const polyPatch& patch) const
label i1 = patch.start() + patchFaceI; label i1 = patch.start() + patchFaceI;
label i2 = nbrPatch.start() + patchFaceI; label i2 = nbrPatch.start() + patchFaceI;
if (!allFaceInfo_[i1].sameGeometry(mesh_, allFaceInfo_[i2], geomTol_)) if
(
!allFaceInfo_[i1].sameGeometry
(
mesh_,
allFaceInfo_[i2],
geomTol_,
td_
)
)
{ {
FatalErrorIn("FaceCellWave<Type>::checkCyclic(const polyPatch&)") FatalErrorIn
<< "problem: i:" << i1 << " otheri:" << i2 (
"FaceCellWave<Type, TrackingData>"
"::checkCyclic(const polyPatch&)"
) << "problem: i:" << i1 << " otheri:" << i2
<< " faceInfo:" << allFaceInfo_[i1] << " faceInfo:" << allFaceInfo_[i1]
<< " otherfaceInfo:" << allFaceInfo_[i2] << " otherfaceInfo:" << allFaceInfo_[i2]
<< abort(FatalError); << abort(FatalError);
@ -270,8 +229,11 @@ void Foam::FaceCellWave<Type>::checkCyclic(const polyPatch& patch) const
if (changedFace_[i1] != changedFace_[i2]) if (changedFace_[i1] != changedFace_[i2])
{ {
FatalErrorIn("FaceCellWave<Type>::checkCyclic(const polyPatch&)") FatalErrorIn
<< " problem: i:" << i1 << " otheri:" << i2 (
"FaceCellWave<Type, TrackingData>"
"::checkCyclic(const polyPatch&)"
) << " problem: i:" << i1 << " otheri:" << i2
<< " faceInfo:" << allFaceInfo_[i1] << " faceInfo:" << allFaceInfo_[i1]
<< " otherfaceInfo:" << allFaceInfo_[i2] << " otherfaceInfo:" << allFaceInfo_[i2]
<< " changedFace:" << changedFace_[i1] << " changedFace:" << changedFace_[i1]
@ -283,8 +245,8 @@ void Foam::FaceCellWave<Type>::checkCyclic(const polyPatch& patch) const
// Check if has cyclic patches // Check if has cyclic patches
template <class Type> template <class Type, class TrackingData>
bool Foam::FaceCellWave<Type>::hasCyclicPatch() const bool Foam::FaceCellWave<Type, TrackingData>::hasCyclicPatch() const
{ {
forAll(mesh_.boundaryMesh(), patchI) forAll(mesh_.boundaryMesh(), patchI)
{ {
@ -298,8 +260,8 @@ bool Foam::FaceCellWave<Type>::hasCyclicPatch() const
// Copy face information into member data // Copy face information into member data
template <class Type> template <class Type, class TrackingData>
void Foam::FaceCellWave<Type>::setFaceInfo void Foam::FaceCellWave<Type, TrackingData>::setFaceInfo
( (
const labelList& changedFaces, const labelList& changedFaces,
const List<Type>& changedFacesInfo const List<Type>& changedFacesInfo
@ -309,13 +271,13 @@ void Foam::FaceCellWave<Type>::setFaceInfo
{ {
label faceI = changedFaces[changedFaceI]; label faceI = changedFaces[changedFaceI];
bool wasValid = allFaceInfo_[faceI].valid(); bool wasValid = allFaceInfo_[faceI].valid(td_);
// Copy info for faceI // Copy info for faceI
allFaceInfo_[faceI] = changedFacesInfo[changedFaceI]; allFaceInfo_[faceI] = changedFacesInfo[changedFaceI];
// Maintain count of unset faces // Maintain count of unset faces
if (!wasValid && allFaceInfo_[faceI].valid()) if (!wasValid && allFaceInfo_[faceI].valid(td_))
{ {
--nUnvisitedFaces_; --nUnvisitedFaces_;
} }
@ -329,8 +291,8 @@ void Foam::FaceCellWave<Type>::setFaceInfo
// Merge face information into member data // Merge face information into member data
template <class Type> template <class Type, class TrackingData>
void Foam::FaceCellWave<Type>::mergeFaceInfo void Foam::FaceCellWave<Type, TrackingData>::mergeFaceInfo
( (
const polyPatch& patch, const polyPatch& patch,
const label nFaces, const label nFaces,
@ -347,7 +309,7 @@ void Foam::FaceCellWave<Type>::mergeFaceInfo
Type& currentWallInfo = allFaceInfo_[meshFaceI]; Type& currentWallInfo = allFaceInfo_[meshFaceI];
if (currentWallInfo != neighbourWallInfo) if (!currentWallInfo.equal(neighbourWallInfo, td_))
{ {
updateFace updateFace
( (
@ -364,8 +326,8 @@ void Foam::FaceCellWave<Type>::mergeFaceInfo
// Construct compact patchFace change arrays for a (slice of a) single patch. // Construct compact patchFace change arrays for a (slice of a) single patch.
// changedPatchFaces in local patch numbering. // changedPatchFaces in local patch numbering.
// Return length of arrays. // Return length of arrays.
template <class Type> template <class Type, class TrackingData>
Foam::label Foam::FaceCellWave<Type>::getChangedPatchFaces Foam::label Foam::FaceCellWave<Type, TrackingData>::getChangedPatchFaces
( (
const polyPatch& patch, const polyPatch& patch,
const label startFaceI, const label startFaceI,
@ -394,8 +356,8 @@ Foam::label Foam::FaceCellWave<Type>::getChangedPatchFaces
// Handle leaving domain. Implementation referred to Type // Handle leaving domain. Implementation referred to Type
template <class Type> template <class Type, class TrackingData>
void Foam::FaceCellWave<Type>::leaveDomain void Foam::FaceCellWave<Type, TrackingData>::leaveDomain
( (
const polyPatch& patch, const polyPatch& patch,
const label nFaces, const label nFaces,
@ -410,14 +372,14 @@ void Foam::FaceCellWave<Type>::leaveDomain
label patchFaceI = faceLabels[i]; label patchFaceI = faceLabels[i];
label meshFaceI = patch.start() + patchFaceI; label meshFaceI = patch.start() + patchFaceI;
faceInfo[i].leaveDomain(mesh_, patch, patchFaceI, fc[meshFaceI]); faceInfo[i].leaveDomain(mesh_, patch, patchFaceI, fc[meshFaceI], td_);
} }
} }
// Handle entering domain. Implementation referred to Type // Handle entering domain. Implementation referred to Type
template <class Type> template <class Type, class TrackingData>
void Foam::FaceCellWave<Type>::enterDomain void Foam::FaceCellWave<Type, TrackingData>::enterDomain
( (
const polyPatch& patch, const polyPatch& patch,
const label nFaces, const label nFaces,
@ -432,14 +394,14 @@ void Foam::FaceCellWave<Type>::enterDomain
label patchFaceI = faceLabels[i]; label patchFaceI = faceLabels[i];
label meshFaceI = patch.start() + patchFaceI; label meshFaceI = patch.start() + patchFaceI;
faceInfo[i].enterDomain(mesh_, patch, patchFaceI, fc[meshFaceI]); faceInfo[i].enterDomain(mesh_, patch, patchFaceI, fc[meshFaceI], td_);
} }
} }
// Transform. Implementation referred to Type // Transform. Implementation referred to Type
template <class Type> template <class Type, class TrackingData>
void Foam::FaceCellWave<Type>::transform void Foam::FaceCellWave<Type, TrackingData>::transform
( (
const tensorField& rotTensor, const tensorField& rotTensor,
const label nFaces, const label nFaces,
@ -452,22 +414,22 @@ void Foam::FaceCellWave<Type>::transform
for (label faceI = 0; faceI < nFaces; faceI++) for (label faceI = 0; faceI < nFaces; faceI++)
{ {
faceInfo[faceI].transform(mesh_, T); faceInfo[faceI].transform(mesh_, T, td_);
} }
} }
else else
{ {
for (label faceI = 0; faceI < nFaces; faceI++) for (label faceI = 0; faceI < nFaces; faceI++)
{ {
faceInfo[faceI].transform(mesh_, rotTensor[faceI]); faceInfo[faceI].transform(mesh_, rotTensor[faceI], td_);
} }
} }
} }
// Offset mesh face. Used for transferring from one cyclic half to the other. // Offset mesh face. Used for transferring from one cyclic half to the other.
template <class Type> template <class Type, class TrackingData>
void Foam::FaceCellWave<Type>::offset void Foam::FaceCellWave<Type, TrackingData>::offset
( (
const polyPatch&, const polyPatch&,
const label cycOffset, const label cycOffset,
@ -483,8 +445,8 @@ void Foam::FaceCellWave<Type>::offset
// Tranfer all the information to/from neighbouring processors // Tranfer all the information to/from neighbouring processors
template <class Type> template <class Type, class TrackingData>
void Foam::FaceCellWave<Type>::handleProcPatches() void Foam::FaceCellWave<Type, TrackingData>::handleProcPatches()
{ {
// Send all // Send all
@ -532,7 +494,11 @@ void Foam::FaceCellWave<Type>::handleProcPatches()
} }
UOPstream toNeighbour(procPatch.neighbProcNo(), pBufs); UOPstream toNeighbour(procPatch.neighbProcNo(), pBufs);
writeFaces(nSendFaces, sendFaces, sendFacesInfo, toNeighbour); //writeFaces(nSendFaces, sendFaces, sendFacesInfo, toNeighbour);
toNeighbour
<< SubList<label>(sendFaces, nSendFaces)
<< SubList<Type>(sendFacesInfo, nSendFaces);
} }
} }
@ -550,26 +516,19 @@ void Foam::FaceCellWave<Type>::handleProcPatches()
refCast<const processorPolyPatch>(patch); refCast<const processorPolyPatch>(patch);
// Allocate buffers // Allocate buffers
label nReceiveFaces = 0;
labelList receiveFaces(patch.size()); labelList receiveFaces(patch.size());
List<Type> receiveFacesInfo(patch.size()); List<Type> receiveFacesInfo(patch.size());
{ {
UIPstream fromNeighbour(procPatch.neighbProcNo(), pBufs); UIPstream fromNeighbour(procPatch.neighbProcNo(), pBufs);
readFaces fromNeighbour >> receiveFaces >> receiveFacesInfo;
(
nReceiveFaces,
receiveFaces,
receiveFacesInfo,
fromNeighbour
);
} }
if (debug) if (debug)
{ {
Pout<< " Processor patch " << patchI << ' ' << patch.name() Pout<< " Processor patch " << patchI << ' ' << patch.name()
<< " communicating with " << procPatch.neighbProcNo() << " communicating with " << procPatch.neighbProcNo()
<< " Receiving:" << nReceiveFaces << " Receiving:" << receiveFaces.size()
<< endl; << endl;
} }
@ -579,7 +538,7 @@ void Foam::FaceCellWave<Type>::handleProcPatches()
transform transform
( (
procPatch.reverseT(), procPatch.reverseT(),
nReceiveFaces, receiveFaces.size(),
receiveFacesInfo receiveFacesInfo
); );
} }
@ -588,7 +547,7 @@ void Foam::FaceCellWave<Type>::handleProcPatches()
enterDomain enterDomain
( (
patch, patch,
nReceiveFaces, receiveFaces.size(),
receiveFaces, receiveFaces,
receiveFacesInfo receiveFacesInfo
); );
@ -597,7 +556,7 @@ void Foam::FaceCellWave<Type>::handleProcPatches()
mergeFaceInfo mergeFaceInfo
( (
patch, patch,
nReceiveFaces, receiveFaces.size(),
receiveFaces, receiveFaces,
receiveFacesInfo receiveFacesInfo
); );
@ -607,10 +566,8 @@ void Foam::FaceCellWave<Type>::handleProcPatches()
// Transfer information across cyclic halves. // Transfer information across cyclic halves.
// Note: Cyclic is two patches in one: one side from 0..size/2 and other template <class Type, class TrackingData>
// side from size/2 .. size. void Foam::FaceCellWave<Type, TrackingData>::handleCyclicPatches()
template <class Type>
void Foam::FaceCellWave<Type>::handleCyclicPatches()
{ {
forAll(mesh_.boundaryMesh(), patchI) forAll(mesh_.boundaryMesh(), patchI)
{ {
@ -696,17 +653,19 @@ void Foam::FaceCellWave<Type>::handleCyclicPatches()
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Set up only. Use setFaceInfo and iterate() to do actual calculation. // Set up only. Use setFaceInfo and iterate() to do actual calculation.
template <class Type> template <class Type, class TrackingData>
Foam::FaceCellWave<Type>::FaceCellWave Foam::FaceCellWave<Type, TrackingData>::FaceCellWave
( (
const polyMesh& mesh, const polyMesh& mesh,
UList<Type>& allFaceInfo, UList<Type>& allFaceInfo,
UList<Type>& allCellInfo UList<Type>& allCellInfo,
TrackingData& td
) )
: :
mesh_(mesh), mesh_(mesh),
allFaceInfo_(allFaceInfo), allFaceInfo_(allFaceInfo),
allCellInfo_(allCellInfo), allCellInfo_(allCellInfo),
td_(td),
changedFace_(mesh_.nFaces(), false), changedFace_(mesh_.nFaces(), false),
changedFaces_(mesh_.nFaces()), changedFaces_(mesh_.nFaces()),
nChangedFaces_(0), nChangedFaces_(0),
@ -723,20 +682,22 @@ Foam::FaceCellWave<Type>::FaceCellWave
// Iterate, propagating changedFacesInfo across mesh, until no change (or // Iterate, propagating changedFacesInfo across mesh, until no change (or
// maxIter reached). Initial cell values specified. // maxIter reached). Initial cell values specified.
template <class Type> template <class Type, class TrackingData>
Foam::FaceCellWave<Type>::FaceCellWave Foam::FaceCellWave<Type, TrackingData>::FaceCellWave
( (
const polyMesh& mesh, const polyMesh& mesh,
const labelList& changedFaces, const labelList& changedFaces,
const List<Type>& changedFacesInfo, const List<Type>& changedFacesInfo,
UList<Type>& allFaceInfo, UList<Type>& allFaceInfo,
UList<Type>& allCellInfo, UList<Type>& allCellInfo,
const label maxIter const label maxIter,
TrackingData& td
) )
: :
mesh_(mesh), mesh_(mesh),
allFaceInfo_(allFaceInfo), allFaceInfo_(allFaceInfo),
allCellInfo_(allCellInfo), allCellInfo_(allCellInfo),
td_(td),
changedFace_(mesh_.nFaces(), false), changedFace_(mesh_.nFaces(), false),
changedFaces_(mesh_.nFaces()), changedFaces_(mesh_.nFaces()),
nChangedFaces_(0), nChangedFaces_(0),
@ -759,7 +720,7 @@ Foam::FaceCellWave<Type>::FaceCellWave
{ {
FatalErrorIn FatalErrorIn
( (
"FaceCellWave<Type>::FaceCellWave" "FaceCellWave<Type, TrackingData>::FaceCellWave"
"(const polyMesh&, const labelList&, const List<Type>," "(const polyMesh&, const labelList&, const List<Type>,"
" UList<Type>&, UList<Type>&, const label maxIter)" " UList<Type>&, UList<Type>&, const label maxIter)"
) )
@ -775,15 +736,15 @@ Foam::FaceCellWave<Type>::FaceCellWave
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template <class Type> template <class Type, class TrackingData>
Foam::label Foam::FaceCellWave<Type>::getUnsetCells() const Foam::label Foam::FaceCellWave<Type, TrackingData>::getUnsetCells() const
{ {
return nUnvisitedCells_; return nUnvisitedCells_;
} }
template <class Type> template <class Type, class TrackingData>
Foam::label Foam::FaceCellWave<Type>::getUnsetFaces() const Foam::label Foam::FaceCellWave<Type, TrackingData>::getUnsetFaces() const
{ {
return nUnvisitedFaces_; return nUnvisitedFaces_;
} }
@ -791,8 +752,8 @@ Foam::label Foam::FaceCellWave<Type>::getUnsetFaces() const
// Propagate cell to face // Propagate cell to face
template <class Type> template <class Type, class TrackingData>
Foam::label Foam::FaceCellWave<Type>::faceToCell() Foam::label Foam::FaceCellWave<Type, TrackingData>::faceToCell()
{ {
const labelList& owner = mesh_.faceOwner(); const labelList& owner = mesh_.faceOwner();
const labelList& neighbour = mesh_.faceNeighbour(); const labelList& neighbour = mesh_.faceNeighbour();
@ -808,7 +769,7 @@ Foam::label Foam::FaceCellWave<Type>::faceToCell()
label faceI = changedFaces_[changedFaceI]; label faceI = changedFaces_[changedFaceI];
if (!changedFace_[faceI]) if (!changedFace_[faceI])
{ {
FatalErrorIn("FaceCellWave<Type>::faceToCell()") FatalErrorIn("FaceCellWave<Type, TrackingData>::faceToCell()")
<< "Face " << faceI << "Face " << faceI
<< " not marked as having been changed" << " not marked as having been changed"
<< abort(FatalError); << abort(FatalError);
@ -823,7 +784,7 @@ Foam::label Foam::FaceCellWave<Type>::faceToCell()
label cellI = owner[faceI]; label cellI = owner[faceI];
Type& currentWallInfo = allCellInfo_[cellI]; Type& currentWallInfo = allCellInfo_[cellI];
if (currentWallInfo != neighbourWallInfo) if (!currentWallInfo.equal(neighbourWallInfo, td_))
{ {
updateCell updateCell
( (
@ -841,7 +802,7 @@ Foam::label Foam::FaceCellWave<Type>::faceToCell()
cellI = neighbour[faceI]; cellI = neighbour[faceI];
Type& currentWallInfo2 = allCellInfo_[cellI]; Type& currentWallInfo2 = allCellInfo_[cellI];
if (currentWallInfo2 != neighbourWallInfo) if (!currentWallInfo2.equal(neighbourWallInfo, td_))
{ {
updateCell updateCell
( (
@ -876,8 +837,8 @@ Foam::label Foam::FaceCellWave<Type>::faceToCell()
// Propagate cell to face // Propagate cell to face
template <class Type> template <class Type, class TrackingData>
Foam::label Foam::FaceCellWave<Type>::cellToFace() Foam::label Foam::FaceCellWave<Type, TrackingData>::cellToFace()
{ {
const cellList& cells = mesh_.cells(); const cellList& cells = mesh_.cells();
@ -891,8 +852,8 @@ Foam::label Foam::FaceCellWave<Type>::cellToFace()
label cellI = changedCells_[changedCellI]; label cellI = changedCells_[changedCellI];
if (!changedCell_[cellI]) if (!changedCell_[cellI])
{ {
FatalErrorIn("FaceCellWave<Type>::cellToFace()") << "Cell " << cellI FatalErrorIn("FaceCellWave<Type, TrackingData>::cellToFace()")
<< " not marked as having been changed" << "Cell " << cellI << " not marked as having been changed"
<< abort(FatalError); << abort(FatalError);
} }
@ -906,7 +867,7 @@ Foam::label Foam::FaceCellWave<Type>::cellToFace()
label faceI = faceLabels[faceLabelI]; label faceI = faceLabels[faceLabelI];
Type& currentWallInfo = allFaceInfo_[faceI]; Type& currentWallInfo = allFaceInfo_[faceI];
if (currentWallInfo != neighbourWallInfo) if (!currentWallInfo.equal(neighbourWallInfo, td_))
{ {
updateFace updateFace
( (
@ -952,8 +913,8 @@ Foam::label Foam::FaceCellWave<Type>::cellToFace()
// Iterate // Iterate
template <class Type> template <class Type, class TrackingData>
Foam::label Foam::FaceCellWave<Type>::iterate(const label maxIter) Foam::label Foam::FaceCellWave<Type, TrackingData>::iterate(const label maxIter)
{ {
if (hasCyclicPatches_) if (hasCyclicPatches_)
{ {

View File

@ -71,7 +71,7 @@ TemplateName(FaceCellWave);
Class FaceCellWave Declaration Class FaceCellWave Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
template <class Type> template<class Type, class TrackingData = int>
class FaceCellWave class FaceCellWave
: :
public FaceCellWaveName public FaceCellWaveName
@ -87,6 +87,9 @@ class FaceCellWave
//- Information for all cells //- Information for all cells
UList<Type>& allCellInfo_; UList<Type>& allCellInfo_;
//- Additional data to be passed into container
TrackingData& td_;
//- Has face changed //- Has face changed
boolList changedFace_; boolList changedFace_;
@ -115,27 +118,6 @@ class FaceCellWave
label iter_; label iter_;
// Static Functions
//- Write faces info
static Ostream& writeFaces
(
const label nFaces,
const labelList& faceLabels,
const List<Type>& faceInfo,
Ostream& os
);
//- Read faces info
static Istream& readFaces
(
label& nFaces,
labelList& faceLabels,
List<Type>& faceInfo,
Istream& is
);
// Private Member Functions // Private Member Functions
//- Disallow default bitwise copy construct //- Disallow default bitwise copy construct
@ -250,7 +232,12 @@ class FaceCellWave
// Private static data // Private static data
static const scalar geomTol_; static const scalar geomTol_;
static scalar propagationTol_; static const scalar propagationTol_;
//- Used as default trackdata value to satisfy default template
// argument.
static label dummyTrackData_;
public: public:
@ -277,7 +264,8 @@ public:
( (
const polyMesh&, const polyMesh&,
UList<Type>& allFaceInfo, UList<Type>& allFaceInfo,
UList<Type>& allCellInfo UList<Type>& allCellInfo,
TrackingData& td = dummyTrackData_
); );
//- Construct from mesh and list of changed faces with the Type //- Construct from mesh and list of changed faces with the Type
@ -290,7 +278,8 @@ public:
const List<Type>& changedFacesInfo, const List<Type>& changedFacesInfo,
UList<Type>& allFaceInfo, UList<Type>& allFaceInfo,
UList<Type>& allCellInfo, UList<Type>& allCellInfo,
const label maxIter const label maxIter,
TrackingData& td = dummyTrackData_
); );
@ -310,6 +299,12 @@ public:
return allCellInfo_; return allCellInfo_;
} }
//- Additional data to be passed into container
const TrackingData& data() const
{
return td_;
}
//- Access mesh //- Access mesh
const polyMesh& mesh() const const polyMesh& mesh() const
{ {

View File

@ -26,17 +26,25 @@ License
#include "MeshWave.H" #include "MeshWave.H"
#include "polyMesh.H" #include "polyMesh.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
template <class Type, class TrackingData>
Foam::label Foam::MeshWave<Type, TrackingData>::dummyTrackData_ = 12345;
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Iterate, propagating changedFacesInfo across mesh, until no change (or // Iterate, propagating changedFacesInfo across mesh, until no change (or
// maxIter reached). // maxIter reached).
template <class Type> template <class Type, class TrackingData>
Foam::MeshWave<Type>::MeshWave Foam::MeshWave<Type, TrackingData>::MeshWave
( (
const polyMesh& mesh, const polyMesh& mesh,
const labelList& changedFaces, const labelList& changedFaces,
const List<Type>& changedFacesInfo, const List<Type>& changedFacesInfo,
const label maxIter const label maxIter,
TrackingData& td
) )
: :
allFaceInfo_(mesh.nFaces()), allFaceInfo_(mesh.nFaces()),
@ -48,21 +56,23 @@ Foam::MeshWave<Type>::MeshWave
changedFacesInfo, changedFacesInfo,
allFaceInfo_, allFaceInfo_,
allCellInfo_, allCellInfo_,
maxIter maxIter,
td
) )
{} {}
// Iterate, propagating changedFacesInfo across mesh, until no change (or // Iterate, propagating changedFacesInfo across mesh, until no change (or
// maxIter reached). Initial cell values specified. // maxIter reached). Initial cell values specified.
template <class Type> template <class Type, class TrackingData>
Foam::MeshWave<Type>::MeshWave Foam::MeshWave<Type, TrackingData>::MeshWave
( (
const polyMesh& mesh, const polyMesh& mesh,
const labelList& changedFaces, const labelList& changedFaces,
const List<Type>& changedFacesInfo, const List<Type>& changedFacesInfo,
const List<Type>& allCellInfo, const List<Type>& allCellInfo,
const label maxIter const label maxIter,
TrackingData& td
) )
: :
allFaceInfo_(mesh.nFaces()), allFaceInfo_(mesh.nFaces()),
@ -74,7 +84,8 @@ Foam::MeshWave<Type>::MeshWave
changedFacesInfo, changedFacesInfo,
allFaceInfo_, allFaceInfo_,
allCellInfo_, allCellInfo_,
maxIter maxIter,
td
) )
{} {}

View File

@ -53,7 +53,7 @@ TemplateName(MeshWave);
Class MeshWave Declaration Class MeshWave Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
template <class Type> template <class Type, class TrackingData = int>
class MeshWave class MeshWave
: :
public MeshWaveName public MeshWaveName
@ -67,7 +67,7 @@ class MeshWave
List<Type> allCellInfo_; List<Type> allCellInfo_;
//- Wave calculation engine. //- Wave calculation engine.
FaceCellWave<Type> calc_; FaceCellWave<Type, TrackingData> calc_;
// Private Member Functions // Private Member Functions
@ -77,6 +77,12 @@ class MeshWave
//- Disallow default bitwise assignment //- Disallow default bitwise assignment
void operator=(const MeshWave&); void operator=(const MeshWave&);
// Private static data
//- Used as default trackdata value to satisfy default template
// argument.
static label dummyTrackData_;
public: public:
// Constructors // Constructors
@ -89,7 +95,8 @@ public:
const polyMesh& mesh, const polyMesh& mesh,
const labelList& initialChangedFaces, const labelList& initialChangedFaces,
const List<Type>& changedFacesInfo, const List<Type>& changedFacesInfo,
const label maxIter const label maxIter,
TrackingData& td = dummyTrackData_
); );
//- Construct from mesh, list of changed faces with the Type //- Construct from mesh, list of changed faces with the Type
@ -102,7 +109,8 @@ public:
const labelList& initialChangedFaces, const labelList& initialChangedFaces,
const List<Type>& changedFacesInfo, const List<Type>& changedFacesInfo,
const List<Type>& allCellInfo, const List<Type>& allCellInfo,
const label maxIter const label maxIter,
TrackingData& td = dummyTrackData_
); );
@ -120,6 +128,11 @@ public:
return allCellInfo_; return allCellInfo_;
} }
//- Additional data to be passed into container
const TrackingData& data() const
{
return calc_.data();
}
//- Iterate until no changes or maxIter reached. Returns number of //- Iterate until no changes or maxIter reached. Returns number of
// unset cells (see getUnsetCells) // unset cells (see getUnsetCells)

View File

@ -164,7 +164,7 @@ Field<Type>::Field(const Xfer<List<Type> >& f)
template<class Type> template<class Type>
Field<Type>::Field(const Xfer<Field<Type> >& f) Field<Type>::Field(const Xfer<Field<Type> >& f)
: :
List<Type>(f().xferList()) List<Type>(f)
{} {}
@ -578,20 +578,6 @@ tmp<Field<Type> > Field<Type>::T() const
} }
template<class Type>
Xfer<Field<Type> > Field<Type>::xfer()
{
return xferMove(*this);
}
template<class Type>
Xfer<List<Type> > Field<Type>::xferList()
{
return List<Type>::xfer();
}
template<class Type> template<class Type>
void Field<Type>::writeEntry(const word& keyword, Ostream& os) const void Field<Type>::writeEntry(const word& keyword, Ostream& os) const
{ {

View File

@ -302,12 +302,6 @@ public:
//- Return the field transpose (only defined for second rank tensors) //- Return the field transpose (only defined for second rank tensors)
tmp<Field<Type> > T() const; tmp<Field<Type> > T() const;
//- Transfer contents to the Xfer container
Xfer<Field<Type> > xfer();
//- Transfer contents to a List Xfer container
Xfer<List<Type> > xferList();
//- Write the field as a dictionary entry //- Write the field as a dictionary entry
void writeEntry(const word& keyword, Ostream& os) const; void writeEntry(const word& keyword, Ostream& os) const;

View File

@ -25,35 +25,13 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "directionInfo.H" #include "directionInfo.H"
#include "hexMatcher.H" //#include "hexMatcher.H"
#include "meshTools.H" //#include "meshTools.H"
#include "polyMesh.H" #include "polyMesh.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
bool Foam::directionInfo::equal(const edge& e, const label v0, const label v1)
{
return
(e.start() == v0 && e.end() == v1)
|| (e.start() == v1 && e.end() == v0);
}
Foam::point Foam::directionInfo::eMid
(
const primitiveMesh& mesh,
const label edgeI
)
{
const edge& e = mesh.edges()[edgeI];
return
0.5
* (mesh.points()[e.start()] + mesh.points()[e.end()]);
}
// Find edge among edgeLabels that uses v0 and v1 // Find edge among edgeLabels that uses v0 and v1
Foam::label Foam::directionInfo::findEdge Foam::label Foam::directionInfo::findEdge
( (
@ -67,9 +45,7 @@ Foam::label Foam::directionInfo::findEdge
{ {
label edgeI = edgeLabels[edgeLabelI]; label edgeI = edgeLabels[edgeLabelI];
const edge& e = mesh.edges()[edgeI]; if (mesh.edges()[edgeI] == edge(v0, v1))
if (equal(e, v0, v1))
{ {
return edgeI; return edgeI;
} }
@ -225,159 +201,6 @@ Foam::label Foam::directionInfo::edgeToFaceIndex
} }
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// Update this cell with neighbouring face information
bool Foam::directionInfo::updateCell
(
const polyMesh& mesh,
const label thisCellI,
const label neighbourFaceI,
const directionInfo& neighbourInfo,
const scalar // tol
)
{
if (index_ >= -2)
{
// Already determined.
return false;
}
if (hexMatcher().isA(mesh, thisCellI))
{
const face& f = mesh.faces()[neighbourFaceI];
if (neighbourInfo.index() == -2)
{
// Geometric information from neighbour
index_ = -2;
}
else if (neighbourInfo.index() == -1)
{
// Cut tangential to face. Take any edge connected to face
// but not used in face.
// Get first edge on face.
label edgeI = mesh.faceEdges()[neighbourFaceI][0];
const edge& e = mesh.edges()[edgeI];
// Find face connected to face through edgeI and on same cell.
label faceI =
meshTools::otherFace
(
mesh,
thisCellI,
neighbourFaceI,
edgeI
);
// Find edge on faceI which is connected to e.start() but not edgeI.
index_ =
meshTools::otherEdge
(
mesh,
mesh.faceEdges()[faceI],
edgeI,
e.start()
);
}
else
{
// Index is a vertex on the face. Convert to mesh edge.
// Get mesh edge between f[index_] and f[index_+1]
label v0 = f[neighbourInfo.index()];
label v1 = f[(neighbourInfo.index() + 1) % f.size()];
index_ = findEdge(mesh, mesh.faceEdges()[neighbourFaceI], v0, v1);
}
}
else
{
// Not a hex so mark this as geometric.
index_ = -2;
}
n_ = neighbourInfo.n();
return true;
}
// Update this face with neighbouring cell information
bool Foam::directionInfo::updateFace
(
const polyMesh& mesh,
const label thisFaceI,
const label neighbourCellI,
const directionInfo& neighbourInfo,
const scalar // tol
)
{
// Handle special cases first
if (index_ >= -2)
{
// Already determined
return false;
}
// Handle normal cases where topological or geometrical info comes from
// neighbouring cell
if (neighbourInfo.index() >= 0)
{
// Neighbour has topological direction (and hence is hex). Find cut
// edge on face.
index_ =
edgeToFaceIndex
(
mesh,
neighbourCellI,
thisFaceI,
neighbourInfo.index()
);
}
else
{
// Neighbour has geometric information. Use.
index_ = -2;
}
n_ = neighbourInfo.n();
return true;
}
// Merge this with information on same face
bool Foam::directionInfo::updateFace
(
const polyMesh& mesh,
const label, // thisFaceI
const directionInfo& neighbourInfo,
const scalar // tol
)
{
if (index_ >= -2)
{
// Already visited.
return false;
}
else
{
index_ = neighbourInfo.index();
n_ = neighbourInfo.n();
return true;
}
}
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<< Foam::Ostream& Foam::operator<<

View File

@ -86,12 +86,6 @@ class directionInfo
// Private Member Functions // Private Member Functions
//- edge uses two labels
static bool equal(const edge& e, const label, const label);
//- Calculate mid point of edge.
static point eMid(const primitiveMesh& mesh, const label edgeI);
//- Find edge among edgeLabels that uses v0 and v1 //- Find edge among edgeLabels that uses v0 and v1
static label findEdge static label findEdge
( (
@ -158,71 +152,90 @@ public:
//- Check whether origin has been changed at all or //- Check whether origin has been changed at all or
// still contains original (invalid) value. // still contains original (invalid) value.
inline bool valid() const; template<class TrackingData>
inline bool valid(TrackingData& td) const;
//- Check for identical geometrical data. Used for cyclics checking. //- Check for identical geometrical data. Used for cyclics checking.
template<class TrackingData>
inline bool sameGeometry inline bool sameGeometry
( (
const polyMesh&, const polyMesh&,
const directionInfo&, const directionInfo&,
const scalar const scalar,
TrackingData& td
) const; ) const;
//- Convert any absolute coordinates into relative to (patch)face //- Convert any absolute coordinates into relative to (patch)face
// centre // centre
template<class TrackingData>
inline void leaveDomain inline void leaveDomain
( (
const polyMesh&, const polyMesh&,
const polyPatch&, const polyPatch&,
const label patchFaceI, const label patchFaceI,
const point& faceCentre const point& faceCentre,
TrackingData& td
); );
//- Reverse of leaveDomain //- Reverse of leaveDomain
template<class TrackingData>
inline void enterDomain inline void enterDomain
( (
const polyMesh&, const polyMesh&,
const polyPatch&, const polyPatch&,
const label patchFaceI, const label patchFaceI,
const point& faceCentre const point& faceCentre,
TrackingData& td
); );
//- Apply rotation matrix to any coordinates //- Apply rotation matrix to any coordinates
template<class TrackingData>
inline void transform inline void transform
( (
const polyMesh&, const polyMesh&,
const tensor& const tensor&,
TrackingData& td
); );
//- Influence of neighbouring face. //- Influence of neighbouring face.
bool updateCell template<class TrackingData>
inline bool updateCell
( (
const polyMesh&, const polyMesh&,
const label thisCellI, const label thisCellI,
const label neighbourFaceI, const label neighbourFaceI,
const directionInfo& neighbourInfo, const directionInfo& neighbourInfo,
const scalar tol const scalar tol,
TrackingData& td
); );
//- Influence of neighbouring cell. //- Influence of neighbouring cell.
bool updateFace template<class TrackingData>
inline bool updateFace
( (
const polyMesh&, const polyMesh&,
const label thisFaceI, const label thisFaceI,
const label neighbourCellI, const label neighbourCellI,
const directionInfo& neighbourInfo, const directionInfo& neighbourInfo,
const scalar tol const scalar tol,
TrackingData& td
); );
//- Influence of different value on same face. //- Influence of different value on same face.
bool updateFace template<class TrackingData>
inline bool updateFace
( (
const polyMesh&, const polyMesh&,
const label thisFaceI, const label thisFaceI,
const directionInfo& neighbourInfo, const directionInfo& neighbourInfo,
const scalar tol const scalar tol,
TrackingData& td
); );
//- Same (like operator==)
template<class TrackingData>
inline bool equal(const directionInfo&, TrackingData& td) const;
// Member Operators // Member Operators
// Needed for List IO // Needed for List IO

View File

@ -24,9 +24,8 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "polyMesh.H" #include "polyMesh.H"
#include "meshTools.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // #include "hexMatcher.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -60,18 +59,21 @@ inline Foam::directionInfo::directionInfo(const directionInfo& w2)
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline bool Foam::directionInfo::valid() const template<class TrackingData>
inline bool Foam::directionInfo::valid(TrackingData& td) const
{ {
return index_ != -3; return index_ != -3;
} }
// No geometric data so never any problem on cyclics // No geometric data so never any problem on cyclics
template<class TrackingData>
inline bool Foam::directionInfo::sameGeometry inline bool Foam::directionInfo::sameGeometry
( (
const polyMesh&, const polyMesh&,
const directionInfo& w2, const directionInfo& w2,
const scalar tol const scalar tol,
TrackingData& td
) )
const const
{ {
@ -80,12 +82,14 @@ inline bool Foam::directionInfo::sameGeometry
// index_ is already offset in face // index_ is already offset in face
template<class TrackingData>
inline void Foam::directionInfo::leaveDomain inline void Foam::directionInfo::leaveDomain
( (
const polyMesh&, const polyMesh&,
const polyPatch& patch, const polyPatch& patch,
const label patchFaceI, const label patchFaceI,
const point& faceCentre const point& faceCentre,
TrackingData& td
) )
{} {}
@ -94,12 +98,14 @@ inline void Foam::directionInfo::leaveDomain
// (Note: f[0] on other domain is connected to f[0] in this domain, // (Note: f[0] on other domain is connected to f[0] in this domain,
// f[1] ,, f[size-1] ,, // f[1] ,, f[size-1] ,,
// etc.) // etc.)
template<class TrackingData>
inline void Foam::directionInfo::enterDomain inline void Foam::directionInfo::enterDomain
( (
const polyMesh&, const polyMesh&,
const polyPatch& patch, const polyPatch& patch,
const label patchFaceI, const label patchFaceI,
const point& faceCentre const point& faceCentre,
TrackingData& td
) )
{ {
if (index_ >= 0) if (index_ >= 0)
@ -112,14 +118,184 @@ inline void Foam::directionInfo::enterDomain
// No geometric data. // No geometric data.
template<class TrackingData>
inline void Foam::directionInfo::transform inline void Foam::directionInfo::transform
( (
const polyMesh&, const polyMesh&,
const tensor& rotTensor const tensor& rotTensor,
TrackingData& td
) )
{} {}
// Update this cell with neighbouring face information
template<class TrackingData>
inline bool Foam::directionInfo::updateCell
(
const polyMesh& mesh,
const label thisCellI,
const label neighbourFaceI,
const directionInfo& neighbourInfo,
const scalar, // tol
TrackingData& td
)
{
if (index_ >= -2)
{
// Already determined.
return false;
}
if (hexMatcher().isA(mesh, thisCellI))
{
const face& f = mesh.faces()[neighbourFaceI];
if (neighbourInfo.index() == -2)
{
// Geometric information from neighbour
index_ = -2;
}
else if (neighbourInfo.index() == -1)
{
// Cut tangential to face. Take any edge connected to face
// but not used in face.
// Get first edge on face.
label edgeI = mesh.faceEdges()[neighbourFaceI][0];
const edge& e = mesh.edges()[edgeI];
// Find face connected to face through edgeI and on same cell.
label faceI =
meshTools::otherFace
(
mesh,
thisCellI,
neighbourFaceI,
edgeI
);
// Find edge on faceI which is connected to e.start() but not edgeI.
index_ =
meshTools::otherEdge
(
mesh,
mesh.faceEdges()[faceI],
edgeI,
e.start()
);
}
else
{
// Index is a vertex on the face. Convert to mesh edge.
// Get mesh edge between f[index_] and f[index_+1]
label v0 = f[neighbourInfo.index()];
label v1 = f[(neighbourInfo.index() + 1) % f.size()];
index_ = findEdge(mesh, mesh.faceEdges()[neighbourFaceI], v0, v1);
}
}
else
{
// Not a hex so mark this as geometric.
index_ = -2;
}
n_ = neighbourInfo.n();
return true;
}
// Update this face with neighbouring cell information
template<class TrackingData>
inline bool Foam::directionInfo::updateFace
(
const polyMesh& mesh,
const label thisFaceI,
const label neighbourCellI,
const directionInfo& neighbourInfo,
const scalar, // tol
TrackingData& td
)
{
// Handle special cases first
if (index_ >= -2)
{
// Already determined
return false;
}
// Handle normal cases where topological or geometrical info comes from
// neighbouring cell
if (neighbourInfo.index() >= 0)
{
// Neighbour has topological direction (and hence is hex). Find cut
// edge on face.
index_ =
edgeToFaceIndex
(
mesh,
neighbourCellI,
thisFaceI,
neighbourInfo.index()
);
}
else
{
// Neighbour has geometric information. Use.
index_ = -2;
}
n_ = neighbourInfo.n();
return true;
}
// Merge this with information on same face
template<class TrackingData>
inline bool Foam::directionInfo::updateFace
(
const polyMesh& mesh,
const label, // thisFaceI
const directionInfo& neighbourInfo,
const scalar, // tol
TrackingData& td
)
{
if (index_ >= -2)
{
// Already visited.
return false;
}
else
{
index_ = neighbourInfo.index();
n_ = neighbourInfo.n();
return true;
}
}
template <class TrackingData>
inline bool Foam::directionInfo::equal
(
const directionInfo& rhs,
TrackingData& td
) const
{
return operator==(rhs);
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
inline bool Foam::directionInfo::operator==(const Foam::directionInfo& rhs) inline bool Foam::directionInfo::operator==(const Foam::directionInfo& rhs)

View File

@ -171,7 +171,7 @@ Foam::wallLayerCells::wallLayerCells
{ {
const wallNormalInfo& info = faceInfo[faceI]; const wallNormalInfo& info = faceInfo[faceI];
if (info.valid()) if (info.valid(regionCalc.data()))
{ {
const face& f = mesh.faces()[faceI]; const face& f = mesh.faces()[faceI];
@ -215,7 +215,7 @@ Foam::wallLayerCells::wallLayerCells
{ {
const wallNormalInfo& info = cellInfo[cellI]; const wallNormalInfo& info = cellInfo[cellI];
if (info.valid() && !usesCoupledPatch(cellI)) if (info.valid(regionCalc.data()) && !usesCoupledPatch(cellI))
{ {
refineCells.append(refineCell(cellI, info.normal())); refineCells.append(refineCell(cellI, info.normal()));
} }

View File

@ -25,11 +25,6 @@ License
#include "wallNormalInfo.H" #include "wallNormalInfo.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
Foam::point Foam::wallNormalInfo::greatVector(GREAT, GREAT, GREAT);
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<< Foam::Ostream& Foam::operator<<

View File

@ -65,15 +65,11 @@ class wallNormalInfo
// Private Member Functions // Private Member Functions
//- Evaluate distance to point. Update normal_ //- Evaluate distance to point. Update normal_
inline bool update(const wallNormalInfo& w2); template<class TrackingData>
inline bool update(const wallNormalInfo& w2, TrackingData& td);
public: public:
// Static data members
//- initial point far away.
static point greatVector;
// Constructors // Constructors
//- Construct null //- Construct null
@ -96,71 +92,90 @@ public:
//- Check whether origin has been changed at all or //- Check whether origin has been changed at all or
// still contains original (invalid) value. // still contains original (invalid) value.
inline bool valid() const; template<class TrackingData>
inline bool valid(TrackingData& td) const;
//- Check for identical geometrical data. Used for cyclics checking. //- Check for identical geometrical data. Used for cyclics checking.
template<class TrackingData>
inline bool sameGeometry inline bool sameGeometry
( (
const polyMesh&, const polyMesh&,
const wallNormalInfo&, const wallNormalInfo&,
const scalar const scalar,
TrackingData& td
) const; ) const;
//- Convert any absolute coordinates into relative to (patch)face //- Convert any absolute coordinates into relative to (patch)face
// centre // centre
template<class TrackingData>
inline void leaveDomain inline void leaveDomain
( (
const polyMesh&, const polyMesh&,
const polyPatch&, const polyPatch&,
const label patchFaceI, const label patchFaceI,
const point& faceCentre const point& faceCentre,
TrackingData& td
); );
//- Reverse of leaveDomain //- Reverse of leaveDomain
template<class TrackingData>
inline void enterDomain inline void enterDomain
( (
const polyMesh&, const polyMesh&,
const polyPatch&, const polyPatch&,
const label patchFaceI, const label patchFaceI,
const point& faceCentre const point& faceCentre,
TrackingData& td
); );
//- Apply rotation matrix to any coordinates //- Apply rotation matrix to any coordinates
template<class TrackingData>
inline void transform inline void transform
( (
const polyMesh&, const polyMesh&,
const tensor& const tensor&,
TrackingData& td
); );
//- Influence of neighbouring face. //- Influence of neighbouring face.
template<class TrackingData>
inline bool updateCell inline bool updateCell
( (
const polyMesh&, const polyMesh&,
const label thisCellI, const label thisCellI,
const label neighbourFaceI, const label neighbourFaceI,
const wallNormalInfo& neighbourInfo, const wallNormalInfo& neighbourInfo,
const scalar tol const scalar tol,
TrackingData& td
); );
//- Influence of neighbouring cell. //- Influence of neighbouring cell.
template<class TrackingData>
inline bool updateFace inline bool updateFace
( (
const polyMesh&, const polyMesh&,
const label thisFaceI, const label thisFaceI,
const label neighbourCellI, const label neighbourCellI,
const wallNormalInfo& neighbourInfo, const wallNormalInfo& neighbourInfo,
const scalar tol const scalar tol,
TrackingData& td
); );
//- Influence of different value on same face. //- Influence of different value on same face.
template<class TrackingData>
inline bool updateFace inline bool updateFace
( (
const polyMesh&, const polyMesh&,
const label thisFaceI, const label thisFaceI,
const wallNormalInfo& neighbourInfo, const wallNormalInfo& neighbourInfo,
const scalar tol const scalar tol,
TrackingData& td
); );
//- Same (like operator==)
template<class TrackingData>
inline bool equal(const wallNormalInfo&, TrackingData& td) const;
// Member Operators // Member Operators
// Needed for List IO // Needed for List IO

View File

@ -28,9 +28,14 @@ License
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// Update this with w2 if not yet set. // Update this with w2 if not yet set.
inline bool Foam::wallNormalInfo::update(const wallNormalInfo& w2) template<class TrackingData>
inline bool Foam::wallNormalInfo::update
(
const wallNormalInfo& w2,
TrackingData& td
)
{ {
if (!w2.valid()) if (!w2.valid(td))
{ {
FatalErrorIn FatalErrorIn
( (
@ -39,7 +44,7 @@ inline bool Foam::wallNormalInfo::update(const wallNormalInfo& w2)
return false; return false;
} }
else if (valid()) else if (valid(td))
{ {
// our already set. Stop any transfer // our already set. Stop any transfer
return false; return false;
@ -58,7 +63,7 @@ inline bool Foam::wallNormalInfo::update(const wallNormalInfo& w2)
// Null constructor // Null constructor
inline Foam::wallNormalInfo::wallNormalInfo() inline Foam::wallNormalInfo::wallNormalInfo()
: :
normal_(greatVector) normal_(point::max)
{} {}
@ -84,18 +89,21 @@ inline const Foam::vector& Foam::wallNormalInfo::normal() const
} }
inline bool Foam::wallNormalInfo::valid() const template<class TrackingData>
inline bool Foam::wallNormalInfo::valid(TrackingData& td) const
{ {
return normal_ != greatVector; return normal_ != point::max;
} }
// No geometric data so never any problem on cyclics // No geometric data so never any problem on cyclics
template<class TrackingData>
inline bool Foam::wallNormalInfo::sameGeometry inline bool Foam::wallNormalInfo::sameGeometry
( (
const polyMesh&, const polyMesh&,
const wallNormalInfo& w2, const wallNormalInfo& w2,
const scalar tol const scalar tol,
TrackingData& td
) const ) const
{ {
return true; return true;
@ -103,74 +111,97 @@ inline bool Foam::wallNormalInfo::sameGeometry
// No geometric data. // No geometric data.
template<class TrackingData>
inline void Foam::wallNormalInfo::leaveDomain inline void Foam::wallNormalInfo::leaveDomain
( (
const polyMesh&, const polyMesh&,
const polyPatch& patch, const polyPatch& patch,
const label patchFaceI, const label patchFaceI,
const point& faceCentre const point& faceCentre,
TrackingData& td
) )
{} {}
// No geometric data. // No geometric data.
template<class TrackingData>
inline void Foam::wallNormalInfo::transform inline void Foam::wallNormalInfo::transform
( (
const polyMesh&, const polyMesh&,
const tensor& rotTensor const tensor& rotTensor,
TrackingData& td
) )
{} {}
// No geometric data. // No geometric data.
template<class TrackingData>
inline void Foam::wallNormalInfo::enterDomain inline void Foam::wallNormalInfo::enterDomain
( (
const polyMesh&, const polyMesh&,
const polyPatch& patch, const polyPatch& patch,
const label patchFaceI, const label patchFaceI,
const point& faceCentre const point& faceCentre,
TrackingData& td
) )
{} {}
// Update this with w2 if w2 nearer to pt. // Update this with w2 if w2 nearer to pt.
template<class TrackingData>
inline bool Foam::wallNormalInfo::updateCell inline bool Foam::wallNormalInfo::updateCell
( (
const polyMesh&, const polyMesh&,
const label thisCellI, const label thisCellI,
const label neighbourFaceI, const label neighbourFaceI,
const wallNormalInfo& neighbourWallInfo, const wallNormalInfo& neighbourWallInfo,
const scalar tol const scalar tol,
TrackingData& td
) )
{ {
return update(neighbourWallInfo); return update(neighbourWallInfo, td);
} }
// Update this with w2 if w2 nearer to pt. // Update this with w2 if w2 nearer to pt.
template<class TrackingData>
inline bool Foam::wallNormalInfo::updateFace inline bool Foam::wallNormalInfo::updateFace
( (
const polyMesh&, const polyMesh&,
const label thisFaceI, const label thisFaceI,
const label neighbourCellI, const label neighbourCellI,
const wallNormalInfo& neighbourWallInfo, const wallNormalInfo& neighbourWallInfo,
const scalar tol const scalar tol,
TrackingData& td
) )
{ {
return update(neighbourWallInfo); return update(neighbourWallInfo, td);
} }
// Update this with w2 if w2 nearer to pt. // Update this with w2 if w2 nearer to pt.
template<class TrackingData>
inline bool Foam::wallNormalInfo::updateFace inline bool Foam::wallNormalInfo::updateFace
( (
const polyMesh&, const polyMesh&,
const label thisFaceI, const label thisFaceI,
const wallNormalInfo& neighbourWallInfo, const wallNormalInfo& neighbourWallInfo,
const scalar tol const scalar tol,
TrackingData& td
) )
{ {
return update(neighbourWallInfo); return update(neighbourWallInfo, td);
}
template <class TrackingData>
inline bool Foam::wallNormalInfo::equal
(
const wallNormalInfo& rhs,
TrackingData& td
) const
{
return operator==(rhs);
} }

View File

@ -2165,6 +2165,9 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement
// refinementLevel data on seed faces // refinementLevel data on seed faces
DynamicList<refinementData> seedFacesInfo(mesh_.nFaces()/100); DynamicList<refinementData> seedFacesInfo(mesh_.nFaces()/100);
// Dummy additional info for FaceCellWave
int dummyTrackData = 0;
// Additional buffer layer thickness by changing initial count. Usually // Additional buffer layer thickness by changing initial count. Usually
// this happens on boundary faces. Bit tricky. Use allFaceInfo to mark // this happens on boundary faces. Bit tricky. Use allFaceInfo to mark
@ -2173,7 +2176,7 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement
{ {
label faceI = facesToCheck[i]; label faceI = facesToCheck[i];
if (allFaceInfo[faceI].valid()) if (allFaceInfo[faceI].valid(dummyTrackData))
{ {
// Can only occur if face has already gone through loop below. // Can only occur if face has already gone through loop below.
FatalErrorIn FatalErrorIn
@ -2247,7 +2250,7 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement
forAll(faceNeighbour, faceI) forAll(faceNeighbour, faceI)
{ {
// Check if face already handled in loop above // Check if face already handled in loop above
if (!allFaceInfo[faceI].valid()) if (!allFaceInfo[faceI].valid(dummyTrackData))
{ {
label own = faceOwner[faceI]; label own = faceOwner[faceI];
label nei = faceNeighbour[faceI]; label nei = faceNeighbour[faceI];
@ -2262,7 +2265,8 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement
faceI, faceI,
own, own,
allCellInfo[own], allCellInfo[own],
FaceCellWave<refinementData>::propagationTol() FaceCellWave<refinementData, int>::propagationTol(),
dummyTrackData
); );
seedFaces.append(faceI); seedFaces.append(faceI);
seedFacesInfo.append(allFaceInfo[faceI]); seedFacesInfo.append(allFaceInfo[faceI]);
@ -2275,7 +2279,8 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement
faceI, faceI,
nei, nei,
allCellInfo[nei], allCellInfo[nei],
FaceCellWave<refinementData>::propagationTol() FaceCellWave<refinementData, int>::propagationTol(),
dummyTrackData
); );
seedFaces.append(faceI); seedFaces.append(faceI);
seedFacesInfo.append(allFaceInfo[faceI]); seedFacesInfo.append(allFaceInfo[faceI]);
@ -2289,7 +2294,7 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement
for (label faceI = mesh_.nInternalFaces(); faceI < mesh_.nFaces(); faceI++) for (label faceI = mesh_.nInternalFaces(); faceI < mesh_.nFaces(); faceI++)
{ {
// Check if face already handled in loop above // Check if face already handled in loop above
if (!allFaceInfo[faceI].valid()) if (!allFaceInfo[faceI].valid(dummyTrackData))
{ {
label own = faceOwner[faceI]; label own = faceOwner[faceI];
@ -2301,7 +2306,8 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement
faceI, faceI,
own, own,
allCellInfo[own], allCellInfo[own],
FaceCellWave<refinementData>::propagationTol() FaceCellWave<refinementData, int>::propagationTol(),
dummyTrackData
); );
seedFaces.append(faceI); seedFaces.append(faceI);
seedFacesInfo.append(faceData); seedFacesInfo.append(faceData);
@ -2310,11 +2316,12 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement
// face-cell-face transport engine // face-cell-face transport engine
FaceCellWave<refinementData> levelCalc FaceCellWave<refinementData, int> levelCalc
( (
mesh_, mesh_,
allFaceInfo, allFaceInfo,
allCellInfo allCellInfo,
dummyTrackData
); );
while (true) while (true)
@ -2418,7 +2425,8 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement
faceI, faceI,
cellI, cellI,
cellInfo, cellInfo,
FaceCellWave<refinementData>::propagationTol() FaceCellWave<refinementData, int>::propagationTol(),
dummyTrackData
); );
if (faceData.count() > allFaceInfo[faceI].count()) if (faceData.count() > allFaceInfo[faceI].count())
@ -2627,6 +2635,9 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement2
// Initial information about (distance to) cellLevel on all faces // Initial information about (distance to) cellLevel on all faces
List<refinementDistanceData> allFaceInfo(mesh_.nFaces()); List<refinementDistanceData> allFaceInfo(mesh_.nFaces());
// Dummy additional info for FaceCellWave
int dummyTrackData = 0;
// Mark cells with wanted refinement level // Mark cells with wanted refinement level
forAll(cellsToRefine, i) forAll(cellsToRefine, i)
@ -2643,7 +2654,7 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement2
// Mark all others with existing refinement level // Mark all others with existing refinement level
forAll(allCellInfo, cellI) forAll(allCellInfo, cellI)
{ {
if (!allCellInfo[cellI].valid()) if (!allCellInfo[cellI].valid(dummyTrackData))
{ {
allCellInfo[cellI] = refinementDistanceData allCellInfo[cellI] = refinementDistanceData
( (
@ -2660,14 +2671,13 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement2
// refinementLevel data on seed faces // refinementLevel data on seed faces
DynamicList<refinementDistanceData> seedFacesInfo(mesh_.nFaces()/100); DynamicList<refinementDistanceData> seedFacesInfo(mesh_.nFaces()/100);
const pointField& cc = mesh_.cellCentres(); const pointField& cc = mesh_.cellCentres();
forAll(facesToCheck, i) forAll(facesToCheck, i)
{ {
label faceI = facesToCheck[i]; label faceI = facesToCheck[i];
if (allFaceInfo[faceI].valid()) if (allFaceInfo[faceI].valid(dummyTrackData))
{ {
// Can only occur if face has already gone through loop below. // Can only occur if face has already gone through loop below.
FatalErrorIn FatalErrorIn
@ -2685,7 +2695,7 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement2
label ownLevel = label ownLevel =
( (
allCellInfo[own].valid() allCellInfo[own].valid(dummyTrackData)
? allCellInfo[own].originLevel() ? allCellInfo[own].originLevel()
: cellLevel_[own] : cellLevel_[own]
); );
@ -2709,7 +2719,8 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement2
faceI, faceI,
own, // not used (should be nei) own, // not used (should be nei)
neiData, neiData,
FaceCellWave<refinementDistanceData>::propagationTol() FaceCellWave<refinementDistanceData, int>::propagationTol(),
dummyTrackData
); );
} }
else else
@ -2718,7 +2729,7 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement2
label neiLevel = label neiLevel =
( (
allCellInfo[nei].valid() allCellInfo[nei].valid(dummyTrackData)
? allCellInfo[nei].originLevel() ? allCellInfo[nei].originLevel()
: cellLevel_[nei] : cellLevel_[nei]
); );
@ -2732,7 +2743,8 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement2
faceI, faceI,
nei, nei,
refinementDistanceData(level0Size, cc[nei], neiLevel+1), refinementDistanceData(level0Size, cc[nei], neiLevel+1),
FaceCellWave<refinementDistanceData>::propagationTol() FaceCellWave<refinementDistanceData, int>::propagationTol(),
dummyTrackData
); );
allFaceInfo[faceI].updateFace allFaceInfo[faceI].updateFace
( (
@ -2740,7 +2752,8 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement2
faceI, faceI,
own, own,
refinementDistanceData(level0Size, cc[own], ownLevel+1), refinementDistanceData(level0Size, cc[own], ownLevel+1),
FaceCellWave<refinementDistanceData>::propagationTol() FaceCellWave<refinementDistanceData, int>::propagationTol(),
dummyTrackData
); );
} }
else else
@ -2752,7 +2765,8 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement2
faceI, faceI,
nei, nei,
refinementDistanceData(level0Size, cc[nei], neiLevel), refinementDistanceData(level0Size, cc[nei], neiLevel),
FaceCellWave<refinementDistanceData>::propagationTol() FaceCellWave<refinementDistanceData, int>::propagationTol(),
dummyTrackData
); );
allFaceInfo[faceI].updateFace allFaceInfo[faceI].updateFace
( (
@ -2760,7 +2774,8 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement2
faceI, faceI,
own, own,
refinementDistanceData(level0Size, cc[own], ownLevel), refinementDistanceData(level0Size, cc[own], ownLevel),
FaceCellWave<refinementDistanceData>::propagationTol() FaceCellWave<refinementDistanceData, int>::propagationTol(),
dummyTrackData
); );
} }
} }
@ -2775,13 +2790,13 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement2
forAll(faceNeighbour, faceI) forAll(faceNeighbour, faceI)
{ {
// Check if face already handled in loop above // Check if face already handled in loop above
if (!allFaceInfo[faceI].valid()) if (!allFaceInfo[faceI].valid(dummyTrackData))
{ {
label own = faceOwner[faceI]; label own = faceOwner[faceI];
label ownLevel = label ownLevel =
( (
allCellInfo[own].valid() allCellInfo[own].valid(dummyTrackData)
? allCellInfo[own].originLevel() ? allCellInfo[own].originLevel()
: cellLevel_[own] : cellLevel_[own]
); );
@ -2790,7 +2805,7 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement2
label neiLevel = label neiLevel =
( (
allCellInfo[nei].valid() allCellInfo[nei].valid(dummyTrackData)
? allCellInfo[nei].originLevel() ? allCellInfo[nei].originLevel()
: cellLevel_[nei] : cellLevel_[nei]
); );
@ -2805,7 +2820,8 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement2
faceI, faceI,
own, own,
refinementDistanceData(level0Size, cc[own], ownLevel), refinementDistanceData(level0Size, cc[own], ownLevel),
FaceCellWave<refinementDistanceData>::propagationTol() FaceCellWave<refinementDistanceData, int>::propagationTol(),
dummyTrackData
); );
seedFacesInfo.append(allFaceInfo[faceI]); seedFacesInfo.append(allFaceInfo[faceI]);
} }
@ -2818,7 +2834,8 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement2
faceI, faceI,
nei, nei,
refinementDistanceData(level0Size, cc[nei], neiLevel), refinementDistanceData(level0Size, cc[nei], neiLevel),
FaceCellWave<refinementDistanceData>::propagationTol() FaceCellWave<refinementDistanceData, int>::propagationTol(),
dummyTrackData
); );
seedFacesInfo.append(allFaceInfo[faceI]); seedFacesInfo.append(allFaceInfo[faceI]);
} }
@ -2829,14 +2846,15 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement2
seedFacesInfo.shrink(); seedFacesInfo.shrink();
// face-cell-face transport engine // face-cell-face transport engine
FaceCellWave<refinementDistanceData> levelCalc FaceCellWave<refinementDistanceData, int> levelCalc
( (
mesh_, mesh_,
seedFaces, seedFaces,
seedFacesInfo, seedFacesInfo,
allFaceInfo, allFaceInfo,
allCellInfo, allCellInfo,
mesh_.globalData().nTotalCells()+1 mesh_.globalData().nTotalCells()+1,
dummyTrackData
); );

View File

@ -26,7 +26,7 @@ Class
Description Description
Transfers refinement levels such that slow transition between levels is Transfers refinement levels such that slow transition between levels is
maintained. Used in meshWave. maintained. Used in FaceCellWave.
SourceFiles SourceFiles
refinementDataI.H refinementDataI.H
@ -108,71 +108,91 @@ public:
//- Check whether origin has been changed at all or //- Check whether origin has been changed at all or
// still contains original (invalid) value. // still contains original (invalid) value.
inline bool valid() const; template<class TrackingData>
inline bool valid(TrackingData& td) const;
//- Check for identical geometrical data. Used for cyclics checking. //- Check for identical geometrical data. Used for cyclics checking.
template<class TrackingData>
inline bool sameGeometry inline bool sameGeometry
( (
const polyMesh&, const polyMesh&,
const refinementData&, const refinementData&,
const scalar const scalar,
TrackingData& td
) const; ) const;
//- Convert any absolute coordinates into relative to (patch)face //- Convert any absolute coordinates into relative to (patch)face
// centre // centre
template<class TrackingData>
inline void leaveDomain inline void leaveDomain
( (
const polyMesh&, const polyMesh&,
const polyPatch&, const polyPatch&,
const label patchFaceI, const label patchFaceI,
const point& faceCentre const point& faceCentre,
TrackingData& td
); );
//- Reverse of leaveDomain //- Reverse of leaveDomain
template<class TrackingData>
inline void enterDomain inline void enterDomain
( (
const polyMesh&, const polyMesh&,
const polyPatch&, const polyPatch&,
const label patchFaceI, const label patchFaceI,
const point& faceCentre const point& faceCentre,
TrackingData& td
); );
//- Apply rotation matrix to any coordinates //- Apply rotation matrix to any coordinates
template<class TrackingData>
inline void transform inline void transform
( (
const polyMesh&, const polyMesh&,
const tensor& const tensor&,
TrackingData& td
); );
//- Influence of neighbouring face. //- Influence of neighbouring face.
template<class TrackingData>
inline bool updateCell inline bool updateCell
( (
const polyMesh&, const polyMesh&,
const label thisCellI, const label thisCellI,
const label neighbourFaceI, const label neighbourFaceI,
const refinementData& neighbourInfo, const refinementData& neighbourInfo,
const scalar tol const scalar tol,
TrackingData& td
); );
//- Influence of neighbouring cell. //- Influence of neighbouring cell.
template<class TrackingData>
inline bool updateFace inline bool updateFace
( (
const polyMesh&, const polyMesh&,
const label thisFaceI, const label thisFaceI,
const label neighbourCellI, const label neighbourCellI,
const refinementData& neighbourInfo, const refinementData& neighbourInfo,
const scalar tol const scalar tol,
TrackingData& td
); );
//- Influence of different value on same face. //- Influence of different value on same face.
template<class TrackingData>
inline bool updateFace inline bool updateFace
( (
const polyMesh&, const polyMesh&,
const label thisFaceI, const label thisFaceI,
const refinementData& neighbourInfo, const refinementData& neighbourInfo,
const scalar tol const scalar tol,
TrackingData& td
); );
//- Same (like operator==)
template<class TrackingData>
inline bool equal(const refinementData&, TrackingData& td) const;
// Member Operators // Member Operators
// Needed for List IO // Needed for List IO

View File

@ -23,10 +23,6 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Null constructor // Null constructor
@ -51,18 +47,21 @@ inline Foam::refinementData::refinementData
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline bool Foam::refinementData::valid() const template<class TrackingData>
inline bool Foam::refinementData::valid(TrackingData& td) const
{ {
return count_ != -1; return count_ != -1;
} }
// No geometric data so never any problem on cyclics // No geometric data so never any problem on cyclics
template<class TrackingData>
inline bool Foam::refinementData::sameGeometry inline bool Foam::refinementData::sameGeometry
( (
const polyMesh&, const polyMesh&,
const refinementData&, const refinementData&,
const scalar const scalar,
TrackingData& td
) const ) const
{ {
return true; return true;
@ -70,47 +69,55 @@ inline bool Foam::refinementData::sameGeometry
// No geometric data. // No geometric data.
template<class TrackingData>
inline void Foam::refinementData::leaveDomain inline void Foam::refinementData::leaveDomain
( (
const polyMesh&, const polyMesh&,
const polyPatch& patch, const polyPatch& patch,
const label patchFaceI, const label patchFaceI,
const point& faceCentre const point& faceCentre,
TrackingData& td
) )
{} {}
// No geometric data. // No geometric data.
template<class TrackingData>
inline void Foam::refinementData::transform inline void Foam::refinementData::transform
( (
const polyMesh&, const polyMesh&,
const tensor& rotTensor const tensor& rotTensor,
TrackingData& td
) )
{} {}
// No geometric data. // No geometric data.
template<class TrackingData>
inline void Foam::refinementData::enterDomain inline void Foam::refinementData::enterDomain
( (
const polyMesh&, const polyMesh&,
const polyPatch& patch, const polyPatch& patch,
const label patchFaceI, const label patchFaceI,
const point& faceCentre const point& faceCentre,
TrackingData& td
) )
{} {}
// Update cell with neighbouring face information // Update cell with neighbouring face information
template<class TrackingData>
inline bool Foam::refinementData::updateCell inline bool Foam::refinementData::updateCell
( (
const polyMesh&, const polyMesh&,
const label thisCellI, const label thisCellI,
const label neighbourFaceI, const label neighbourFaceI,
const refinementData& neighbourInfo, const refinementData& neighbourInfo,
const scalar tol const scalar tol,
TrackingData& td
) )
{ {
if (!valid()) if (!valid(td))
{ {
FatalErrorIn("refinementData::updateCell") << "problem" FatalErrorIn("refinementData::updateCell") << "problem"
<< abort(FatalError); << abort(FatalError);
@ -161,17 +168,19 @@ inline bool Foam::refinementData::updateCell
// Update face with neighbouring cell information // Update face with neighbouring cell information
template<class TrackingData>
inline bool Foam::refinementData::updateFace inline bool Foam::refinementData::updateFace
( (
const polyMesh&, const polyMesh&,
const label thisFaceI, const label thisFaceI,
const label neighbourCellI, const label neighbourCellI,
const refinementData& neighbourInfo, const refinementData& neighbourInfo,
const scalar tol const scalar tol,
TrackingData& td
) )
{ {
// From cell to its faces. // From cell to its faces.
if (!valid()) if (!valid(td))
{ {
refinementCount_ = neighbourInfo.refinementCount(); refinementCount_ = neighbourInfo.refinementCount();
count_ = neighbourInfo.count(); count_ = neighbourInfo.count();
@ -194,16 +203,18 @@ inline bool Foam::refinementData::updateFace
// Update face with coupled face information // Update face with coupled face information
template<class TrackingData>
inline bool Foam::refinementData::updateFace inline bool Foam::refinementData::updateFace
( (
const polyMesh&, const polyMesh&,
const label thisFaceI, const label thisFaceI,
const refinementData& neighbourInfo, const refinementData& neighbourInfo,
const scalar tol const scalar tol,
TrackingData& td
) )
{ {
// From face to face (e.g. coupled faces) // From face to face (e.g. coupled faces)
if (!valid()) if (!valid(td))
{ {
refinementCount_ = neighbourInfo.refinementCount(); refinementCount_ = neighbourInfo.refinementCount();
count_ = neighbourInfo.count(); count_ = neighbourInfo.count();
@ -225,6 +236,17 @@ inline bool Foam::refinementData::updateFace
} }
template <class TrackingData>
inline bool Foam::refinementData::equal
(
const refinementData& rhs,
TrackingData& td
) const
{
return operator==(rhs);
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
inline bool Foam::refinementData::operator==(const Foam::refinementData& rhs) inline bool Foam::refinementData::operator==(const Foam::refinementData& rhs)

View File

@ -68,11 +68,13 @@ class refinementDistanceData
// Private Member Functions // Private Member Functions
//- Updates with neighbouring data. Returns true if something changed. //- Updates with neighbouring data. Returns true if something changed.
template<class TrackingData>
inline bool update inline bool update
( (
const point&, const point&,
const refinementDistanceData& neighbourInfo, const refinementDistanceData& neighbourInfo,
const scalar tol const scalar tol,
TrackingData&
); );
public: public:
@ -137,71 +139,94 @@ public:
//- Check whether origin has been changed at all or //- Check whether origin has been changed at all or
// still contains original (invalid) value. // still contains original (invalid) value.
inline bool valid() const; template<class TrackingData>
inline bool valid(TrackingData&) const;
//- Check for identical geometrical data. Used for cyclics checking. //- Check for identical geometrical data. Used for cyclics checking.
template<class TrackingData>
inline bool sameGeometry inline bool sameGeometry
( (
const polyMesh&, const polyMesh&,
const refinementDistanceData&, const refinementDistanceData&,
const scalar const scalar,
TrackingData&
) const; ) const;
//- Convert any absolute coordinates into relative to (patch)face //- Convert any absolute coordinates into relative to (patch)face
// centre // centre
template<class TrackingData>
inline void leaveDomain inline void leaveDomain
( (
const polyMesh&, const polyMesh&,
const polyPatch&, const polyPatch&,
const label patchFaceI, const label patchFaceI,
const point& faceCentre const point& faceCentre,
TrackingData&
); );
//- Reverse of leaveDomain //- Reverse of leaveDomain
template<class TrackingData>
inline void enterDomain inline void enterDomain
( (
const polyMesh&, const polyMesh&,
const polyPatch&, const polyPatch&,
const label patchFaceI, const label patchFaceI,
const point& faceCentre const point& faceCentre,
TrackingData&
); );
//- Apply rotation matrix to any coordinates //- Apply rotation matrix to any coordinates
template<class TrackingData>
inline void transform inline void transform
( (
const polyMesh&, const polyMesh&,
const tensor& const tensor&,
TrackingData&
); );
//- Influence of neighbouring face. //- Influence of neighbouring face.
template<class TrackingData>
inline bool updateCell inline bool updateCell
( (
const polyMesh&, const polyMesh&,
const label thisCellI, const label thisCellI,
const label neighbourFaceI, const label neighbourFaceI,
const refinementDistanceData& neighbourInfo, const refinementDistanceData& neighbourInfo,
const scalar tol const scalar tol,
TrackingData&
); );
//- Influence of neighbouring cell. //- Influence of neighbouring cell.
template<class TrackingData>
inline bool updateFace inline bool updateFace
( (
const polyMesh&, const polyMesh&,
const label thisFaceI, const label thisFaceI,
const label neighbourCellI, const label neighbourCellI,
const refinementDistanceData& neighbourInfo, const refinementDistanceData& neighbourInfo,
const scalar tol const scalar tol,
TrackingData&
); );
//- Influence of different value on same face. //- Influence of different value on same face.
template<class TrackingData>
inline bool updateFace inline bool updateFace
( (
const polyMesh&, const polyMesh&,
const label thisFaceI, const label thisFaceI,
const refinementDistanceData& neighbourInfo, const refinementDistanceData& neighbourInfo,
const scalar tol const scalar tol,
TrackingData&
); );
//- Same (like operator==)
template<class TrackingData>
inline bool equal
(
const refinementDistanceData&,
TrackingData&
) const;
// Member Operators // Member Operators
// Needed for List IO // Needed for List IO

View File

@ -57,16 +57,18 @@ inline Foam::label Foam::refinementDistanceData::wantedLevel(const point& pt)
} }
template<class TrackingData>
inline bool Foam::refinementDistanceData::update inline bool Foam::refinementDistanceData::update
( (
const point& pos, const point& pos,
const refinementDistanceData& neighbourInfo, const refinementDistanceData& neighbourInfo,
const scalar tol const scalar tol,
TrackingData& td
) )
{ {
if (!valid()) if (!valid(td))
{ {
if (!neighbourInfo.valid()) if (!neighbourInfo.valid(td))
{ {
FatalErrorIn("refinementDistanceData::update(..)") FatalErrorIn("refinementDistanceData::update(..)")
<< "problem" << abort(FatalError); << "problem" << abort(FatalError);
@ -142,40 +144,47 @@ inline Foam::refinementDistanceData::refinementDistanceData
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline bool Foam::refinementDistanceData::valid() const template<class TrackingData>
inline bool Foam::refinementDistanceData::valid(TrackingData& td) const
{ {
return level0Size_ != -1; return level0Size_ != -1;
} }
// No geometric data so never any problem on cyclics // No geometric data so never any problem on cyclics
template<class TrackingData>
inline bool Foam::refinementDistanceData::sameGeometry inline bool Foam::refinementDistanceData::sameGeometry
( (
const polyMesh&, const polyMesh&,
const refinementDistanceData&, const refinementDistanceData&,
const scalar const scalar,
TrackingData& td
) const ) const
{ {
return true; return true;
} }
template<class TrackingData>
inline void Foam::refinementDistanceData::leaveDomain inline void Foam::refinementDistanceData::leaveDomain
( (
const polyMesh&, const polyMesh&,
const polyPatch& patch, const polyPatch& patch,
const label patchFaceI, const label patchFaceI,
const point& faceCentre const point& faceCentre,
TrackingData& td
) )
{ {
origin_ -= faceCentre; origin_ -= faceCentre;
} }
template<class TrackingData>
inline void Foam::refinementDistanceData::transform inline void Foam::refinementDistanceData::transform
( (
const polyMesh&, const polyMesh&,
const tensor& rotTensor const tensor& rotTensor,
TrackingData& td
) )
{ {
origin_ = Foam::transform(rotTensor, origin_); origin_ = Foam::transform(rotTensor, origin_);
@ -183,12 +192,14 @@ inline void Foam::refinementDistanceData::transform
// Update absolute geometric quantities. // Update absolute geometric quantities.
template<class TrackingData>
inline void Foam::refinementDistanceData::enterDomain inline void Foam::refinementDistanceData::enterDomain
( (
const polyMesh&, const polyMesh&,
const polyPatch& patch, const polyPatch& patch,
const label patchFaceI, const label patchFaceI,
const point& faceCentre const point& faceCentre,
TrackingData& td
) )
{ {
// back to absolute form // back to absolute form
@ -197,49 +208,80 @@ inline void Foam::refinementDistanceData::enterDomain
// Update cell with neighbouring face information // Update cell with neighbouring face information
template<class TrackingData>
inline bool Foam::refinementDistanceData::updateCell inline bool Foam::refinementDistanceData::updateCell
( (
const polyMesh& mesh, const polyMesh& mesh,
const label thisCellI, const label thisCellI,
const label neighbourFaceI, const label neighbourFaceI,
const refinementDistanceData& neighbourInfo, const refinementDistanceData& neighbourInfo,
const scalar tol const scalar tol,
TrackingData& td
) )
{ {
const point& pos = mesh.cellCentres()[thisCellI]; const point& pos = mesh.cellCentres()[thisCellI];
return update(pos, neighbourInfo, tol); return update(pos, neighbourInfo, tol, td);
} }
// Update face with neighbouring cell information // Update face with neighbouring cell information
template<class TrackingData>
inline bool Foam::refinementDistanceData::updateFace inline bool Foam::refinementDistanceData::updateFace
( (
const polyMesh& mesh, const polyMesh& mesh,
const label thisFaceI, const label thisFaceI,
const label neighbourCellI, const label neighbourCellI,
const refinementDistanceData& neighbourInfo, const refinementDistanceData& neighbourInfo,
const scalar tol const scalar tol,
TrackingData& td
) )
{ {
const point& pos = mesh.faceCentres()[thisFaceI]; const point& pos = mesh.faceCentres()[thisFaceI];
return update(pos, neighbourInfo, tol); return update(pos, neighbourInfo, tol, td);
} }
// Update face with coupled face information // Update face with coupled face information
template<class TrackingData>
inline bool Foam::refinementDistanceData::updateFace inline bool Foam::refinementDistanceData::updateFace
( (
const polyMesh& mesh, const polyMesh& mesh,
const label thisFaceI, const label thisFaceI,
const refinementDistanceData& neighbourInfo, const refinementDistanceData& neighbourInfo,
const scalar tol const scalar tol,
TrackingData& td
) )
{ {
const point& pos = mesh.faceCentres()[thisFaceI]; const point& pos = mesh.faceCentres()[thisFaceI];
return update(pos, neighbourInfo, tol); return update(pos, neighbourInfo, tol, td);
}
template <class TrackingData>
inline bool Foam::refinementDistanceData::equal
(
const refinementDistanceData& rhs,
TrackingData& td
) const
{
if (!valid(td))
{
if (!rhs.valid(td))
{
return true;
}
else
{
return false;
}
}
else
{
return operator==(rhs);
}
} }
@ -251,24 +293,10 @@ inline bool Foam::refinementDistanceData::operator==
) )
const const
{ {
if (!valid())
{
if (!rhs.valid())
{
return true;
}
else
{
return false;
}
}
else
{
return return
level0Size_ == rhs.level0Size_ level0Size_ == rhs.level0Size_
&& origin_ == rhs.origin_ && origin_ == rhs.origin_
&& originLevel_ == rhs.originLevel_; && originLevel_ == rhs.originLevel_;
}
} }

View File

@ -117,7 +117,7 @@ bool Foam::fileFormats::STARCDCore::readPoints
// reuse memory if possible // reuse memory if possible
DynamicList<point> dynPoints(points.xferList()); DynamicList<point> dynPoints(points.xfer());
DynamicList<label> dynPointId(ids.xfer()); // STAR-CD index of points DynamicList<label> dynPointId(ids.xfer()); // STAR-CD index of points
dynPoints.clear(); dynPoints.clear();

View File

@ -31,8 +31,6 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam::scalar Foam::smoothData::maxRatio = 1.0;
void Foam::fvc::smooth void Foam::fvc::smooth
( (
volScalarField& field, volScalarField& field,
@ -40,7 +38,7 @@ void Foam::fvc::smooth
) )
{ {
const fvMesh& mesh = field.mesh(); const fvMesh& mesh = field.mesh();
smoothData::maxRatio = 1 + coeff; scalar maxRatio = 1 + coeff;
DynamicList<label> changedFaces(mesh.nFaces()/100 + 100); DynamicList<label> changedFaces(mesh.nFaces()/100 + 100);
DynamicList<smoothData> changedFacesInfo(changedFaces.size()); DynamicList<smoothData> changedFacesInfo(changedFaces.size());
@ -54,12 +52,12 @@ void Foam::fvc::smooth
const label nbr = neighbour[facei]; const label nbr = neighbour[facei];
// Check if owner value much larger than neighbour value or vice versa // Check if owner value much larger than neighbour value or vice versa
if (field[own] > smoothData::maxRatio*field[nbr]) if (field[own] > maxRatio*field[nbr])
{ {
changedFaces.append(facei); changedFaces.append(facei);
changedFacesInfo.append(smoothData(field[own])); changedFacesInfo.append(smoothData(field[own]));
} }
else if (field[nbr] > smoothData::maxRatio*field[own]) else if (field[nbr] > maxRatio*field[own])
{ {
changedFaces.append(facei); changedFaces.append(facei);
changedFacesInfo.append(smoothData(field[nbr])); changedFacesInfo.append(smoothData(field[nbr]));
@ -98,16 +96,19 @@ void Foam::fvc::smooth
// Set initial field on faces // Set initial field on faces
List<smoothData> faceData(mesh.nFaces()); List<smoothData> faceData(mesh.nFaces());
smoothData::trackData td;
td.maxRatio = maxRatio;
// Propagate information over whole domain // Propagate information over whole domain
FaceCellWave<smoothData > smoothData FaceCellWave<smoothData, smoothData::trackData> smoothData
( (
mesh, mesh,
changedFaces, changedFaces,
changedFacesInfo, changedFacesInfo,
faceData, faceData,
cellData, cellData,
mesh.globalData().nTotalCells() // max iterations mesh.globalData().nTotalCells(), // max iterations
td
); );
forAll(field, celli) forAll(field, celli)
@ -130,7 +131,6 @@ void Foam::fvc::spread
) )
{ {
const fvMesh& mesh = field.mesh(); const fvMesh& mesh = field.mesh();
smoothData::maxRatio = 1;
DynamicList<label> changedFaces(mesh.nFaces()/100 + 100); DynamicList<label> changedFaces(mesh.nFaces()/100 + 100);
DynamicList<smoothData> changedFacesInfo(changedFaces.size()); DynamicList<smoothData> changedFacesInfo(changedFaces.size());
@ -208,12 +208,16 @@ void Foam::fvc::spread
changedFaces.shrink(); changedFaces.shrink();
changedFacesInfo.shrink(); changedFacesInfo.shrink();
smoothData::trackData td;
td.maxRatio = 1.0;
// Propagate information over whole domain // Propagate information over whole domain
FaceCellWave<smoothData> smoothData FaceCellWave<smoothData, smoothData::trackData> smoothData
( (
mesh, mesh,
faceData, faceData,
cellData cellData,
td
); );
smoothData.setFaceInfo(changedFaces, changedFacesInfo); smoothData.setFaceInfo(changedFaces, changedFacesInfo);
@ -311,7 +315,7 @@ void Foam::fvc::sweep
forAll(field, celli) forAll(field, celli)
{ {
if (cellData[celli].valid()) if (cellData[celli].valid(sweepData.data()))
{ {
field[celli] = max(field[celli], cellData[celli].value()); field[celli] = max(field[celli], cellData[celli].value());
} }

View File

@ -47,27 +47,39 @@ namespace Foam
class smoothData class smoothData
{ {
public:
//- Class used to pass additional data in
class trackData
{
public:
//- Cut off distance
scalar maxRatio;
};
private:
scalar value_; scalar value_;
// Private Member Functions // Private Member Functions
//- Update - gets information from neighbouring face/cell and //- Update - gets information from neighbouring face/cell and
// uses this to update itself (if necessary) and return true // uses this to update itself (if necessary) and return true
template<class TrackingData>
inline bool update inline bool update
( (
const smoothData& svf, const smoothData& svf,
const scalar scale, const scalar scale,
const scalar tol const scalar tol,
TrackingData& td
); );
public: public:
// Static data members
//- Field fraction
static scalar maxRatio;
// Constructors // Constructors
@ -93,72 +105,91 @@ public:
//- Check whether origin has been changed at all or //- Check whether origin has been changed at all or
// still contains original (invalid) value // still contains original (invalid) value
inline bool valid() const; template<class TrackingData>
inline bool valid(TrackingData& td) const;
//- Check for identical geometrical data //- Check for identical geometrical data
// Used for cyclics checking // Used for cyclics checking
template<class TrackingData>
inline bool sameGeometry inline bool sameGeometry
( (
const polyMesh&, const polyMesh&,
const smoothData&, const smoothData&,
const scalar const scalar,
TrackingData& td
) const; ) const;
//- Convert any absolute coordinates into relative to //- Convert any absolute coordinates into relative to
// (patch)face centre // (patch)face centre
template<class TrackingData>
inline void leaveDomain inline void leaveDomain
( (
const polyMesh&, const polyMesh&,
const polyPatch&, const polyPatch&,
const label patchFaceI, const label patchFaceI,
const point& faceCentre const point& faceCentre,
TrackingData& td
); );
//- Reverse of leaveDomain //- Reverse of leaveDomain
template<class TrackingData>
inline void enterDomain inline void enterDomain
( (
const polyMesh&, const polyMesh&,
const polyPatch&, const polyPatch&,
const label patchFaceI, const label patchFaceI,
const point& faceCentre const point& faceCentre,
TrackingData& td
); );
//- Apply rotation matrix to any coordinates //- Apply rotation matrix to any coordinates
template<class TrackingData>
inline void transform inline void transform
( (
const polyMesh&, const polyMesh&,
const tensor& const tensor&,
TrackingData& td
); );
//- Influence of neighbouring face //- Influence of neighbouring face
template<class TrackingData>
inline bool updateCell inline bool updateCell
( (
const polyMesh&, const polyMesh&,
const label thisCellI, const label thisCellI,
const label neighbourFaceI, const label neighbourFaceI,
const smoothData& svf, const smoothData& svf,
const scalar tol const scalar tol,
TrackingData& td
); );
//- Influence of neighbouring cell //- Influence of neighbouring cell
template<class TrackingData>
inline bool updateFace inline bool updateFace
( (
const polyMesh&, const polyMesh&,
const label thisFaceI, const label thisFaceI,
const label neighbourCellI, const label neighbourCellI,
const smoothData& svf, const smoothData& svf,
const scalar tol const scalar tol,
TrackingData& td
); );
//- Influence of different value on same face //- Influence of different value on same face
template<class TrackingData>
inline bool updateFace inline bool updateFace
( (
const polyMesh&, const polyMesh&,
const label thisFaceI, const label thisFaceI,
const smoothData& svf, const smoothData& svf,
const scalar tol const scalar tol,
TrackingData& td
); );
//- Same (like operator==)
template<class TrackingData>
inline bool equal(const smoothData&, TrackingData& td) const;
// Member Operators // Member Operators

View File

@ -25,14 +25,16 @@ License
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class TrackingData>
inline bool Foam::smoothData::update inline bool Foam::smoothData::update
( (
const smoothData& svf, const smoothData& svf,
const scalar scale, const scalar scale,
const scalar tol const scalar tol,
TrackingData& td
) )
{ {
if (!valid() || (value_ < VSMALL)) if (!valid(td) || (value_ < VSMALL))
{ {
// My value not set - take over neighbour // My value not set - take over neighbour
value_ = svf.value()/scale; value_ = svf.value()/scale;
@ -73,90 +75,116 @@ inline Foam::smoothData::smoothData(const scalar value)
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline bool Foam::smoothData::valid() const template<class TrackingData>
inline bool Foam::smoothData::valid(TrackingData& td) const
{ {
return value_ > -SMALL; return value_ > -SMALL;
} }
template<class TrackingData>
inline bool Foam::smoothData::sameGeometry inline bool Foam::smoothData::sameGeometry
( (
const polyMesh&, const polyMesh&,
const smoothData&, const smoothData&,
const scalar const scalar,
TrackingData& td
) const ) const
{ {
return true; return true;
} }
template<class TrackingData>
inline void Foam::smoothData::leaveDomain inline void Foam::smoothData::leaveDomain
( (
const polyMesh&, const polyMesh&,
const polyPatch&, const polyPatch&,
const label, const label,
const point& const point&,
TrackingData& td
) )
{} {}
template<class TrackingData>
inline void Foam::smoothData::transform inline void Foam::smoothData::transform
( (
const polyMesh&, const polyMesh&,
const tensor& const tensor&,
TrackingData& td
) )
{} {}
template<class TrackingData>
inline void Foam::smoothData::enterDomain inline void Foam::smoothData::enterDomain
( (
const polyMesh&, const polyMesh&,
const polyPatch&, const polyPatch&,
const label, const label,
const point& const point&,
TrackingData& td
) )
{} {}
template<class TrackingData>
inline bool Foam::smoothData::updateCell inline bool Foam::smoothData::updateCell
( (
const polyMesh&, const polyMesh&,
const label, const label,
const label, const label,
const smoothData& svf, const smoothData& svf,
const scalar tol const scalar tol,
TrackingData& td
) )
{ {
// Take over info from face if more than deltaRatio larger // Take over info from face if more than deltaRatio larger
return update(svf, maxRatio, tol); return update(svf, td.maxRatio, tol, td);
} }
template<class TrackingData>
inline bool Foam::smoothData::updateFace inline bool Foam::smoothData::updateFace
( (
const polyMesh&, const polyMesh&,
const label, const label,
const label, const label,
const smoothData& svf, const smoothData& svf,
const scalar tol const scalar tol,
TrackingData& td
) )
{ {
// Take over information from cell without any scaling (scale = 1.0) // Take over information from cell without any scaling (scale = 1.0)
return update(svf, 1.0, tol); return update(svf, 1.0, tol, td);
} }
// Update this (face) with coupled face information. // Update this (face) with coupled face information.
template<class TrackingData>
inline bool Foam::smoothData::updateFace inline bool Foam::smoothData::updateFace
( (
const polyMesh&, const polyMesh&,
const label, const label,
const smoothData& svf, const smoothData& svf,
const scalar tol const scalar tol,
TrackingData& td
) )
{ {
// Take over information from coupled face without any scaling (scale = 1.0) // Take over information from coupled face without any scaling (scale = 1.0)
return update(svf, 1.0, tol); return update(svf, 1.0, tol, td);
}
template <class TrackingData>
inline bool Foam::smoothData::equal
(
const smoothData& rhs,
TrackingData& td
) const
{
return operator==(rhs);
} }

View File

@ -54,11 +54,13 @@ class sweepData
//- Update - gets information from neighbouring face/cell and //- Update - gets information from neighbouring face/cell and
// uses this to update itself (if necessary) and return true // uses this to update itself (if necessary) and return true
template<class TrackingData>
inline bool update inline bool update
( (
const sweepData& svf, const sweepData& svf,
const point& position, const point& position,
const scalar tol const scalar tol,
TrackingData& td
); );
@ -94,72 +96,91 @@ public:
//- Check whether origin has been changed at all or //- Check whether origin has been changed at all or
// still contains original (invalid) value // still contains original (invalid) value
inline bool valid() const; template<class TrackingData>
inline bool valid(TrackingData& td) const;
//- Check for identical geometrical data //- Check for identical geometrical data
// Used for cyclics checking // Used for cyclics checking
template<class TrackingData>
inline bool sameGeometry inline bool sameGeometry
( (
const polyMesh&, const polyMesh&,
const sweepData&, const sweepData&,
const scalar const scalar,
TrackingData& td
) const; ) const;
//- Convert any absolute coordinates into relative to //- Convert any absolute coordinates into relative to
// (patch)face centre // (patch)face centre
template<class TrackingData>
inline void leaveDomain inline void leaveDomain
( (
const polyMesh&, const polyMesh&,
const polyPatch&, const polyPatch&,
const label patchFaceI, const label patchFaceI,
const point& faceCentre const point& faceCentre,
TrackingData& td
); );
//- Reverse of leaveDomain //- Reverse of leaveDomain
template<class TrackingData>
inline void enterDomain inline void enterDomain
( (
const polyMesh&, const polyMesh&,
const polyPatch&, const polyPatch&,
const label patchFaceI, const label patchFaceI,
const point& faceCentre const point& faceCentre,
TrackingData& td
); );
//- Apply rotation matrix to any coordinates //- Apply rotation matrix to any coordinates
template<class TrackingData>
inline void transform inline void transform
( (
const polyMesh&, const polyMesh&,
const tensor& const tensor&,
TrackingData& td
); );
//- Influence of neighbouring face //- Influence of neighbouring face
template<class TrackingData>
inline bool updateCell inline bool updateCell
( (
const polyMesh&, const polyMesh&,
const label thisCellI, const label thisCellI,
const label neighbourFaceI, const label neighbourFaceI,
const sweepData& svf, const sweepData& svf,
const scalar tol const scalar tol,
TrackingData& td
); );
//- Influence of neighbouring cell //- Influence of neighbouring cell
template<class TrackingData>
inline bool updateFace inline bool updateFace
( (
const polyMesh&, const polyMesh&,
const label thisFaceI, const label thisFaceI,
const label neighbourCellI, const label neighbourCellI,
const sweepData& svf, const sweepData& svf,
const scalar tol const scalar tol,
TrackingData& td
); );
//- Influence of different value on same face //- Influence of different value on same face
template<class TrackingData>
inline bool updateFace inline bool updateFace
( (
const polyMesh&, const polyMesh&,
const label thisFaceI, const label thisFaceI,
const sweepData& svf, const sweepData& svf,
const scalar tol const scalar tol,
TrackingData& td
); );
//- Same (like operator==)
template<class TrackingData>
inline bool equal(const sweepData&, TrackingData& td) const;
// Member Operators // Member Operators

View File

@ -27,14 +27,16 @@ License
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class TrackingData>
inline bool Foam::sweepData::update inline bool Foam::sweepData::update
( (
const sweepData& svf, const sweepData& svf,
const point& position, const point& position,
const scalar tol const scalar tol,
TrackingData& td
) )
{ {
if (!valid()) if (!valid(td))
{ {
operator=(svf); operator=(svf);
return true; return true;
@ -85,51 +87,60 @@ inline Foam::sweepData::sweepData(const scalar value, const point& origin)
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline bool Foam::sweepData::valid() const template<class TrackingData>
inline bool Foam::sweepData::valid(TrackingData& td) const
{ {
return value_ > -SMALL; return value_ > -SMALL;
} }
template<class TrackingData>
inline bool Foam::sweepData::sameGeometry inline bool Foam::sweepData::sameGeometry
( (
const polyMesh&, const polyMesh&,
const sweepData&, const sweepData&,
const scalar const scalar,
TrackingData& td
) const ) const
{ {
return true; return true;
} }
template<class TrackingData>
inline void Foam::sweepData::leaveDomain inline void Foam::sweepData::leaveDomain
( (
const polyMesh&, const polyMesh&,
const polyPatch&, const polyPatch&,
const label, const label,
const point& faceCentre const point& faceCentre,
TrackingData& td
) )
{ {
origin_ -= faceCentre; origin_ -= faceCentre;
} }
template<class TrackingData>
inline void Foam::sweepData::transform inline void Foam::sweepData::transform
( (
const polyMesh&, const polyMesh&,
const tensor& rotTensor const tensor& rotTensor,
TrackingData& td
) )
{ {
origin_ = Foam::transform(rotTensor, origin_); origin_ = Foam::transform(rotTensor, origin_);
} }
template<class TrackingData>
inline void Foam::sweepData::enterDomain inline void Foam::sweepData::enterDomain
( (
const polyMesh&, const polyMesh&,
const polyPatch&, const polyPatch&,
const label, const label,
const point& faceCentre const point& faceCentre,
TrackingData& td
) )
{ {
// back to absolute form // back to absolute form
@ -137,42 +148,59 @@ inline void Foam::sweepData::enterDomain
} }
template<class TrackingData>
inline bool Foam::sweepData::updateCell inline bool Foam::sweepData::updateCell
( (
const polyMesh& mesh, const polyMesh& mesh,
const label thisCellI, const label thisCellI,
const label, const label,
const sweepData& svf, const sweepData& svf,
const scalar tol const scalar tol,
TrackingData& td
) )
{ {
return update(svf, mesh.cellCentres()[thisCellI], tol); return update(svf, mesh.cellCentres()[thisCellI], tol, td);
} }
template<class TrackingData>
inline bool Foam::sweepData::updateFace inline bool Foam::sweepData::updateFace
( (
const polyMesh& mesh, const polyMesh& mesh,
const label thisFaceI, const label thisFaceI,
const label, const label,
const sweepData& svf, const sweepData& svf,
const scalar tol const scalar tol,
TrackingData& td
) )
{ {
return update(svf, mesh.faceCentres()[thisFaceI], tol); return update(svf, mesh.faceCentres()[thisFaceI], tol, td);
} }
// Update this (face) with coupled face information. // Update this (face) with coupled face information.
template<class TrackingData>
inline bool Foam::sweepData::updateFace inline bool Foam::sweepData::updateFace
( (
const polyMesh& mesh, const polyMesh& mesh,
const label thisFaceI, const label thisFaceI,
const sweepData& svf, const sweepData& svf,
const scalar tol const scalar tol,
TrackingData& td
) )
{ {
return update(svf, mesh.faceCentres()[thisFaceI], tol); return update(svf, mesh.faceCentres()[thisFaceI], tol, td);
}
template <class TrackingData>
inline bool Foam::sweepData::equal
(
const sweepData& rhs,
TrackingData& td
) const
{
return operator==(rhs);
} }

View File

@ -32,6 +32,9 @@ Description
the damping function becomes 1, since y gets initialized to GREAT and the damping function becomes 1, since y gets initialized to GREAT and
yStar to 1. yStar to 1.
Note: should feed the additional argument (yPlusCutoff) through as a
template argument into FaceCellWave
SourceFiles SourceFiles
wallPointYPlusI.H wallPointYPlusI.H
wallPointYPlus.C wallPointYPlus.C
@ -58,16 +61,20 @@ class wallPointYPlus
public wallPointData<scalar> public wallPointData<scalar>
{ {
private:
// Private Member Functions // Private Member Functions
//- Evaluate distance to point. Update distSqr, origin from whomever //- Evaluate distance to point. Update distSqr, origin from whomever
// is nearer pt. Return true if w2 is closer to point, // is nearer pt. Return true if w2 is closer to point,
// false otherwise. // false otherwise.
template<class TrackingData>
inline bool update inline bool update
( (
const point&, const point&,
const wallPointYPlus& w2, const wallPointYPlus& w2,
const scalar tol const scalar tol,
TrackingData& td
); );
public: public:
@ -94,39 +101,45 @@ public:
// Member Functions // Member Functions
// Needed by meshWave // Needed by FaceCellWave
//- Influence of neighbouring face. //- Influence of neighbouring face.
// Calls update(...) with cellCentre of cellI // Calls update(...) with cellCentre of cellI
template<class TrackingData>
inline bool updateCell inline bool updateCell
( (
const polyMesh& mesh, const polyMesh& mesh,
const label thisCellI, const label thisCellI,
const label neighbourFaceI, const label neighbourFaceI,
const wallPointYPlus& neighbourWallInfo, const wallPointYPlus& neighbourWallInfo,
const scalar tol const scalar tol,
TrackingData& td
); );
//- Influence of neighbouring cell. //- Influence of neighbouring cell.
// Calls update(...) with faceCentre of faceI // Calls update(...) with faceCentre of faceI
template<class TrackingData>
inline bool updateFace inline bool updateFace
( (
const polyMesh& mesh, const polyMesh& mesh,
const label thisFaceI, const label thisFaceI,
const label neighbourCellI, const label neighbourCellI,
const wallPointYPlus& neighbourWallInfo, const wallPointYPlus& neighbourWallInfo,
const scalar tol const scalar tol,
TrackingData& td
); );
//- Influence of different value on same face. //- Influence of different value on same face.
// Merge new and old info. // Merge new and old info.
// Calls update(...) with faceCentre of faceI // Calls update(...) with faceCentre of faceI
template<class TrackingData>
inline bool updateFace inline bool updateFace
( (
const polyMesh& mesh, const polyMesh& mesh,
const label thisFaceI, const label thisFaceI,
const wallPointYPlus& neighbourWallInfo, const wallPointYPlus& neighbourWallInfo,
const scalar tol const scalar tol,
TrackingData& td
); );
}; };

View File

@ -31,11 +31,13 @@ namespace Foam
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// Update this with w2 if w2 nearer to pt. // Update this with w2 if w2 nearer to pt.
template<class TrackingData>
inline bool wallPointYPlus::update inline bool wallPointYPlus::update
( (
const point& pt, const point& pt,
const wallPointYPlus& w2, const wallPointYPlus& w2,
const scalar tol const scalar tol,
TrackingData& td
) )
{ {
scalar dist2 = magSqr(pt - w2.origin()); scalar dist2 = magSqr(pt - w2.origin());
@ -103,13 +105,15 @@ inline wallPointYPlus::wallPointYPlus
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// Update this with w2 if w2 nearer to pt. // Update this with w2 if w2 nearer to pt.
template<class TrackingData>
inline bool wallPointYPlus::updateCell inline bool wallPointYPlus::updateCell
( (
const polyMesh& mesh, const polyMesh& mesh,
const label thisCellI, const label thisCellI,
const label neighbourFaceI, const label neighbourFaceI,
const wallPointYPlus& neighbourWallInfo, const wallPointYPlus& neighbourWallInfo,
const scalar tol const scalar tol,
TrackingData& td
) )
{ {
const vectorField& cellCentres = mesh.primitiveMesh::cellCentres(); const vectorField& cellCentres = mesh.primitiveMesh::cellCentres();
@ -118,19 +122,22 @@ inline bool wallPointYPlus::updateCell
( (
cellCentres[thisCellI], cellCentres[thisCellI],
neighbourWallInfo, neighbourWallInfo,
tol tol,
td
); );
} }
// Update this with w2 if w2 nearer to pt. // Update this with w2 if w2 nearer to pt.
template<class TrackingData>
inline bool wallPointYPlus::updateFace inline bool wallPointYPlus::updateFace
( (
const polyMesh& mesh, const polyMesh& mesh,
const label thisFaceI, const label thisFaceI,
const label neighbourCellI, const label neighbourCellI,
const wallPointYPlus& neighbourWallInfo, const wallPointYPlus& neighbourWallInfo,
const scalar tol const scalar tol,
TrackingData& td
) )
{ {
const vectorField& faceCentres = mesh.faceCentres(); const vectorField& faceCentres = mesh.faceCentres();
@ -139,18 +146,21 @@ inline bool wallPointYPlus::updateFace
( (
faceCentres[thisFaceI], faceCentres[thisFaceI],
neighbourWallInfo, neighbourWallInfo,
tol tol,
td
); );
} }
// Update this with w2 if w2 nearer to pt. // Update this with w2 if w2 nearer to pt.
template<class TrackingData>
inline bool wallPointYPlus::updateFace inline bool wallPointYPlus::updateFace
( (
const polyMesh& mesh, const polyMesh& mesh,
const label thisFaceI, const label thisFaceI,
const wallPointYPlus& neighbourWallInfo, const wallPointYPlus& neighbourWallInfo,
const scalar tol const scalar tol,
TrackingData& td
) )
{ {
const vectorField& faceCentres = mesh.faceCentres(); const vectorField& faceCentres = mesh.faceCentres();
@ -159,7 +169,8 @@ inline bool wallPointYPlus::updateFace
( (
faceCentres[thisFaceI], faceCentres[thisFaceI],
neighbourWallInfo, neighbourWallInfo,
tol tol,
td
); );
} }

View File

@ -28,7 +28,7 @@ License
#include "breakupModel.H" #include "breakupModel.H"
#include "collisionModel.H" #include "collisionModel.H"
#include "dispersionModel.H" #include "dispersionModel.H"
#include "interpolationCellPoint.H" #include "interpolation.H"
#include "processorPolyPatch.H" #include "processorPolyPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -24,7 +24,6 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "ThermoCloud.H" #include "ThermoCloud.H"
#include "interpolationCellPoint.H"
#include "ThermoParcel.H" #include "ThermoParcel.H"
#include "HeatTransferModel.H" #include "HeatTransferModel.H"

View File

@ -48,7 +48,7 @@ SourceFiles
#include "Particle.H" #include "Particle.H"
#include "IOstream.H" #include "IOstream.H"
#include "autoPtr.H" #include "autoPtr.H"
#include "interpolationCellPoint.H" #include "interpolation.H"
#include "contiguous.H" #include "contiguous.H"
#include "KinematicCloud.H" #include "KinematicCloud.H"

View File

@ -32,11 +32,11 @@ bool Foam::blockMesh::blockMesh::verboseOutput(false);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::blockMesh::blockMesh(IOdictionary& dict) Foam::blockMesh::blockMesh(const IOdictionary& dict, const word& regionName)
: :
blockPointField_(dict.lookup("vertices")), blockPointField_(dict.lookup("vertices")),
scaleFactor_(1.0), scaleFactor_(1.0),
topologyPtr_(createTopology(dict)) topologyPtr_(createTopology(dict, regionName))
{ {
calcMergeInfo(); calcMergeInfo();
} }

View File

@ -128,7 +128,7 @@ class blockMesh
void createCellShapes(cellShapeList& tmpBlockCells); void createCellShapes(cellShapeList& tmpBlockCells);
polyMesh* createTopology(IOdictionary&); polyMesh* createTopology(const IOdictionary&, const word& regionName);
void checkBlockMesh(const polyMesh&) const; void checkBlockMesh(const polyMesh&) const;
//- Determine the merge info and the final number of cells/points //- Determine the merge info and the final number of cells/points
@ -149,7 +149,7 @@ public:
// Constructors // Constructors
//- Construct from IOdictionary //- Construct from IOdictionary
blockMesh(IOdictionary&); blockMesh(const IOdictionary&, const word& regionName);
//- Destructor //- Destructor

View File

@ -261,7 +261,11 @@ void Foam::blockMesh::createCellShapes
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& meshDescription) Foam::polyMesh* Foam::blockMesh::createTopology
(
const IOdictionary& meshDescription,
const word& regionName
)
{ {
bool topologyOK = true; bool topologyOK = true;
@ -514,7 +518,7 @@ Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& meshDescription)
( (
IOobject IOobject
( (
"blockMesh", regionName,
meshDescription.time().constant(), meshDescription.time().constant(),
meshDescription.time(), meshDescription.time(),
IOobject::NO_READ, IOobject::NO_READ,
@ -563,7 +567,7 @@ Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& meshDescription)
( (
IOobject IOobject
( (
"blockMesh", regionName,
meshDescription.time().constant(), meshDescription.time().constant(),
meshDescription.time(), meshDescription.time(),
IOobject::NO_READ, IOobject::NO_READ,

View File

@ -63,13 +63,15 @@ class cellInfo
//- Update current cell/face type with neighbouring //- Update current cell/face type with neighbouring
// type. Return true if information needs to propagate, // type. Return true if information needs to propagate,
// false otherwise. // false otherwise.
template<class TrackingData>
inline bool update inline bool update
( (
const cellInfo& w2, const cellInfo& w2,
const label thisFaceI, const label thisFaceI,
const label thisCellI, const label thisCellI,
const label neighbourFaceI, const label neighbourFaceI,
const label neighbourCellI const label neighbourCellI,
TrackingData& td
); );
public: public:
@ -100,71 +102,90 @@ public:
//- Check whether origin has been changed at all or //- Check whether origin has been changed at all or
// still contains original (invalid) value. // still contains original (invalid) value.
inline bool valid() const; template<class TrackingData>
inline bool valid(TrackingData& td) const;
//- Check for identical geometrical data. Used for cyclics checking. //- Check for identical geometrical data. Used for cyclics checking.
template<class TrackingData>
inline bool sameGeometry inline bool sameGeometry
( (
const polyMesh&, const polyMesh&,
const cellInfo&, const cellInfo&,
const scalar const scalar,
TrackingData& td
) const; ) const;
//- Convert any absolute coordinates into relative to (patch)face //- Convert any absolute coordinates into relative to (patch)face
// centre // centre
template<class TrackingData>
inline void leaveDomain inline void leaveDomain
( (
const polyMesh&, const polyMesh&,
const polyPatch& patch, const polyPatch& patch,
const label patchFaceI, const label patchFaceI,
const point& faceCentre const point& faceCentre,
TrackingData& td
); );
//- Reverse of leaveDomain //- Reverse of leaveDomain
template<class TrackingData>
inline void enterDomain inline void enterDomain
( (
const polyMesh&, const polyMesh&,
const polyPatch& patch, const polyPatch& patch,
const label patchFaceI, const label patchFaceI,
const point& faceCentre const point& faceCentre,
TrackingData& td
); );
//- Apply rotation matrix to any coordinates //- Apply rotation matrix to any coordinates
template<class TrackingData>
inline void transform inline void transform
( (
const polyMesh&, const polyMesh&,
const tensor& rotTensor const tensor& rotTensor,
TrackingData& td
); );
//- Influence of neighbouring face. //- Influence of neighbouring face.
template<class TrackingData>
inline bool updateCell inline bool updateCell
( (
const polyMesh&, const polyMesh&,
const label thisCellI, const label thisCellI,
const label neighbourFaceI, const label neighbourFaceI,
const cellInfo& neighbourInfo, const cellInfo& neighbourInfo,
const scalar tol const scalar tol,
TrackingData& td
); );
//- Influence of neighbouring cell. //- Influence of neighbouring cell.
template<class TrackingData>
inline bool updateFace inline bool updateFace
( (
const polyMesh&, const polyMesh&,
const label thisFaceI, const label thisFaceI,
const label neighbourCellI, const label neighbourCellI,
const cellInfo& neighbourInfo, const cellInfo& neighbourInfo,
const scalar tol const scalar tol,
TrackingData& td
); );
//- Influence of different value on same face. //- Influence of different value on same face.
template<class TrackingData>
inline bool updateFace inline bool updateFace
( (
const polyMesh&, const polyMesh&,
const label thisFaceI, const label thisFaceI,
const cellInfo& neighbourInfo, const cellInfo& neighbourInfo,
const scalar tol const scalar tol,
TrackingData& td
); );
//- Same (like operator==)
template<class TrackingData>
inline bool equal(const cellInfo&, TrackingData& td) const;
// Member Operators // Member Operators
//Note: Used to determine whether to call update. //Note: Used to determine whether to call update.

View File

@ -29,13 +29,15 @@ License
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// Update this with w2 information // Update this with w2 information
template<class TrackingData>
inline bool Foam::cellInfo::update inline bool Foam::cellInfo::update
( (
const cellInfo& w2, const cellInfo& w2,
const label thisFaceI, const label thisFaceI,
const label thisCellI, const label thisCellI,
const label neighbourFaceI, const label neighbourFaceI,
const label neighbourCellI const label neighbourCellI,
TrackingData& td
) )
{ {
if if
@ -113,18 +115,21 @@ inline Foam::cellInfo::cellInfo(const cellInfo& w2)
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline bool Foam::cellInfo::valid() const template<class TrackingData>
inline bool Foam::cellInfo::valid(TrackingData& td) const
{ {
return type_ != cellClassification::NOTSET; return type_ != cellClassification::NOTSET;
} }
// No geometric data so never any problem on cyclics // No geometric data so never any problem on cyclics
template<class TrackingData>
inline bool Foam::cellInfo::sameGeometry inline bool Foam::cellInfo::sameGeometry
( (
const polyMesh&, const polyMesh&,
const cellInfo& w2, const cellInfo& w2,
const scalar tol const scalar tol,
TrackingData& td
) )
const const
{ {
@ -133,44 +138,52 @@ inline bool Foam::cellInfo::sameGeometry
// No geometric data. // No geometric data.
template<class TrackingData>
inline void Foam::cellInfo::leaveDomain inline void Foam::cellInfo::leaveDomain
( (
const polyMesh&, const polyMesh&,
const polyPatch& patch, const polyPatch& patch,
const label patchFaceI, const label patchFaceI,
const point& faceCentre const point& faceCentre,
TrackingData& td
) )
{} {}
// No geometric data. // No geometric data.
template<class TrackingData>
inline void Foam::cellInfo::transform inline void Foam::cellInfo::transform
( (
const polyMesh&, const polyMesh&,
const tensor& rotTensor const tensor& rotTensor,
TrackingData& td
) )
{} {}
// No geometric data. // No geometric data.
template<class TrackingData>
inline void Foam::cellInfo::enterDomain inline void Foam::cellInfo::enterDomain
( (
const polyMesh&, const polyMesh&,
const polyPatch& patch, const polyPatch& patch,
const label patchFaceI, const label patchFaceI,
const point& faceCentre const point& faceCentre,
TrackingData& td
) )
{} {}
// Update this with neighbour information // Update this with neighbour information
template<class TrackingData>
inline bool Foam::cellInfo::updateCell inline bool Foam::cellInfo::updateCell
( (
const polyMesh&, const polyMesh&,
const label thisCellI, const label thisCellI,
const label neighbourFaceI, const label neighbourFaceI,
const cellInfo& neighbourInfo, const cellInfo& neighbourInfo,
const scalar tol const scalar tol,
TrackingData& td
) )
{ {
return update return update
@ -179,19 +192,22 @@ inline bool Foam::cellInfo::updateCell
-1, -1,
thisCellI, thisCellI,
neighbourFaceI, neighbourFaceI,
-1 -1,
td
); );
} }
// Update this with neighbour information // Update this with neighbour information
template<class TrackingData>
inline bool Foam::cellInfo::updateFace inline bool Foam::cellInfo::updateFace
( (
const polyMesh&, const polyMesh&,
const label thisFaceI, const label thisFaceI,
const label neighbourCellI, const label neighbourCellI,
const cellInfo& neighbourInfo, const cellInfo& neighbourInfo,
const scalar tol const scalar tol,
TrackingData& td
) )
{ {
return update return update
@ -200,17 +216,20 @@ inline bool Foam::cellInfo::updateFace
thisFaceI, thisFaceI,
-1, -1,
-1, -1,
neighbourCellI neighbourCellI,
td
); );
} }
// Update this with neighbour information // Update this with neighbour information
template<class TrackingData>
inline bool Foam::cellInfo::updateFace inline bool Foam::cellInfo::updateFace
( (
const polyMesh&, const polyMesh&,
const label thisFaceI, const label thisFaceI,
const cellInfo& neighbourInfo, const cellInfo& neighbourInfo,
const scalar tol const scalar tol,
TrackingData& td
) )
{ {
return update return update
@ -219,11 +238,23 @@ inline bool Foam::cellInfo::updateFace
thisFaceI, thisFaceI,
-1, -1,
-1, -1,
-1 -1,
td
); );
} }
template <class TrackingData>
inline bool Foam::cellInfo::equal
(
const cellInfo& rhs,
TrackingData& td
) const
{
return operator==(rhs);
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
inline bool Foam::cellInfo::operator==(const Foam::cellInfo& rhs) const inline bool Foam::cellInfo::operator==(const Foam::cellInfo& rhs) const

View File

@ -24,7 +24,6 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "patchDataWave.H" #include "patchDataWave.H"
#include "MeshWave.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -93,7 +92,7 @@ Foam::label Foam::patchDataWave<TransferType>::getValues
scalar dist = wpn.distSqr(); scalar dist = wpn.distSqr();
if (cellInfo[cellI].valid()) if (cellInfo[cellI].valid(waveInfo.data()))
{ {
distance_[cellI] = Foam::sqrt(dist); distance_[cellI] = Foam::sqrt(dist);
@ -138,7 +137,7 @@ Foam::label Foam::patchDataWave<TransferType>::getValues
scalar dist = faceInfo[meshFaceI].distSqr(); scalar dist = faceInfo[meshFaceI].distSqr();
if (faceInfo[meshFaceI].valid()) if (faceInfo[meshFaceI].valid(waveInfo.data()))
{ {
// Adding SMALL to avoid problems with /0 in the turbulence // Adding SMALL to avoid problems with /0 in the turbulence
// models // models

View File

@ -45,6 +45,7 @@ SourceFiles
#include "cellDistFuncs.H" #include "cellDistFuncs.H"
#include "FieldField.H" #include "FieldField.H"
#include "UPtrList.H" #include "UPtrList.H"
#include "MeshWave.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -54,7 +55,7 @@ namespace Foam
// Forward declaration of classes // Forward declaration of classes
class polyMesh; class polyMesh;
class wallPoint; class wallPoint;
template<class Type> class MeshWave; //template<class Type, class TrackingData> class MeshWave;
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class patchDataWave Declaration Class patchDataWave Declaration

View File

@ -26,7 +26,6 @@ License
#include "patchWave.H" #include "patchWave.H"
#include "polyMesh.H" #include "polyMesh.H"
#include "wallPoint.H" #include "wallPoint.H"
#include "MeshWave.H"
#include "globalMeshData.H" #include "globalMeshData.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -82,7 +81,7 @@ Foam::label Foam::patchWave::getValues(const MeshWave<wallPoint>& waveInfo)
{ {
scalar dist = cellInfo[cellI].distSqr(); scalar dist = cellInfo[cellI].distSqr();
if (cellInfo[cellI].valid()) if (cellInfo[cellI].valid(waveInfo.data()))
{ {
distance_[cellI] = Foam::sqrt(dist); distance_[cellI] = Foam::sqrt(dist);
} }
@ -112,7 +111,7 @@ Foam::label Foam::patchWave::getValues(const MeshWave<wallPoint>& waveInfo)
scalar dist = faceInfo[meshFaceI].distSqr(); scalar dist = faceInfo[meshFaceI].distSqr();
if (faceInfo[meshFaceI].valid()) if (faceInfo[meshFaceI].valid(waveInfo.data()))
{ {
// Adding SMALL to avoid problems with /0 in the turbulence // Adding SMALL to avoid problems with /0 in the turbulence
// models // models

View File

@ -39,7 +39,7 @@ SourceFiles
#include "cellDistFuncs.H" #include "cellDistFuncs.H"
#include "FieldField.H" #include "FieldField.H"
#include "MeshWave.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -49,7 +49,6 @@ namespace Foam
// Forward declaration of classes // Forward declaration of classes
class polyMesh; class polyMesh;
class wallPoint; class wallPoint;
template<class Type> class MeshWave;
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class patchWave Declaration Class patchWave Declaration

View File

@ -76,11 +76,13 @@ class wallPoint
//- Evaluate distance to point. Update distSqr, origin from whomever //- Evaluate distance to point. Update distSqr, origin from whomever
// is nearer pt. Return true if w2 is closer to point, // is nearer pt. Return true if w2 is closer to point,
// false otherwise. // false otherwise.
template<class TrackingData>
inline bool update inline bool update
( (
const point&, const point&,
const wallPoint& w2, const wallPoint& w2,
const scalar tol const scalar tol,
TrackingData& td
); );
@ -122,71 +124,90 @@ public:
//- Check whether origin has been changed at all or //- Check whether origin has been changed at all or
// still contains original (invalid) value. // still contains original (invalid) value.
inline bool valid() const; template<class TrackingData>
inline bool valid(TrackingData& td) const;
//- Check for identical geometrical data. Used for cyclics checking. //- Check for identical geometrical data. Used for cyclics checking.
template<class TrackingData>
inline bool sameGeometry inline bool sameGeometry
( (
const polyMesh&, const polyMesh&,
const wallPoint&, const wallPoint&,
const scalar const scalar,
TrackingData& td
) const; ) const;
//- Convert any absolute coordinates into relative to (patch)face //- Convert any absolute coordinates into relative to (patch)face
// centre // centre
template<class TrackingData>
inline void leaveDomain inline void leaveDomain
( (
const polyMesh&, const polyMesh&,
const polyPatch&, const polyPatch&,
const label patchFaceI, const label patchFaceI,
const point& faceCentre const point& faceCentre,
TrackingData& td
); );
//- Reverse of leaveDomain //- Reverse of leaveDomain
template<class TrackingData>
inline void enterDomain inline void enterDomain
( (
const polyMesh&, const polyMesh&,
const polyPatch&, const polyPatch&,
const label patchFaceI, const label patchFaceI,
const point& faceCentre const point& faceCentre,
TrackingData& td
); );
//- Apply rotation matrix to any coordinates //- Apply rotation matrix to any coordinates
template<class TrackingData>
inline void transform inline void transform
( (
const polyMesh&, const polyMesh&,
const tensor& const tensor&,
TrackingData& td
); );
//- Influence of neighbouring face. //- Influence of neighbouring face.
template<class TrackingData>
inline bool updateCell inline bool updateCell
( (
const polyMesh&, const polyMesh&,
const label thisCellI, const label thisCellI,
const label neighbourFaceI, const label neighbourFaceI,
const wallPoint& neighbourInfo, const wallPoint& neighbourInfo,
const scalar tol const scalar tol,
TrackingData& td
); );
//- Influence of neighbouring cell. //- Influence of neighbouring cell.
template<class TrackingData>
inline bool updateFace inline bool updateFace
( (
const polyMesh&, const polyMesh&,
const label thisFaceI, const label thisFaceI,
const label neighbourCellI, const label neighbourCellI,
const wallPoint& neighbourInfo, const wallPoint& neighbourInfo,
const scalar tol const scalar tol,
TrackingData& td
); );
//- Influence of different value on same face. //- Influence of different value on same face.
template<class TrackingData>
inline bool updateFace inline bool updateFace
( (
const polyMesh&, const polyMesh&,
const label thisFaceI, const label thisFaceI,
const wallPoint& neighbourInfo, const wallPoint& neighbourInfo,
const scalar tol const scalar tol,
TrackingData& td
); );
//- Same (like operator==)
template<class TrackingData>
inline bool equal(const wallPoint&, TrackingData& td) const;
// Member Operators // Member Operators

View File

@ -24,9 +24,6 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "wallPointData.H" #include "wallPointData.H"
#include "point.H"
#include "scalar.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -47,6 +44,7 @@ Ostream& operator<<
return os << wDist.data(); return os << wDist.data();
} }
template <class Type> template <class Type>
Istream& operator>> Istream& operator>>
( (
@ -59,6 +57,7 @@ Istream& operator>>
return is >> wDist.data_; return is >> wDist.data_;
} }
// ************************************************************************* // // ************************************************************************* //
} // End namespace Foam } // End namespace Foam

View File

@ -74,11 +74,13 @@ class wallPointData
//- Evaluate distance to point. Update distSqr, origin from whomever //- Evaluate distance to point. Update distSqr, origin from whomever
// is nearer pt. Return true if w2 is closer to point, // is nearer pt. Return true if w2 is closer to point,
// false otherwise. // false otherwise.
template<class TrackingData>
inline bool update inline bool update
( (
const point&, const point&,
const wallPointData<Type>& w2, const wallPointData<Type>& w2,
const scalar tol const scalar tol,
TrackingData& td
); );
@ -112,35 +114,41 @@ public:
//- Influence of neighbouring face. //- Influence of neighbouring face.
// Calls update(...) with cellCentre of cellI // Calls update(...) with cellCentre of cellI
template<class TrackingData>
inline bool updateCell inline bool updateCell
( (
const polyMesh& mesh, const polyMesh& mesh,
const label thisCellI, const label thisCellI,
const label neighbourFaceI, const label neighbourFaceI,
const wallPointData<Type>& neighbourWallInfo, const wallPointData<Type>& neighbourWallInfo,
const scalar tol const scalar tol,
TrackingData& td
); );
//- Influence of neighbouring cell. //- Influence of neighbouring cell.
// Calls update(...) with faceCentre of faceI // Calls update(...) with faceCentre of faceI
template<class TrackingData>
inline bool updateFace inline bool updateFace
( (
const polyMesh& mesh, const polyMesh& mesh,
const label thisFaceI, const label thisFaceI,
const label neighbourCellI, const label neighbourCellI,
const wallPointData<Type>& neighbourWallInfo, const wallPointData<Type>& neighbourWallInfo,
const scalar tol const scalar tol,
TrackingData& td
); );
//- Influence of different value on same face. //- Influence of different value on same face.
// Merge new and old info. // Merge new and old info.
// Calls update(...) with faceCentre of faceI // Calls update(...) with faceCentre of faceI
template<class TrackingData>
inline bool updateFace inline bool updateFace
( (
const polyMesh& mesh, const polyMesh& mesh,
const label thisFaceI, const label thisFaceI,
const wallPointData<Type>& neighbourWallInfo, const wallPointData<Type>& neighbourWallInfo,
const scalar tol const scalar tol,
TrackingData& td
); );
// Member Operators // Member Operators

View File

@ -21,8 +21,6 @@ License
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -32,19 +30,20 @@ namespace Foam
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// Update this with w2 if w2 nearer to pt. // Update this with w2 if w2 nearer to pt.
template <class Type> template <class Type>
template <class TrackingData>
inline bool wallPointData<Type>::update inline bool wallPointData<Type>::update
( (
const point& pt, const point& pt,
const wallPointData<Type>& w2, const wallPointData<Type>& w2,
const scalar tol const scalar tol,
TrackingData& td
) )
{ {
scalar dist2 = magSqr(pt - w2.origin()); scalar dist2 = magSqr(pt - w2.origin());
if (!valid()) if (!valid(td))
{ {
// current not yet set so use any value // current not yet set so use any value
distSqr() = dist2; distSqr() = dist2;
@ -122,13 +121,15 @@ inline Type& wallPointData<Type>::data()
// Update this with w2 if w2 nearer to pt. // Update this with w2 if w2 nearer to pt.
template <class Type> template <class Type>
template <class TrackingData>
inline bool wallPointData<Type>::updateCell inline bool wallPointData<Type>::updateCell
( (
const polyMesh& mesh, const polyMesh& mesh,
const label thisCellI, const label thisCellI,
const label, const label,
const wallPointData<Type>& neighbourWallInfo, const wallPointData<Type>& neighbourWallInfo,
const scalar tol const scalar tol,
TrackingData& td
) )
{ {
const vectorField& cellCentres = mesh.primitiveMesh::cellCentres(); const vectorField& cellCentres = mesh.primitiveMesh::cellCentres();
@ -137,20 +138,23 @@ inline bool wallPointData<Type>::updateCell
( (
cellCentres[thisCellI], cellCentres[thisCellI],
neighbourWallInfo, neighbourWallInfo,
tol tol,
td
); );
} }
// Update this with w2 if w2 nearer to pt. // Update this with w2 if w2 nearer to pt.
template <class Type> template <class Type>
template <class TrackingData>
inline bool wallPointData<Type>::updateFace inline bool wallPointData<Type>::updateFace
( (
const polyMesh& mesh, const polyMesh& mesh,
const label thisFaceI, const label thisFaceI,
const label, const label,
const wallPointData<Type>& neighbourWallInfo, const wallPointData<Type>& neighbourWallInfo,
const scalar tol const scalar tol,
TrackingData& td
) )
{ {
const vectorField& faceCentres = mesh.faceCentres(); const vectorField& faceCentres = mesh.faceCentres();
@ -159,19 +163,22 @@ inline bool wallPointData<Type>::updateFace
( (
faceCentres[thisFaceI], faceCentres[thisFaceI],
neighbourWallInfo, neighbourWallInfo,
tol tol,
td
); );
} }
// Update this with w2 if w2 nearer to pt. // Update this with w2 if w2 nearer to pt.
template <class Type> template <class Type>
template <class TrackingData>
inline bool wallPointData<Type>::updateFace inline bool wallPointData<Type>::updateFace
( (
const polyMesh& mesh, const polyMesh& mesh,
const label thisFaceI, const label thisFaceI,
const wallPointData<Type>& neighbourWallInfo, const wallPointData<Type>& neighbourWallInfo,
const scalar tol const scalar tol,
TrackingData& td
) )
{ {
const vectorField& faceCentres = mesh.faceCentres(); const vectorField& faceCentres = mesh.faceCentres();
@ -180,7 +187,8 @@ inline bool wallPointData<Type>::updateFace
( (
faceCentres[thisFaceI], faceCentres[thisFaceI],
neighbourWallInfo, neighbourWallInfo,
tol tol,
td
); );
} }

View File

@ -29,11 +29,13 @@ License
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// Update this with w2 if w2 nearer to pt. // Update this with w2 if w2 nearer to pt.
template<class TrackingData>
inline bool Foam::wallPoint::update inline bool Foam::wallPoint::update
( (
const point& pt, const point& pt,
const wallPoint& w2, const wallPoint& w2,
const scalar tol const scalar tol,
TrackingData& td
) )
{ {
//Already done in calling algorithm //Already done in calling algorithm
@ -45,7 +47,7 @@ inline bool Foam::wallPoint::update
scalar dist2 = magSqr(pt - w2.origin()); scalar dist2 = magSqr(pt - w2.origin());
if (!valid()) if (!valid(td))
{ {
// current not yet set so use any value // current not yet set so use any value
distSqr_ = dist2; distSqr_ = dist2;
@ -128,18 +130,21 @@ inline Foam::scalar& Foam::wallPoint::distSqr()
} }
inline bool Foam::wallPoint::valid() const template<class TrackingData>
inline bool Foam::wallPoint::valid(TrackingData& td) const
{ {
return origin_ != point::max; return origin_ != point::max;
} }
// Checks for cyclic faces // Checks for cyclic faces
template<class TrackingData>
inline bool Foam::wallPoint::sameGeometry inline bool Foam::wallPoint::sameGeometry
( (
const polyMesh&, const polyMesh&,
const wallPoint& w2, const wallPoint& w2,
const scalar tol const scalar tol,
TrackingData& td
) )
const const
{ {
@ -163,22 +168,26 @@ inline bool Foam::wallPoint::sameGeometry
} }
template<class TrackingData>
inline void Foam::wallPoint::leaveDomain inline void Foam::wallPoint::leaveDomain
( (
const polyMesh&, const polyMesh&,
const polyPatch&, const polyPatch&,
const label, const label,
const point& faceCentre const point& faceCentre,
TrackingData& td
) )
{ {
origin_ -= faceCentre; origin_ -= faceCentre;
} }
template<class TrackingData>
inline void Foam::wallPoint::transform inline void Foam::wallPoint::transform
( (
const polyMesh&, const polyMesh&,
const tensor& rotTensor const tensor& rotTensor,
TrackingData& td
) )
{ {
origin_ = Foam::transform(rotTensor, origin_); origin_ = Foam::transform(rotTensor, origin_);
@ -187,12 +196,14 @@ inline void Foam::wallPoint::transform
// Update absolute geometric quantities. Note that distance (distSqr_) // Update absolute geometric quantities. Note that distance (distSqr_)
// is not affected by leaving/entering domain. // is not affected by leaving/entering domain.
template<class TrackingData>
inline void Foam::wallPoint::enterDomain inline void Foam::wallPoint::enterDomain
( (
const polyMesh&, const polyMesh&,
const polyPatch&, const polyPatch&,
const label, const label,
const point& faceCentre const point& faceCentre,
TrackingData& td
) )
{ {
// back to absolute form // back to absolute form
@ -201,13 +212,15 @@ inline void Foam::wallPoint::enterDomain
// Update this with w2 if w2 nearer to pt. // Update this with w2 if w2 nearer to pt.
template<class TrackingData>
inline bool Foam::wallPoint::updateCell inline bool Foam::wallPoint::updateCell
( (
const polyMesh& mesh, const polyMesh& mesh,
const label thisCellI, const label thisCellI,
const label neighbourFaceI, const label neighbourFaceI,
const wallPoint& neighbourWallInfo, const wallPoint& neighbourWallInfo,
const scalar tol const scalar tol,
TrackingData& td
) )
{ {
return return
@ -215,19 +228,22 @@ inline bool Foam::wallPoint::updateCell
( (
mesh.cellCentres()[thisCellI], mesh.cellCentres()[thisCellI],
neighbourWallInfo, neighbourWallInfo,
tol tol,
td
); );
} }
// Update this with w2 if w2 nearer to pt. // Update this with w2 if w2 nearer to pt.
template<class TrackingData>
inline bool Foam::wallPoint::updateFace inline bool Foam::wallPoint::updateFace
( (
const polyMesh& mesh, const polyMesh& mesh,
const label thisFaceI, const label thisFaceI,
const label neighbourCellI, const label neighbourCellI,
const wallPoint& neighbourWallInfo, const wallPoint& neighbourWallInfo,
const scalar tol const scalar tol,
TrackingData& td
) )
{ {
return return
@ -235,17 +251,20 @@ inline bool Foam::wallPoint::updateFace
( (
mesh.faceCentres()[thisFaceI], mesh.faceCentres()[thisFaceI],
neighbourWallInfo, neighbourWallInfo,
tol tol,
td
); );
} }
// Update this with w2 if w2 nearer to pt. // Update this with w2 if w2 nearer to pt.
template<class TrackingData>
inline bool Foam::wallPoint::updateFace inline bool Foam::wallPoint::updateFace
( (
const polyMesh& mesh, const polyMesh& mesh,
const label thisFaceI, const label thisFaceI,
const wallPoint& neighbourWallInfo, const wallPoint& neighbourWallInfo,
const scalar tol const scalar tol,
TrackingData& td
) )
{ {
return return
@ -253,11 +272,23 @@ inline bool Foam::wallPoint::updateFace
( (
mesh.faceCentres()[thisFaceI], mesh.faceCentres()[thisFaceI],
neighbourWallInfo, neighbourWallInfo,
tol tol,
td
); );
} }
template <class TrackingData>
inline bool Foam::wallPoint::equal
(
const wallPoint& rhs,
TrackingData& td
) const
{
return operator==(rhs);
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
inline bool Foam::wallPoint::operator==(const Foam::wallPoint& rhs) const inline bool Foam::wallPoint::operator==(const Foam::wallPoint& rhs) const

View File

@ -155,7 +155,7 @@ Foam::labelList Foam::structuredDecomp::decompose
bool haveWarned = false; bool haveWarned = false;
forAll(finalDecomp, cellI) forAll(finalDecomp, cellI)
{ {
if (!cellData[cellI].valid()) if (!cellData[cellI].valid(deltaCalc.data()))
{ {
if (!haveWarned) if (!haveWarned)
{ {

View File

@ -96,71 +96,90 @@ public:
//- Check whether origin has been changed at all or //- Check whether origin has been changed at all or
// still contains original (invalid) value. // still contains original (invalid) value.
inline bool valid() const; template<class TrackingData>
inline bool valid(TrackingData& td) const;
//- Check for identical geometrical data. Used for cyclics checking. //- Check for identical geometrical data. Used for cyclics checking.
template<class TrackingData>
inline bool sameGeometry inline bool sameGeometry
( (
const polyMesh&, const polyMesh&,
const topoDistanceData&, const topoDistanceData&,
const scalar const scalar,
TrackingData& td
) const; ) const;
//- Convert any absolute coordinates into relative to (patch)face //- Convert any absolute coordinates into relative to (patch)face
// centre // centre
template<class TrackingData>
inline void leaveDomain inline void leaveDomain
( (
const polyMesh&, const polyMesh&,
const polyPatch&, const polyPatch&,
const label patchFaceI, const label patchFaceI,
const point& faceCentre const point& faceCentre,
TrackingData& td
); );
//- Reverse of leaveDomain //- Reverse of leaveDomain
template<class TrackingData>
inline void enterDomain inline void enterDomain
( (
const polyMesh&, const polyMesh&,
const polyPatch&, const polyPatch&,
const label patchFaceI, const label patchFaceI,
const point& faceCentre const point& faceCentre,
TrackingData& td
); );
//- Apply rotation matrix to any coordinates //- Apply rotation matrix to any coordinates
template<class TrackingData>
inline void transform inline void transform
( (
const polyMesh&, const polyMesh&,
const tensor& const tensor&,
TrackingData& td
); );
//- Influence of neighbouring face. //- Influence of neighbouring face.
template<class TrackingData>
inline bool updateCell inline bool updateCell
( (
const polyMesh&, const polyMesh&,
const label thisCellI, const label thisCellI,
const label neighbourFaceI, const label neighbourFaceI,
const topoDistanceData& neighbourInfo, const topoDistanceData& neighbourInfo,
const scalar tol const scalar tol,
TrackingData& td
); );
//- Influence of neighbouring cell. //- Influence of neighbouring cell.
template<class TrackingData>
inline bool updateFace inline bool updateFace
( (
const polyMesh&, const polyMesh&,
const label thisFaceI, const label thisFaceI,
const label neighbourCellI, const label neighbourCellI,
const topoDistanceData& neighbourInfo, const topoDistanceData& neighbourInfo,
const scalar tol const scalar tol,
TrackingData& td
); );
//- Influence of different value on same face. //- Influence of different value on same face.
template<class TrackingData>
inline bool updateFace inline bool updateFace
( (
const polyMesh&, const polyMesh&,
const label thisFaceI, const label thisFaceI,
const topoDistanceData& neighbourInfo, const topoDistanceData& neighbourInfo,
const scalar tol const scalar tol,
TrackingData& td
); );
//- Same (like operator==)
template<class TrackingData>
inline bool equal(const topoDistanceData&, TrackingData& td) const;
// Member Operators // Member Operators
// Needed for List IO // Needed for List IO

View File

@ -52,18 +52,21 @@ inline Foam::topoDistanceData::topoDistanceData
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline bool Foam::topoDistanceData::valid() const template <class TrackingData>
inline bool Foam::topoDistanceData::valid(TrackingData& td) const
{ {
return distance_ != -1; return distance_ != -1;
} }
// No geometric data so never any problem on cyclics // No geometric data so never any problem on cyclics
template <class TrackingData>
inline bool Foam::topoDistanceData::sameGeometry inline bool Foam::topoDistanceData::sameGeometry
( (
const polyMesh&, const polyMesh&,
const topoDistanceData&, const topoDistanceData&,
const scalar const scalar,
TrackingData&
) const ) const
{ {
return true; return true;
@ -71,44 +74,52 @@ inline bool Foam::topoDistanceData::sameGeometry
// No geometric data. // No geometric data.
template <class TrackingData>
inline void Foam::topoDistanceData::leaveDomain inline void Foam::topoDistanceData::leaveDomain
( (
const polyMesh&, const polyMesh&,
const polyPatch& patch, const polyPatch& patch,
const label patchFaceI, const label patchFaceI,
const point& faceCentre const point& faceCentre,
TrackingData&
) )
{} {}
// No geometric data. // No geometric data.
template <class TrackingData>
inline void Foam::topoDistanceData::transform inline void Foam::topoDistanceData::transform
( (
const polyMesh&, const polyMesh&,
const tensor& rotTensor const tensor& rotTensor,
TrackingData&
) )
{} {}
// No geometric data. // No geometric data.
template <class TrackingData>
inline void Foam::topoDistanceData::enterDomain inline void Foam::topoDistanceData::enterDomain
( (
const polyMesh&, const polyMesh&,
const polyPatch& patch, const polyPatch& patch,
const label patchFaceI, const label patchFaceI,
const point& faceCentre const point& faceCentre,
TrackingData&
) )
{} {}
// Update cell with neighbouring face information // Update cell with neighbouring face information
template <class TrackingData>
inline bool Foam::topoDistanceData::updateCell inline bool Foam::topoDistanceData::updateCell
( (
const polyMesh&, const polyMesh&,
const label thisCellI, const label thisCellI,
const label neighbourFaceI, const label neighbourFaceI,
const topoDistanceData& neighbourInfo, const topoDistanceData& neighbourInfo,
const scalar tol const scalar tol,
TrackingData&
) )
{ {
if (distance_ == -1) if (distance_ == -1)
@ -125,13 +136,15 @@ inline bool Foam::topoDistanceData::updateCell
// Update face with neighbouring cell information // Update face with neighbouring cell information
template <class TrackingData>
inline bool Foam::topoDistanceData::updateFace inline bool Foam::topoDistanceData::updateFace
( (
const polyMesh& mesh, const polyMesh& mesh,
const label thisFaceI, const label thisFaceI,
const label neighbourCellI, const label neighbourCellI,
const topoDistanceData& neighbourInfo, const topoDistanceData& neighbourInfo,
const scalar tol const scalar tol,
TrackingData&
) )
{ {
// From cell to its faces. // From cell to its faces.
@ -149,12 +162,14 @@ inline bool Foam::topoDistanceData::updateFace
// Update face with coupled face information // Update face with coupled face information
template <class TrackingData>
inline bool Foam::topoDistanceData::updateFace inline bool Foam::topoDistanceData::updateFace
( (
const polyMesh&, const polyMesh&,
const label thisFaceI, const label thisFaceI,
const topoDistanceData& neighbourInfo, const topoDistanceData& neighbourInfo,
const scalar tol const scalar tol,
TrackingData&
) )
{ {
// From face to face (e.g. coupled faces) // From face to face (e.g. coupled faces)
@ -170,6 +185,17 @@ inline bool Foam::topoDistanceData::updateFace
} }
template <class TrackingData>
inline bool Foam::topoDistanceData::equal
(
const topoDistanceData& rhs,
TrackingData& td
) const
{
return operator==(rhs);
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
inline bool Foam::topoDistanceData::operator== inline bool Foam::topoDistanceData::operator==

View File

@ -37,9 +37,6 @@ namespace Foam
defineTypeNameAndDebug(smoothDelta, 0); defineTypeNameAndDebug(smoothDelta, 0);
addToRunTimeSelectionTable(LESdelta, smoothDelta, dictionary); addToRunTimeSelectionTable(LESdelta, smoothDelta, dictionary);
scalar smoothDelta::deltaData::maxDeltaRatio = 1.2;
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// Fill changedFaces (with face labels) and changedFacesInfo (with delta) // Fill changedFaces (with face labels) and changedFacesInfo (with delta)
@ -69,12 +66,12 @@ void smoothDelta::setChangedFaces
// Check if owner delta much larger than neighbour delta or vice versa // Check if owner delta much larger than neighbour delta or vice versa
if (ownDelta > deltaData::maxDeltaRatio * neiDelta) if (ownDelta > maxDeltaRatio_ * neiDelta)
{ {
changedFaces.append(faceI); changedFaces.append(faceI);
changedFacesInfo.append(deltaData(ownDelta)); changedFacesInfo.append(deltaData(ownDelta));
} }
else if (neiDelta > deltaData::maxDeltaRatio * ownDelta) else if (neiDelta > maxDeltaRatio_ * ownDelta)
{ {
changedFaces.append(faceI); changedFaces.append(faceI);
changedFacesInfo.append(deltaData(neiDelta)); changedFacesInfo.append(deltaData(neiDelta));
@ -108,7 +105,6 @@ void smoothDelta::setChangedFaces
void smoothDelta::calcDelta() void smoothDelta::calcDelta()
{ {
deltaData::maxDeltaRatio = maxDeltaRatio_;
const volScalarField& geometricDelta = geometricDelta_(); const volScalarField& geometricDelta = geometricDelta_();
// Fill changed faces with info // Fill changed faces with info
@ -130,14 +126,15 @@ void smoothDelta::calcDelta()
// Propagate information over whole domain. // Propagate information over whole domain.
FaceCellWave<deltaData> deltaCalc FaceCellWave<deltaData, scalar> deltaCalc
( (
mesh_, mesh_,
changedFaces, changedFaces,
changedFacesInfo, changedFacesInfo,
faceDeltaData, faceDeltaData,
cellDeltaData, cellDeltaData,
mesh_.globalData().nTotalCells()+1 // max iterations mesh_.globalData().nTotalCells()+1, // max iterations
maxDeltaRatio_
); );
forAll(delta_, cellI) forAll(delta_, cellI)

View File

@ -76,22 +76,18 @@ class smoothDelta
//- Update. Gets information from neighbouring face/cell and //- Update. Gets information from neighbouring face/cell and
// uses this to update itself (if nessecary) and return true. // uses this to update itself (if nessecary) and return true.
template<class TrackingData>
inline bool update inline bool update
( (
const deltaData& w2, const deltaData& w2,
const scalar scale, const scalar scale,
const scalar tol const scalar tol,
TrackingData& td
); );
public: public:
// Static data members
//- delta fraction
static scalar maxDeltaRatio;
// Constructors // Constructors
//- Construct null //- Construct null
@ -115,72 +111,91 @@ class smoothDelta
//- Check whether origin has been changed at all or //- Check whether origin has been changed at all or
// still contains original (invalid) value. // still contains original (invalid) value.
inline bool valid() const; template<class TrackingData>
inline bool valid(TrackingData& td) const;
//- Check for identical geometrical data. //- Check for identical geometrical data.
// Used for cyclics checking. // Used for cyclics checking.
template<class TrackingData>
inline bool sameGeometry inline bool sameGeometry
( (
const polyMesh&, const polyMesh&,
const deltaData&, const deltaData&,
const scalar const scalar,
TrackingData& td
) const; ) const;
//- Convert any absolute coordinates into relative to //- Convert any absolute coordinates into relative to
// (patch)face centre // (patch)face centre
template<class TrackingData>
inline void leaveDomain inline void leaveDomain
( (
const polyMesh&, const polyMesh&,
const polyPatch&, const polyPatch&,
const label patchFaceI, const label patchFaceI,
const point& faceCentre const point& faceCentre,
TrackingData& td
); );
//- Reverse of leaveDomain //- Reverse of leaveDomain
template<class TrackingData>
inline void enterDomain inline void enterDomain
( (
const polyMesh&, const polyMesh&,
const polyPatch&, const polyPatch&,
const label patchFaceI, const label patchFaceI,
const point& faceCentre const point& faceCentre,
TrackingData& td
); );
//- Apply rotation matrix to any coordinates //- Apply rotation matrix to any coordinates
template<class TrackingData>
inline void transform inline void transform
( (
const polyMesh&, const polyMesh&,
const tensor& const tensor&,
TrackingData& td
); );
//- Influence of neighbouring face. //- Influence of neighbouring face.
template<class TrackingData>
inline bool updateCell inline bool updateCell
( (
const polyMesh&, const polyMesh&,
const label thisCellI, const label thisCellI,
const label neighbourFaceI, const label neighbourFaceI,
const deltaData& neighbourInfo, const deltaData& neighbourInfo,
const scalar tol const scalar tol,
TrackingData& td
); );
//- Influence of neighbouring cell. //- Influence of neighbouring cell.
template<class TrackingData>
inline bool updateFace inline bool updateFace
( (
const polyMesh&, const polyMesh&,
const label thisFaceI, const label thisFaceI,
const label neighbourCellI, const label neighbourCellI,
const deltaData& neighbourInfo, const deltaData& neighbourInfo,
const scalar tol const scalar tol,
TrackingData& td
); );
//- Influence of different value on same face. //- Influence of different value on same face.
template<class TrackingData>
inline bool updateFace inline bool updateFace
( (
const polyMesh&, const polyMesh&,
const label thisFaceI, const label thisFaceI,
const deltaData& neighbourInfo, const deltaData& neighbourInfo,
const scalar tol const scalar tol,
TrackingData& td
); );
//- Same (like operator==)
template<class TrackingData>
inline bool equal(const deltaData&, TrackingData& td) const;
// Member Operators // Member Operators
// Needed for List IO // Needed for List IO

View File

@ -30,16 +30,17 @@ namespace Foam
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// Update this with w2 if applicable // Update this with w2 if applicable
template<class TrackingData>
inline bool smoothDelta::deltaData::update inline bool smoothDelta::deltaData::update
( (
const smoothDelta::deltaData& w2, const smoothDelta::deltaData& w2,
const scalar scale, const scalar scale,
const scalar tol const scalar tol,
TrackingData& td
) )
{ {
if (!valid() || (delta_ < VSMALL)) if (!valid(td) || (delta_ < VSMALL))
{ {
// My delta not set. Take over neighbour. // My delta not set. Take over neighbour.
delta_ = w2.delta()/scale; delta_ = w2.delta()/scale;
@ -82,94 +83,120 @@ inline smoothDelta::deltaData::deltaData(const scalar delta)
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline bool smoothDelta::deltaData::valid() const template<class TrackingData>
inline bool smoothDelta::deltaData::valid(TrackingData& td) const
{ {
return delta_ > -SMALL; return delta_ > -SMALL;
} }
// Checks for cyclic faces // Checks for cyclic faces
template<class TrackingData>
inline bool smoothDelta::deltaData::sameGeometry inline bool smoothDelta::deltaData::sameGeometry
( (
const polyMesh&, const polyMesh&,
const deltaData&, const deltaData&,
const scalar const scalar,
TrackingData& td
) const ) const
{ {
return true; return true;
} }
template<class TrackingData>
inline void smoothDelta::deltaData::leaveDomain inline void smoothDelta::deltaData::leaveDomain
( (
const polyMesh&, const polyMesh&,
const polyPatch&, const polyPatch&,
const label, const label,
const point& const point&,
TrackingData& td
) )
{} {}
template<class TrackingData>
inline void smoothDelta::deltaData::transform inline void smoothDelta::deltaData::transform
( (
const polyMesh&, const polyMesh&,
const tensor& const tensor&,
TrackingData& td
) )
{} {}
// Update absolute geometric quantities. // Update absolute geometric quantities.
template<class TrackingData>
inline void smoothDelta::deltaData::enterDomain inline void smoothDelta::deltaData::enterDomain
( (
const polyMesh&, const polyMesh&,
const polyPatch&, const polyPatch&,
const label, const label,
const point& const point&,
TrackingData& td
) )
{} {}
// Update this (cellI) with face information. // Update this (cellI) with face information.
template<class TrackingData>
inline bool smoothDelta::deltaData::updateCell inline bool smoothDelta::deltaData::updateCell
( (
const polyMesh&, const polyMesh&,
const label, const label,
const label, const label,
const deltaData& neighbourWallInfo, const deltaData& neighbourWallInfo,
const scalar tol const scalar tol,
TrackingData& td
) )
{ {
// Take over info from face if more than deltaRatio larger. // Take over info from face if more than deltaRatio larger.
return update(neighbourWallInfo, maxDeltaRatio, tol); return update(neighbourWallInfo, td, tol, td);
} }
// Update this (face) with cell information. // Update this (face) with cell information.
template<class TrackingData>
inline bool smoothDelta::deltaData::updateFace inline bool smoothDelta::deltaData::updateFace
( (
const polyMesh&, const polyMesh&,
const label, const label,
const label, const label,
const deltaData& neighbourWallInfo, const deltaData& neighbourWallInfo,
const scalar tol const scalar tol,
TrackingData& td
) )
{ {
// Take over information from cell without any scaling (scale = 1.0) // Take over information from cell without any scaling (scale = 1.0)
return update(neighbourWallInfo, 1.0, tol); return update(neighbourWallInfo, 1.0, tol, td);
} }
// Update this (face) with coupled face information. // Update this (face) with coupled face information.
template<class TrackingData>
inline bool smoothDelta::deltaData::updateFace inline bool smoothDelta::deltaData::updateFace
( (
const polyMesh&, const polyMesh&,
const label, const label,
const deltaData& neighbourWallInfo, const deltaData& neighbourWallInfo,
const scalar tol const scalar tol,
TrackingData& td
) )
{ {
// Take over information from coupled face without any scaling (scale = 1.0) // Take over information from coupled face without any scaling (scale = 1.0)
return update(neighbourWallInfo, 1.0, tol); return update(neighbourWallInfo, 1.0, tol, td);
}
template <class TrackingData>
inline bool smoothDelta::deltaData::equal
(
const deltaData& rhs,
TrackingData& td
) const
{
return operator==(rhs);
} }

View File

@ -328,7 +328,7 @@ kOmegaSSTSAS::kOmegaSSTSAS
bound(k_, kMin_); bound(k_, kMin_);
bound(omega_, omegaMin_); bound(omega_, omegaMin_);
updateSubGridScaleFields(magSqr(symm(fvc::grad(U)))); updateSubGridScaleFields(magSqr(2.0*symm(fvc::grad(U))));
printCoeffs(); printCoeffs();
} }
@ -345,7 +345,7 @@ void kOmegaSSTSAS::correct(const tmp<volTensorField>& gradU)
y_.correct(); y_.correct();
} }
volScalarField S2 = magSqr(symm(gradU())); volScalarField S2 = magSqr(2.0*symm(gradU()));
gradU.clear(); gradU.clear();
volVectorField gradK = fvc::grad(k_); volVectorField gradK = fvc::grad(k_);
@ -353,7 +353,7 @@ void kOmegaSSTSAS::correct(const tmp<volTensorField>& gradU)
volScalarField L = sqrt(k_)/(pow025(Cmu_)*omega_); volScalarField L = sqrt(k_)/(pow025(Cmu_)*omega_);
volScalarField CDkOmega = (2.0*alphaOmega2_)*(gradK & gradOmega)/omega_; volScalarField CDkOmega = (2.0*alphaOmega2_)*(gradK & gradOmega)/omega_;
volScalarField F1 = this->F1(CDkOmega); volScalarField F1 = this->F1(CDkOmega);
volScalarField G = nuSgs_*2.0*S2; volScalarField G = nuSgs_*0.5*S2;
// Turbulent kinetic energy equation // Turbulent kinetic energy equation
{ {
@ -388,7 +388,7 @@ void kOmegaSSTSAS::correct(const tmp<volTensorField>& gradU)
- fvm::Sp(fvc::div(phi()), omega_) - fvm::Sp(fvc::div(phi()), omega_)
- fvm::laplacian(DomegaEff(F1), omega_) - fvm::laplacian(DomegaEff(F1), omega_)
== ==
gamma(F1)*2.0*S2 gamma(F1)*0.5*S2
- fvm::Sp(beta(F1)*omega_, omega_) - fvm::Sp(beta(F1)*omega_, omega_)
- fvm::SuSp // cross diffusion term - fvm::SuSp // cross diffusion term
( (

View File

@ -27,7 +27,11 @@ Class
Description Description
kOmegaSSTSAS LES turbulence model for incompressible flows kOmegaSSTSAS LES turbulence model for incompressible flows
Reference: References:
A Scale-Adaptive Simulation Model using Two-Equation Models
AIAA 2005-1095
F. R. Menter and Y. Egorov
DESider A European Effort on Hybrid RANS-LES Modelling: DESider A European Effort on Hybrid RANS-LES Modelling:
Results of the European-Union Funded Project, 2004 - 2007 Results of the European-Union Funded Project, 2004 - 2007
(Notes on Numerical Fluid Mechanics and Multidisciplinary Design). (Notes on Numerical Fluid Mechanics and Multidisciplinary Design).

View File

@ -0,0 +1,13 @@
Stiff chemistry solver validation test cases
gri : GRI-Mech 3.0. CH4 combustion, 53 species, 325 reactions
h2 : H2 combustion, 10 species, 27 reactions
nc7h16 : n-Heptane combustion, 544 species, 2446 reactions
ic8h18 : iso-Octane combustion, 874 species, 3796 reactions
Results interpreted in 'validation' sub-folder, where OpenFOAM results
are compared against those predicted by Senkin (CHEMKIN II)

View File

@ -0,0 +1,3 @@
chemFoam.C
EXE = $(FOAM_USER_APPBIN)/chemFoam

View File

@ -0,0 +1,21 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude \
-I$(LIB_SRC)/ODE/lnInclude\
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
EXE_LIBS = \
-lfiniteVolume \
-lcompressibleRASModels \
-lreactionThermophysicalModels \
-lbasicThermophysicalModels \
-lchemistryModel \
-lODE \
-lthermophysicalFunctions \
-lspecie

View File

@ -0,0 +1,12 @@
{
forAll(Y, specieI)
{
volScalarField& Yi = Y[specieI];
solve
(
fvm::ddt(rho, Yi) - chemistry.RR(specieI),
mesh.solver("Yi")
);
}
}

View File

@ -0,0 +1,91 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
chemFoam
Description
Solver chemistry problems
- designed for use on single cell cases to provide comparison against
other chemistry solvers
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "hCombustionThermo.H"
#include "turbulenceModel.H"
#include "psiChemistryModel.H"
#include "chemistrySolver.H"
#include "OFstream.H"
#include "thermoPhysicsTypes.H"
#include "basicMultiComponentMixture.H"
#include "cellModeller.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createSingleCellMesh.H"
#include "createFields.H"
#include "readInitialConditions.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
{
#include "readControls.H"
#include "setDeltaT.H"
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "solveChemistry.H"
{
#include "YEqn.H"
#include "hEqn.H"
#include "pEqn.H"
}
#include "output.H"
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
}
Info << "Number of steps = " << runTime.timeIndex() << endl;
Info << "End" << nl << endl;
return(0);
}
// ************************************************************************* //

View File

@ -0,0 +1,57 @@
// write base thermo fields - not registered since will be re-read by
// thermo package
Info<< "Creating base fields for time " << runTime.timeName() << endl;
{
volScalarField Ydefault
(
IOobject
(
"Ydefault",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE,
false
),
mesh,
dimensionedScalar("Ydefault", dimless, 1)
);
Ydefault.write();
volScalarField p
(
IOobject
(
"p",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE,
false
),
mesh,
dimensionedScalar("p", dimPressure, p0)
);
p.write();
volScalarField T
(
IOobject
(
"T",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE,
false
),
mesh,
dimensionedScalar("T", dimTemperature, T0)
);
T.write();
}

View File

@ -0,0 +1,84 @@
if (mesh.nCells() != 1)
{
FatalErrorIn(args.executable())
<< "Solver only applicable to single cell cases"
<< exit(FatalError);
}
Info<< "Reading initial conditions.\n" << endl;
IOdictionary initialConditions
(
IOobject
(
"initialConditions",
runTime.constant(),
runTime,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
scalar p0 = readScalar(initialConditions.lookup("p"));
scalar T0 = readScalar(initialConditions.lookup("T"));
#include "createBaseFields.H"
Info<< nl << "Reading thermophysicalProperties" << endl;
autoPtr<psiChemistryModel> pChemistry(psiChemistryModel::New(mesh));
psiChemistryModel& chemistry = pChemistry();
scalar dtChem = refCast<const psiChemistryModel>(chemistry).deltaTChem()[0];
hsCombustionThermo& thermo = chemistry.thermo();
basicMultiComponentMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y();
volScalarField rho
(
IOobject
(
"rho",
runTime.timeName(),
runTime,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
thermo.rho()
);
volScalarField& p = thermo.p();
volScalarField& hs = thermo.hs();
volVectorField U
(
IOobject
(
"U",
runTime.timeName(),
runTime,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedVector("zero", dimVelocity, vector::zero),
p.boundaryField().types()
);
#include "createPhi.H"
Info << "Creating turbulence model.\n" << endl;
autoPtr<compressible::turbulenceModel> turbulence
(
compressible::turbulenceModel::New
(
rho,
U,
phi,
thermo
)
);
OFstream post(args.path()/"chemFoam.out");
post<< "# Time" << token::TAB << "Temperature [K]" << token::TAB
<< "Pressure [Pa]" << endl;

View File

@ -0,0 +1,38 @@
Info<< "Constructing single cell mesh" << nl << endl;
labelList owner(6, 0);
labelList neighbour(0);
pointField points(8);
points[0] = vector(0, 0, 0);
points[1] = vector(1, 0, 0);
points[2] = vector(1, 1, 0);
points[3] = vector(0, 1, 0);
points[4] = vector(0, 0, 1);
points[5] = vector(1, 0, 1);
points[6] = vector(1, 1, 1);
points[7] = vector(0, 1, 1);
const cellModel& hexa = *(cellModeller::lookup("hex"));
faceList faces = hexa.modelFaces();
fvMesh mesh
(
IOobject
(
fvMesh::defaultRegion,
runTime.timeName(),
runTime,
IOobject::NO_READ
),
xferMove<Field<vector> >(points),
faces.xfer(),
owner.xfer(),
neighbour.xfer()
);
List<polyPatch*> patches(1);
patches[0] = new emptyPolyPatch("boundary", 6, 0, 0, mesh.boundaryMesh());
mesh.addFvPatches(patches);

View File

@ -0,0 +1,10 @@
{
if (constProp == "volume")
{
hs[0] = u0 + p[0]/rho[0] + integratedHeat;
}
else
{
hs[0] = hs0 + integratedHeat;
}
}

View File

@ -0,0 +1,11 @@
runTime.write();
Info<< "Sh = " << Sh
<< ", T = " << thermo.T()[0]
<< ", p = " << thermo.p()[0]
<< ", " << Y[0].name() << " = " << Y[0][0]
<< endl;
post<< runTime.value() << token::TAB << thermo.T()[0] << token::TAB
<< thermo.p()[0] << endl;

View File

@ -0,0 +1,9 @@
{
thermo.correct();
rho = thermo.rho();
if (constProp == "volume")
{
p[0] = rho0*R0*thermo.T()[0];
rho[0] = rho0;
}
}

View File

@ -0,0 +1,8 @@
if (runTime.controlDict().lookupOrDefault("suppressSolverInfo", false))
{
lduMatrix::debug = 0;
}
Switch adjustTimeStep(runTime.controlDict().lookup("adjustTimeStep"));
scalar maxDeltaT(readScalar(runTime.controlDict().lookup("maxDeltaT")));

View File

@ -0,0 +1,111 @@
word constProp(initialConditions.lookup("constantProperty"));
if (constProp == "pressure" || constProp == "volume")
{
Info << constProp << " will be held constant." << nl
<< " p = " << p[0] << " [Pa]" << nl
<< " T = " << thermo.T()[0] << " [K] " << nl
<< " rho = " << rho[0] << " [kg/m3]" << nl
<< endl;
}
else
{
FatalError << "in initialConditions, unknown constantProperty type "
<< constProp << nl << " Valid types are: pressure volume."
<< abort(FatalError);
}
word fractionBasis(initialConditions.lookup("fractionBasis"));
if ((fractionBasis != "mass") && (fractionBasis != "mole"))
{
FatalError << "in initialConditions, unknown fractionBasis type " << nl
<< "Valid types are: mass or mole."
<< fractionBasis << abort(FatalError);
}
label nSpecie = Y.size();
PtrList<gasThermoPhysics> specieData(Y.size());
forAll(specieData, i)
{
specieData.set
(
i,
new gasThermoPhysics
(
dynamic_cast<const reactingMixture<gasThermoPhysics>&>
(thermo).speciesData()[i]
)
);
}
scalarList Y0(nSpecie, 0.0);
scalarList X0(nSpecie, 0.0);
dictionary fractions(initialConditions.subDict("fractions"));
if (fractionBasis == "mole")
{
forAll(Y, i)
{
const word& name = Y[i].name();
if (fractions.found(name))
{
X0[i] = readScalar(fractions.lookup(name));
}
}
scalar mw = 0.0;
const scalar mTot = sum(X0);
forAll(Y, i)
{
X0[i] /= mTot;
mw += specieData[i].W()*X0[i];
}
forAll(Y, i)
{
Y0[i] = X0[i]*specieData[i].W()/mw;
}
}
else // mass fraction
{
forAll(Y, i)
{
const word& name = Y[i].name();
if (fractions.found(name))
{
Y0[i] = readScalar(fractions.lookup(name));
}
}
scalar invW = 0.0;
const scalar mTot = sum(Y0);
forAll(Y, i)
{
Y0[i] /= mTot;
invW += Y0[i]/specieData[i].W();
}
const scalar mw = 1.0/invW;
forAll(Y, i)
{
X0[i] = Y0[i]*mw/specieData[i].W();
}
}
scalar hs0 = 0.0;
forAll(Y, i)
{
Y[i] = Y0[i];
hs0 += Y0[i]*specieData[i].Hs(T0);
}
hs = dimensionedScalar("hs", dimEnergy/dimMass, hs0);
thermo.correct();
rho = thermo.rho();
scalar rho0 = rho[0];
scalar u0 = hs0 - p0/rho0;
scalar R0 = p0/(rho0*T0);
scalar integratedHeat = 0.0;

View File

@ -0,0 +1,6 @@
if (adjustTimeStep)
{
runTime.setDeltaT(min(dtChem, maxDeltaT));
Info<< "deltaT = " << runTime.deltaT().value() << endl;
}

View File

@ -0,0 +1,7 @@
dtChem = chemistry.solve
(
runTime.value() - runTime.deltaT().value(),
runTime.deltaT().value()
);
scalar Sh = chemistry.Sh()()[0]/rho[0];
integratedHeat += Sh*runTime.deltaT().value();

View File

@ -0,0 +1,12 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
cleanCase
\rm -rf 0 chemFoam.out validation/OF_vs_CHEMKINII.eps validation/chemkinII
# ----------------------------------------------------------------- end-of-file

View File

@ -0,0 +1,15 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Set application name
application="chemFoam"
runApplication $application
(cd validation && ./Allrun)
# ----------------------------------------------------------------- end-of-file

View File

@ -0,0 +1,489 @@
! GRI-Mech Version 3.0 7/30/99 CHEMKIN-II format
! See README30 file at anonymous FTP site unix.sri.com, directory gri;
! WorldWideWeb home page http://www.me.berkeley.edu/gri_mech/ or
! through http://www.gri.org , under 'Basic Research',
! for additional information, contacts, and disclaimer
ELEMENTS
O H C N AR
END
SPECIES
CH CH2O CH3O H O2 H2 O OH H2O HO2 H2O2
C CH CH2 CH2(S) CH3 CO CO2
HCO CH2OH CH3OH C2H C2H2 C2H3
C2H4 C2H5 C2H6 HCCO CH2CO HCCOH N NH
NH2 NH3 NNH NO NO2 N2O HNO CN
HCN H2CN HCNN HCNO HOCN HNCO NCO N2
AR C3H7 C3H8 CH2CHO CH3CHO
END
REACTIONS
O+H2<=>H+OH 3.870E+04 2.700 6260.00
O+HO2<=>OH+O2 2.000E+13 .000 .00
O+H2O2<=>OH+HO2 9.630E+06 2.000 4000.00
O+CH<=>H+CO 5.700E+13 .000 .00
O+CH2<=>H+HCO 8.000E+13 .000 .00
O+CH2(S)<=>H2+CO 1.500E+13 .000 .00
O+CH2(S)<=>H+HCO 1.500E+13 .000 .00
O+CH3<=>H+CH2O 5.060E+13 .000 .00
O+CH4<=>OH+CH3 1.020E+09 1.500 8600.00
O+HCO<=>OH+CO 3.000E+13 .000 .00
O+HCO<=>H+CO2 3.000E+13 .000 .00
O+CH2O<=>OH+HCO 3.900E+13 .000 3540.00
O+CH2OH<=>OH+CH2O 1.000E+13 .000 .00
O+CH3O<=>OH+CH2O 1.000E+13 .000 .00
O+CH3OH<=>OH+CH2OH 3.880E+05 2.500 3100.00
O+CH3OH<=>OH+CH3O 1.300E+05 2.500 5000.00
O+C2H<=>CH+CO 5.000E+13 .000 .00
O+C2H2<=>H+HCCO 1.350E+07 2.000 1900.00
O+C2H2<=>OH+C2H 4.600E+19 -1.410 28950.00
O+C2H2<=>CO+CH2 6.940E+06 2.000 1900.00
O+C2H3<=>H+CH2CO 3.000E+13 .000 .00
O+C2H4<=>CH3+HCO 1.250E+07 1.830 220.00
O+C2H5<=>CH3+CH2O 2.240E+13 .000 .00
O+C2H6<=>OH+C2H5 8.980E+07 1.920 5690.00
O+HCCO<=>H+2CO 1.000E+14 .000 .00
O+CH2CO<=>OH+HCCO 1.000E+13 .000 8000.00
O+CH2CO<=>CH2+CO2 1.750E+12 .000 1350.00
O2+CO<=>O+CO2 2.500E+12 .000 47800.00
O2+CH2O<=>HO2+HCO 1.000E+14 .000 40000.00
H+2O2<=>HO2+O2 2.080E+19 -1.240 .00
H+O2+H2O<=>HO2+H2O 11.26E+18 -.760 .00
H+O2+N2<=>HO2+N2 2.600E+19 -1.240 .00
H+O2+AR<=>HO2+AR 7.000E+17 -.800 .00
H+O2<=>O+OH 2.650E+16 -.6707 17041.00
2H+H2<=>2H2 9.000E+16 -.600 .00
2H+H2O<=>H2+H2O 6.000E+19 -1.250 .00
2H+CO2<=>H2+CO2 5.500E+20 -2.000 .00
H+HO2<=>O+H2O 3.970E+12 .000 671.00
H+HO2<=>O2+H2 4.480E+13 .000 1068.00
H+HO2<=>2OH 0.840E+14 .000 635.00
H+H2O2<=>HO2+H2 1.210E+07 2.000 5200.00
H+H2O2<=>OH+H2O 1.000E+13 .000 3600.00
H+CH<=>C+H2 1.650E+14 .000 .00
H+CH2(S)<=>CH+H2 3.000E+13 .000 .00
H+CH4<=>CH3+H2 6.600E+08 1.620 10840.00
H+HCO<=>H2+CO 7.340E+13 .000 .00
H+CH2O<=>HCO+H2 5.740E+07 1.900 2742.00
H+CH2OH<=>H2+CH2O 2.000E+13 .000 .00
H+CH2OH<=>OH+CH3 1.650E+11 .650 -284.00
H+CH2OH<=>CH2(S)+H2O 3.280E+13 -.090 610.00
H+CH3O<=>H+CH2OH 4.150E+07 1.630 1924.00
H+CH3O<=>H2+CH2O 2.000E+13 .000 .00
H+CH3O<=>OH+CH3 1.500E+12 .500 -110.00
H+CH3O<=>CH2(S)+H2O 2.620E+14 -.230 1070.00
H+CH3OH<=>CH2OH+H2 1.700E+07 2.100 4870.00
H+CH3OH<=>CH3O+H2 4.200E+06 2.100 4870.00
H+C2H3<=>H2+C2H2 3.000E+13 .000 .00
H+C2H4<=>C2H3+H2 1.325E+06 2.530 12240.00
H+C2H5<=>H2+C2H4 2.000E+12 .000 .00
H+C2H6<=>C2H5+H2 1.150E+08 1.900 7530.00
H+HCCO<=>CH2(S)+CO 1.000E+14 .000 .00
H+CH2CO<=>HCCO+H2 5.000E+13 .000 8000.00
H+CH2CO<=>CH3+CO 1.130E+13 .000 3428.00
H+HCCOH<=>H+CH2CO 1.000E+13 .000 .00
OH+H2<=>H+H2O 2.160E+08 1.510 3430.00
2OH<=>O+H2O 3.570E+04 2.400 -2110.00
OH+HO2<=>O2+H2O 1.450E+13 .000 -500.00
DUPLICATE
OH+H2O2<=>HO2+H2O 2.000E+12 .000 427.00
DUPLICATE
OH+H2O2<=>HO2+H2O 1.700E+18 .000 29410.00
DUPLICATE
OH+C<=>H+CO 5.000E+13 .000 .00
OH+CH<=>H+HCO 3.000E+13 .000 .00
OH+CH2<=>H+CH2O 2.000E+13 .000 .00
OH+CH2<=>CH+H2O 1.130E+07 2.000 3000.00
OH+CH2(S)<=>H+CH2O 3.000E+13 .000 .00
OH+CH3<=>CH2+H2O 5.600E+07 1.600 5420.00
OH+CH3<=>CH2(S)+H2O 6.440E+17 -1.340 1417.00
OH+CH4<=>CH3+H2O 1.000E+08 1.600 3120.00
OH+CO<=>H+CO2 4.760E+07 1.228 70.00
OH+HCO<=>H2O+CO 5.000E+13 .000 .00
OH+CH2O<=>HCO+H2O 3.430E+09 1.180 -447.00
OH+CH2OH<=>H2O+CH2O 5.000E+12 .000 .00
OH+CH3O<=>H2O+CH2O 5.000E+12 .000 .00
OH+CH3OH<=>CH2OH+H2O 1.440E+06 2.000 -840.00
OH+CH3OH<=>CH3O+H2O 6.300E+06 2.000 1500.00
OH+C2H<=>H+HCCO 2.000E+13 .000 .00
OH+C2H2<=>H+CH2CO 2.180E-04 4.500 -1000.00
OH+C2H2<=>H+HCCOH 5.040E+05 2.300 13500.00
OH+C2H2<=>C2H+H2O 3.370E+07 2.000 14000.00
OH+C2H2<=>CH3+CO 4.830E-04 4.000 -2000.00
OH+C2H3<=>H2O+C2H2 5.000E+12 .000 .00
OH+C2H4<=>C2H3+H2O 3.600E+06 2.000 2500.00
OH+C2H6<=>C2H5+H2O 3.540E+06 2.120 870.00
OH+CH2CO<=>HCCO+H2O 7.500E+12 .000 2000.00
2HO2<=>O2+H2O2 1.300E+11 .000 -1630.00
DUPLICATE
2HO2<=>O2+H2O2 4.200E+14 .000 12000.00
DUPLICATE
HO2+CH2<=>OH+CH2O 2.000E+13 .000 .00
HO2+CH3<=>O2+CH4 1.000E+12 .000 .00
HO2+CH3<=>OH+CH3O 3.780E+13 .000 .00
HO2+CO<=>OH+CO2 1.500E+14 .000 23600.00
HO2+CH2O<=>HCO+H2O2 5.600E+06 2.000 12000.00
C+O2<=>O+CO 5.800E+13 .000 576.00
C+CH2<=>H+C2H 5.000E+13 .000 .00
C+CH3<=>H+C2H2 5.000E+13 .000 .00
CH+O2<=>O+HCO 6.710E+13 .000 .00
CH+H2<=>H+CH2 1.080E+14 .000 3110.00
CH+H2O<=>H+CH2O 5.710E+12 .000 -755.00
CH+CH2<=>H+C2H2 4.000E+13 .000 .00
CH+CH3<=>H+C2H3 3.000E+13 .000 .00
CH+CH4<=>H+C2H4 6.000E+13 .000 .00
CH+CO2<=>HCO+CO 1.900E+14 .000 15792.00
CH+CH2O<=>H+CH2CO 9.460E+13 .000 -515.00
CH+HCCO<=>CO+C2H2 5.000E+13 .000 .00
CH2+O2=>OH+H+CO 5.000E+12 .000 1500.00
CH2+H2<=>H+CH3 5.000E+05 2.000 7230.00
2CH2<=>H2+C2H2 1.600E+15 .000 11944.00
CH2+CH3<=>H+C2H4 4.000E+13 .000 .00
CH2+CH4<=>2CH3 2.460E+06 2.000 8270.00
CH2+HCCO<=>C2H3+CO 3.000E+13 .000 .00
CH2(S)+N2<=>CH2+N2 1.500E+13 .000 600.00
CH2(S)+AR<=>CH2+AR 9.000E+12 .000 600.00
CH2(S)+O2<=>H+OH+CO 2.800E+13 .000 .00
CH2(S)+O2<=>CO+H2O 1.200E+13 .000 .00
CH2(S)+H2<=>CH3+H 7.000E+13 .000 .00
CH2(S)+H2O<=>CH2+H2O 3.000E+13 .000 .00
CH2(S)+CH3<=>H+C2H4 1.200E+13 .000 -570.00
CH2(S)+CH4<=>2CH3 1.600E+13 .000 -570.00
CH2(S)+CO<=>CH2+CO 9.000E+12 .000 .00
CH2(S)+CO2<=>CH2+CO2 7.000E+12 .000 .00
CH2(S)+CO2<=>CO+CH2O 1.400E+13 .000 .00
CH2(S)+C2H6<=>CH3+C2H5 4.000E+13 .000 -550.00
CH3+O2<=>O+CH3O 3.560E+13 .000 30480.00
CH3+O2<=>OH+CH2O 2.310E+12 .000 20315.00
CH3+H2O2<=>HO2+CH4 2.450E+04 2.470 5180.00
2CH3<=>H+C2H5 6.840E+12 .100 10600.00
CH3+HCO<=>CH4+CO 2.648E+13 .000 .00
CH3+CH2O<=>HCO+CH4 3.320E+03 2.810 5860.00
CH3+CH3OH<=>CH2OH+CH4 3.000E+07 1.500 9940.00
CH3+CH3OH<=>CH3O+CH4 1.000E+07 1.500 9940.00
CH3+C2H4<=>C2H3+CH4 2.270E+05 2.000 9200.00
CH3+C2H6<=>C2H5+CH4 6.140E+06 1.740 10450.00
HCO+H2O<=>H+CO+H2O 1.500E+18 -1.000 17000.00
HCO+O2<=>HO2+CO 13.45E+12 .000 400.00
CH2OH+O2<=>HO2+CH2O 1.800E+13 .000 900.00
CH3O+O2<=>HO2+CH2O 4.280E-13 7.600 -3530.00
C2H+O2<=>HCO+CO 1.000E+13 .000 -755.00
C2H+H2<=>H+C2H2 5.680E+10 0.900 1993.00
C2H3+O2<=>HCO+CH2O 4.580E+16 -1.390 1015.00
C2H5+O2<=>HO2+C2H4 8.400E+11 .000 3875.00
HCCO+O2<=>OH+2CO 3.200E+12 .000 854.00
2HCCO<=>2CO+C2H2 1.000E+13 .000 .00
N+NO<=>N2+O 2.700E+13 .000 355.00
N+O2<=>NO+O 9.000E+09 1.000 6500.00
N+OH<=>NO+H 3.360E+13 .000 385.00
N2O+O<=>N2+O2 1.400E+12 .000 10810.00
N2O+O<=>2NO 2.900E+13 .000 23150.00
N2O+H<=>N2+OH 3.870E+14 .000 18880.00
N2O+OH<=>N2+HO2 2.000E+12 .000 21060.00
HO2+NO<=>NO2+OH 2.110E+12 .000 -480.00
NO2+O<=>NO+O2 3.900E+12 .000 -240.00
NO2+H<=>NO+OH 1.320E+14 .000 360.00
NH+O<=>NO+H 4.000E+13 .000 .00
NH+H<=>N+H2 3.200E+13 .000 330.00
NH+OH<=>HNO+H 2.000E+13 .000 .00
NH+OH<=>N+H2O 2.000E+09 1.200 .00
NH+O2<=>HNO+O 4.610E+05 2.000 6500.00
NH+O2<=>NO+OH 1.280E+06 1.500 100.00
NH+N<=>N2+H 1.500E+13 .000 .00
NH+H2O<=>HNO+H2 2.000E+13 .000 13850.00
NH+NO<=>N2+OH 2.160E+13 -.230 .00
NH+NO<=>N2O+H 3.650E+14 -.450 .00
NH2+O<=>OH+NH 3.000E+12 .000 .00
NH2+O<=>H+HNO 3.900E+13 .000 .00
NH2+H<=>NH+H2 4.000E+13 .000 3650.00
NH2+OH<=>NH+H2O 9.000E+07 1.500 -460.00
NNH<=>N2+H 3.300E+08 .000 .00
NNH+O2<=>HO2+N2 5.000E+12 .000 .00
NNH+O<=>OH+N2 2.500E+13 .000 .00
NNH+O<=>NH+NO 7.000E+13 .000 .00
NNH+H<=>H2+N2 5.000E+13 .000 .00
NNH+OH<=>H2O+N2 2.000E+13 .000 .00
NNH+CH3<=>CH4+N2 2.500E+13 .000 .00
HNO+O<=>NO+OH 2.500E+13 .000 .00
HNO+H<=>H2+NO 9.000E+11 .720 660.00
HNO+OH<=>NO+H2O 1.300E+07 1.900 -950.00
HNO+O2<=>HO2+NO 1.000E+13 .000 13000.00
CN+O<=>CO+N 7.700E+13 .000 .00
CN+OH<=>NCO+H 4.000E+13 .000 .00
CN+H2O<=>HCN+OH 8.000E+12 .000 7460.00
CN+O2<=>NCO+O 6.140E+12 .000 -440.00
CN+H2<=>HCN+H 2.950E+05 2.450 2240.00
NCO+O<=>NO+CO 2.350E+13 .000 .00
NCO+H<=>NH+CO 5.400E+13 .000 .00
NCO+OH<=>NO+H+CO 0.250E+13 .000 .00
NCO+N<=>N2+CO 2.000E+13 .000 .00
NCO+O2<=>NO+CO2 2.000E+12 .000 20000.00
NCO+NO<=>N2O+CO 1.900E+17 -1.520 740.00
NCO+NO<=>N2+CO2 3.800E+18 -2.000 800.00
HCN+O<=>NCO+H 2.030E+04 2.640 4980.00
HCN+O<=>NH+CO 5.070E+03 2.640 4980.00
HCN+O<=>CN+OH 3.910E+09 1.580 26600.00
HCN+OH<=>HOCN+H 1.100E+06 2.030 13370.00
HCN+OH<=>HNCO+H 4.400E+03 2.260 6400.00
HCN+OH<=>NH2+CO 1.600E+02 2.560 9000.00
H2CN+N<=>N2+CH2 6.000E+13 .000 400.00
C+N2<=>CN+N 6.300E+13 .000 46020.00
CH+N2<=>HCN+N 3.120E+09 0.880 20130.00
CH2+N2<=>HCN+NH 1.000E+13 .000 74000.00
CH2(S)+N2<=>NH+HCN 1.000E+11 .000 65000.00
C+NO<=>CN+O 1.900E+13 .000 .00
C+NO<=>CO+N 2.900E+13 .000 .00
CH+NO<=>HCN+O 4.100E+13 .000 .00
CH+NO<=>H+NCO 1.620E+13 .000 .00
CH+NO<=>N+HCO 2.460E+13 .000 .00
CH2+NO<=>H+HNCO 3.100E+17 -1.380 1270.00
CH2+NO<=>OH+HCN 2.900E+14 -.690 760.00
CH2+NO<=>H+HCNO 3.800E+13 -.360 580.00
CH2(S)+NO<=>H+HNCO 3.100E+17 -1.380 1270.00
CH2(S)+NO<=>OH+HCN 2.900E+14 -.690 760.00
CH2(S)+NO<=>H+HCNO 3.800E+13 -.360 580.00
CH3+NO<=>HCN+H2O 9.600E+13 .000 28800.00
CH3+NO<=>H2CN+OH 1.000E+12 .000 21750.00
HCNN+O<=>CO+H+N2 2.200E+13 .000 .00
HCNN+O<=>HCN+NO 2.000E+12 .000 .00
HCNN+O2<=>O+HCO+N2 1.200E+13 .000 .00
HCNN+OH<=>H+HCO+N2 1.200E+13 .000 .00
HCNN+H<=>CH2+N2 1.000E+14 .000 .00
HNCO+O<=>NH+CO2 9.800E+07 1.410 8500.00
HNCO+O<=>HNO+CO 1.500E+08 1.570 44000.00
HNCO+O<=>NCO+OH 2.200E+06 2.110 11400.00
HNCO+H<=>NH2+CO 2.250E+07 1.700 3800.00
HNCO+H<=>H2+NCO 1.050E+05 2.500 13300.00
HNCO+OH<=>NCO+H2O 3.300E+07 1.500 3600.00
HNCO+OH<=>NH2+CO2 3.300E+06 1.500 3600.00
HCNO+H<=>H+HNCO 2.100E+15 -.690 2850.00
HCNO+H<=>OH+HCN 2.700E+11 .180 2120.00
HCNO+H<=>NH2+CO 1.700E+14 -.750 2890.00
HOCN+H<=>H+HNCO 2.000E+07 2.000 2000.00
HCCO+NO<=>HCNO+CO 0.900E+13 .000 .00
CH3+N<=>H2CN+H 6.100E+14 -.310 290.00
CH3+N<=>HCN+H2 3.700E+12 .150 -90.00
NH3+H<=>NH2+H2 5.400E+05 2.400 9915.00
NH3+OH<=>NH2+H2O 5.000E+07 1.600 955.00
NH3+O<=>NH2+OH 9.400E+06 1.940 6460.00
NH+CO2<=>HNO+CO 1.000E+13 .000 14350.00
CN+NO2<=>NCO+NO 6.160E+15 -0.752 345.00
NCO+NO2<=>N2O+CO2 3.250E+12 .000 -705.00
N+CO2<=>NO+CO 3.000E+12 .000 11300.00
O+CH3=>H+H2+CO 3.370E+13 .000 .00
O+C2H4<=>H+CH2CHO 6.700E+06 1.830 220.00
O+C2H5<=>H+CH3CHO 1.096E+14 .000 .00
OH+HO2<=>O2+H2O 0.500E+16 .000 17330.00
DUPLICATE
OH+CH3=>H2+CH2O 8.000E+09 .500 -1755.00
CH2+O2=>2H+CO2 5.800E+12 .000 1500.00
CH2+O2<=>O+CH2O 2.400E+12 .000 1500.00
CH2+CH2=>2H+C2H2 2.000E+14 .000 10989.00
CH2(S)+H2O=>H2+CH2O 6.820E+10 .250 -935.00
C2H3+O2<=>O+CH2CHO 3.030E+11 .290 11.00
C2H3+O2<=>HO2+C2H2 1.337E+06 1.610 -384.00
O+CH3CHO<=>OH+CH2CHO 2.920E+12 .000 1808.00
O+CH3CHO=>OH+CH3+CO 2.920E+12 .000 1808.00
O2+CH3CHO=>HO2+CH3+CO 3.010E+13 .000 39150.00
H+CH3CHO<=>CH2CHO+H2 2.050E+09 1.160 2405.00
H+CH3CHO=>CH3+H2+CO 2.050E+09 1.160 2405.00
OH+CH3CHO=>CH3+H2O+CO 2.343E+10 0.730 -1113.00
HO2+CH3CHO=>CH3+H2O2+CO 3.010E+12 .000 11923.00
CH3+CH3CHO=>CH3+CH4+CO 2.720E+06 1.770 5920.00
O+CH2CHO=>H+CH2+CO2 1.500E+14 .000 .00
O2+CH2CHO=>OH+CO+CH2O 1.810E+10 .000 .00
O2+CH2CHO=>OH+2HCO 2.350E+10 .000 .00
H+CH2CHO<=>CH3+HCO 2.200E+13 .000 .00
H+CH2CHO<=>CH2CO+H2 1.100E+13 .000 .00
OH+CH2CHO<=>H2O+CH2CO 1.200E+13 .000 .00
OH+CH2CHO<=>HCO+CH2OH 3.010E+13 .000 .00
O+C3H8<=>OH+C3H7 1.930E+05 2.680 3716.00
H+C3H8<=>C3H7+H2 1.320E+06 2.540 6756.00
OH+C3H8<=>C3H7+H2O 3.160E+07 1.800 934.00
C3H7+H2O2<=>HO2+C3H8 3.780E+02 2.720 1500.00
CH3+C3H8<=>C3H7+CH4 0.903E+00 3.650 7154.00
O+C3H7<=>C2H5+CH2O 9.640E+13 .000 .00
H+C3H7<=>CH3+C2H5 4.060E+06 2.190 890.00
OH+C3H7<=>C2H5+CH2OH 2.410E+13 .000 .00
HO2+C3H7<=>O2+C3H8 2.550E+10 0.255 -943.00
HO2+C3H7=>OH+C2H5+CH2O 2.410E+13 .000 .00
CH3+C3H7<=>2C2H5 1.927E+13 -0.320 .00
!
! + M Reactions
!
2O+M<=>O2+M 1.200E+17 -1.000 .00
H2/2.40/ H2O/15.40/ CH4/ 2.00/ CO/ 1.75/ CO2/3.60/ C2H6/ 3.00/ AR/0.83/
O+H+M<=>OH+M 5.000E+17 -1.000 .00
H2/2.00/ H2O/6.00/ CH4/2.00/ CO/1.50/ CO2/2.00/ C2H6/3.00/ AR/0.70/
H+O2+M<=>HO2+M 2.800E+18 -.860 .00
O2/0.00/ H2O/0.00/ CO/0.75/ CO2/1.50/ C2H6/1.50/ N2/0.00/ AR/0.00/
2H+M<=>H2+M 1.000E+18 -1.000 .00
H2/0.00/ H2O/0.00/ CH4/2.00/ CO2/0.00/ C2H6/3.00/ AR/0.63/
! 37
H+OH+M<=>H2O+M 2.200E+22 -2.000 .00
H2/0.73/ H2O/3.65/ CH4/2.00/ C2H6/3.00/ AR/0.38/
! 36
HCO+M<=>H+CO+M 1.870E+17 -1.000 17000.00
H2/2.00/ H2O/0.00/ CH4/2.00/ CO/1.50/ CO2/2.00/ C2H6/3.00/
! 35
NO+O+M<=>NO2+M 1.060E+20 -1.410 .00
H2/2.00/ H2O/6.00/ CH4/2.00/ CO/1.50/ CO2/2.00/ C2H6/3.00/ AR/0.70/
! 34
NNH+M<=>N2+H+M 1.300E+14 -.110 4980.00
H2/2.00/ H2O/6.00/ CH4/2.00/ CO/1.50/ CO2/2.00/ C2H6/3.00/ AR/0.70/
! 33
H+NO+M<=>HNO+M 4.480E+19 -1.320 740.00
H2/2.00/ H2O/6.00/ CH4/2.00/ CO/1.50/ CO2/2.00/ C2H6/3.00/ AR/0.70/
! 32
NCO+M<=>N+CO+M 3.100E+14 .000 54050.00
H2/2.00/ H2O/6.00/ CH4/2.00/ CO/1.50/ CO2/2.00/ C2H6/3.00/ AR/0.70/
! 31
HCN+M<=>H+CN+M 1.040E+29 -3.300 126600.00
H2/2.00/ H2O/6.00/ CH4/2.00/ CO/1.50/ CO2/2.00/ C2H6/3.00/ AR/0.70/
! 30
HNCO+M<=>NH+CO+M 1.180E+16 .000 84720.00
H2/2.00/ H2O/6.00/ CH4/2.00/ CO/1.50/ CO2/2.00/ C2H6/3.00/ AR/ .70/
!
! (+M)
!
! 29
O+CO(+M)<=>CO2(+M) 1.800E+10 .000 2385.00
LOW/ 6.020E+14 .000 3000.00/
H2/2.00/ O2/6.00/ H2O/6.00/ CH4/2.00/ CO/1.50/ CO2/3.50/ C2H6/3.00/ AR/ .50/
! 28
H+CH2(+M)<=>CH3(+M) 6.000E+14 .000 .00
LOW / 1.040E+26 -2.760 1600.00/
TROE/ .5620 91.00 5836.00 8552.00/
H2/2.00/ H2O/6.00/ CH4/2.00/ CO/1.50/ CO2/2.00/ C2H6/3.00/ AR/ .70/
! 27
H+CH3(+M)<=>CH4(+M) 13.90E+15 -.534 536.00
LOW / 2.620E+33 -4.760 2440.00/
TROE/ .7830 74.00 2941.00 6964.00 /
H2/2.00/ H2O/6.00/ CH4/3.00/ CO/1.50/ CO2/2.00/ C2H6/3.00/ AR/ .70/
! 26
H+HCO(+M)<=>CH2O(+M) 1.090E+12 .480 -260.00
LOW / 2.470E+24 -2.570 425.00/
TROE/ .7824 271.00 2755.00 6570.00 /
H2/2.00/ H2O/6.00/ CH4/2.00/ CO/1.50/ CO2/2.00/ C2H6/3.00/ AR/ .70/
! 25
H+CH2O(+M)<=>CH2OH(+M) 5.400E+11 .454 3600.00
LOW / 1.270E+32 -4.820 6530.00/
TROE/ .7187 103.00 1291.00 4160.00 /
H2/2.00/ H2O/6.00/ CH4/2.00/ CO/1.50/ CO2/2.00/ C2H6/3.00/
! 24
H+CH2OH(+M)<=>CH3OH(+M) 1.055E+12 .500 86.00
LOW / 4.360E+31 -4.650 5080.00/
TROE/ .600 100.00 90000.0 10000.0 /
H2/2.00/ H2O/6.00/ CH4/2.00/ CO/1.50/ CO2/2.00/ C2H6/3.00/
! 23
H+CH3O(+M)<=>CH3OH(+M) 2.430E+12 .515 50.00
LOW / 4.660E+41 -7.440 14080.0/
TROE/ .700 100.00 90000.0 10000.00 /
H2/2.00/ H2O/6.00/ CH4/2.00/ CO/1.50/ CO2/2.00/ C2H6/3.00/
! 22
H+C2H(+M)<=>C2H2(+M) 1.000E+17 -1.000 .00
LOW / 3.750E+33 -4.800 1900.00/
TROE/ .6464 132.00 1315.00 5566.00 /
H2/2.00/ H2O/6.00/ CH4/2.00/ CO/1.50/ CO2/2.00/ C2H6/3.00/ AR/ .70/
! 21
H+C2H2(+M)<=>C2H3(+M) 5.600E+12 .000 2400.00
LOW / 3.800E+40 -7.270 7220.00/
TROE/ .7507 98.50 1302.00 4167.00 /
H2/2.00/ H2O/6.00/ CH4/2.00/ CO/1.50/ CO2/2.00/ C2H6/3.00/ AR/ .70/
! 20
H+C2H3(+M)<=>C2H4(+M) 6.080E+12 .270 280.00
LOW / 1.400E+30 -3.860 3320.00/
TROE/ .7820 207.50 2663.00 6095.00 /
H2/2.00/ H2O/6.00/ CH4/2.00/ CO/1.50/ CO2/2.00/ C2H6/3.00/ AR/ .70/
! 19
H+C2H4(+M)<=>C2H5(+M) 0.540E+12 .454 1820.00
LOW / 0.600E+42 -7.620 6970.00/
TROE/ .9753 210.00 984.00 4374.00 /
H2/2.00/ H2O/6.00/ CH4/2.00/ CO/1.50/ CO2/2.00/ C2H6/3.00/ AR/ .70/
! 18
H+C2H5(+M)<=>C2H6(+M) 5.210E+17 -.990 1580.00
LOW / 1.990E+41 -7.080 6685.00/
TROE/ .8422 125.00 2219.00 6882.00 /
H2/2.00/ H2O/6.00/ CH4/2.00/ CO/1.50/ CO2/2.00/ C2H6/3.00/ AR/ .70/
! 17
H2+CO(+M)<=>CH2O(+M) 4.300E+07 1.500 79600.00
LOW / 5.070E+27 -3.420 84350.00/
TROE/ .9320 197.00 1540.00 10300.00 /
H2/2.00/ H2O/6.00/ CH4/2.00/ CO/1.50/ CO2/2.00/ C2H6/3.00/ AR/ .70/
! 16
2OH(+M)<=>H2O2(+M) 7.400E+13 -.370 .00
LOW / 2.300E+18 -.900 -1700.00/
TROE/ .7346 94.00 1756.00 5182.00 /
H2/2.00/ H2O/6.00/ CH4/2.00/ CO/1.50/ CO2/2.00/ C2H6/3.00/ AR/ .70/
! 15
OH+CH3(+M)<=>CH3OH(+M) 2.790E+18 -1.430 1330.00
LOW / 4.000E+36 -5.920 3140.00/
TROE/ .4120 195.0 5900.00 6394.00/
H2/2.00/ H2O/6.00/ CH4/2.00/ CO/1.50/ CO2/2.00/ C2H6/3.00/
! 14
CH+CO(+M)<=>HCCO(+M) 5.000E+13 .000 .00
LOW / 2.690E+28 -3.740 1936.00/
TROE/ .5757 237.00 1652.00 5069.00 /
H2/2.00/ H2O/6.00/ CH4/2.00/ CO/1.50/ CO2/2.00/ C2H6/3.00/ AR/ .70/
! 13
CH2+CO(+M)<=>CH2CO(+M) 8.100E+11 .500 4510.00
LOW / 2.690E+33 -5.110 7095.00/
TROE/ .5907 275.00 1226.00 5185.00 /
H2/2.00/ H2O/6.00/ CH4/2.00/ CO/1.50/ CO2/2.00/ C2H6/3.00/ AR/ .70/
! 12
CH2(S)+H2O(+M)<=>CH3OH(+M) 4.820E+17 -1.160 1145.00
LOW / 1.880E+38 -6.360 5040.00/
TROE/ .6027 208.00 3922.00 10180.0 /
H2/2.00/ H2O/6.00/ CH4/2.00/ CO/1.50/ CO2/2.00/ C2H6/3.00/
! 11
2CH3(+M)<=>C2H6(+M) 6.770E+16 -1.180 654.00
LOW / 3.400E+41 -7.030 2762.00/
TROE/ .6190 73.20 1180.00 9999.00 /
H2/2.00/ H2O/6.00/ CH4/2.00/ CO/1.50/ CO2/2.00/ C2H6/3.00/ AR/ .70/
! 10
C2H4(+M)<=>H2+C2H2(+M) 8.000E+12 .440 86770.00
LOW / 1.580E+51 -9.300 97800.00/
TROE/ .7345 180.00 1035.00 5417.00 /
H2/2.00/ H2O/6.00/ CH4/2.00/ CO/1.50/ CO2/2.00/ C2H6/3.00/ AR/ .70/
! 9
N2O(+M)<=>N2+O(+M) 7.910E+10 .000 56020.00
LOW / 6.370E+14 .000 56640.00/
H2/2.00/ H2O/6.00/ CH4/2.00/ CO/1.50/ CO2/2.00/ C2H6/3.00/ AR/ .625/
! 8
H+HCN(+M)<=>H2CN(+M) 3.300E+13 .000 .00
LOW / 1.400E+26 -3.400 1900.00/
H2/2.00/ H2O/6.00/ CH4/2.00/ CO/1.50/ CO2/2.00/ C2H6/3.00/ AR/ .70/
! 7
CH+N2(+M)<=>HCNN(+M) 3.100E+12 .150 .00
LOW / 1.300E+25 -3.160 740.00/
TROE/ .6670 235.00 2117.00 4536.00 /
H2/2.00/ H2O/6.00/ CH4/2.00/ CO/1.50/ CO2/2.00/ C2H6/3.00/ AR/ 1.0/
! 6
CH+H2(+M)<=>CH3(+M) 1.970E+12 .430 -370.00
LOW/ 4.820E+25 -2.80 590.0 /
TROE/ .578 122.0 2535.0 9365.0 /
H2/2.00/ H2O/6.00/ CH4/2.00/ CO/1.50/ CO2/2.00/ C2H6/3.00/ AR/ .70/
! 5
H+CH2CO(+M)<=>CH2CHO(+M) 4.865E+11 0.422 -1755.00
LOW/ 1.012E+42 -7.63 3854.0/
TROE/ 0.465 201.0 1773.0 5333.0 /
H2/2.00/ H2O/6.00/ CH4/2.00/ CO/1.50/ CO2/2.00/ C2H6/3.00/ AR/ .70/
! 4
CH3+C2H5(+M)<=>C3H8(+M) .9430E+13 .000 .00
LOW/ 2.710E+74 -16.82 13065.0 /
TROE/ .1527 291.0 2742.0 7748.0 /
H2/2.00/ H2O/6.00/ CH4/2.00/ CO/1.50/ CO2/2.00/ C2H6/3.00/ AR/ .70/
! 3
CH3+C2H4(+M)<=>C3H7(+M) 2.550E+06 1.600 5700.00
LOW/ 3.00E+63 -14.6 18170./
TROE/ .1894 277.0 8748.0 7891.0 /
H2/2.00/ H2O/6.00/ CH4/2.00/ CO/1.50/ CO2/2.00/ C2H6/3.00/ AR/ .70/
! 2
H+C3H7(+M)<=>C3H8(+M) 3.613E+13 .000 .00
LOW/ 4.420E+61 -13.545 11357.0/
TROE/ .315 369.0 3285.0 6667.0 /
H2/2.00/ H2O/6.00/ CH4/2.00/ CO/1.50/ CO2/2.00/ C2H6/3.00/ AR/ .70/
! 1
H+CH2O(+M)<=>CH3O(+M) 5.400E+11 .454 2600.00
LOW / 2.200E+30 -4.800 5560.00/
TROE/ .7580 94.00 1555.00 4200.00 /
H2/2.00/ H2O/6.00/ CH4/2.00/ CO/1.50/ CO2/2.00/ C2H6/3.00/
END

View File

@ -0,0 +1,12 @@
!SENS
CONP
PRES 13.500 ! atm
TEMP 1000.0 ! K
TIME 7.0e-2 ! sec
DELT 1.E-5 ! sec
REAC CH4 0.5
REAC O2 1.0
REAC N2 3.76
!REAC H 0.1;
!REAC H2O 0.1;
END

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,222 @@
THERMO ALL
300.000 1000.000 5000.000
! GRI-Mech Version 3.0 Thermodynamics released 7/30/99
! NASA Polynomial format for CHEMKIN-II
! see README file for disclaimer
O L 1/90O 1 G 200.000 3500.000 1000.000 1
2.56942078E+00-8.59741137E-05 4.19484589E-08-1.00177799E-11 1.22833691E-15 2
2.92175791E+04 4.78433864E+00 3.16826710E+00-3.27931884E-03 6.64306396E-06 3
-6.12806624E-09 2.11265971E-12 2.91222592E+04 2.05193346E+00 4
O2 TPIS89O 2 G 200.000 3500.000 1000.000 1
3.28253784E+00 1.48308754E-03-7.57966669E-07 2.09470555E-10-2.16717794E-14 2
-1.08845772E+03 5.45323129E+00 3.78245636E+00-2.99673416E-03 9.84730201E-06 3
-9.68129509E-09 3.24372837E-12-1.06394356E+03 3.65767573E+00 4
H L 7/88H 1 G 200.000 3500.000 1000.000 1
2.50000001E+00-2.30842973E-11 1.61561948E-14-4.73515235E-18 4.98197357E-22 2
2.54736599E+04-4.46682914E-01 2.50000000E+00 7.05332819E-13-1.99591964E-15 3
2.30081632E-18-9.27732332E-22 2.54736599E+04-4.46682853E-01 4
H2 TPIS78H 2 G 200.000 3500.000 1000.000 1
3.33727920E+00-4.94024731E-05 4.99456778E-07-1.79566394E-10 2.00255376E-14 2
-9.50158922E+02-3.20502331E+00 2.34433112E+00 7.98052075E-03-1.94781510E-05 3
2.01572094E-08-7.37611761E-12-9.17935173E+02 6.83010238E-01 4
OH RUS 78O 1H 1 G 200.000 3500.000 1000.000 1
3.09288767E+00 5.48429716E-04 1.26505228E-07-8.79461556E-11 1.17412376E-14 2
3.85865700E+03 4.47669610E+00 3.99201543E+00-2.40131752E-03 4.61793841E-06 3
-3.88113333E-09 1.36411470E-12 3.61508056E+03-1.03925458E-01 4
H2O L 8/89H 2O 1 G 200.000 3500.000 1000.000 1
3.03399249E+00 2.17691804E-03-1.64072518E-07-9.70419870E-11 1.68200992E-14 2
-3.00042971E+04 4.96677010E+00 4.19864056E+00-2.03643410E-03 6.52040211E-06 3
-5.48797062E-09 1.77197817E-12-3.02937267E+04-8.49032208E-01 4
HO2 L 5/89H 1O 2 G 200.000 3500.000 1000.000 1
4.01721090E+00 2.23982013E-03-6.33658150E-07 1.14246370E-10-1.07908535E-14 2
1.11856713E+02 3.78510215E+00 4.30179801E+00-4.74912051E-03 2.11582891E-05 3
-2.42763894E-08 9.29225124E-12 2.94808040E+02 3.71666245E+00 4
H2O2 L 7/88H 2O 2 G 200.000 3500.000 1000.000 1
4.16500285E+00 4.90831694E-03-1.90139225E-06 3.71185986E-10-2.87908305E-14 2
-1.78617877E+04 2.91615662E+00 4.27611269E+00-5.42822417E-04 1.67335701E-05 3
-2.15770813E-08 8.62454363E-12-1.77025821E+04 3.43505074E+00 4
C L11/88C 1 G 200.000 3500.000 1000.000 1
2.49266888E+00 4.79889284E-05-7.24335020E-08 3.74291029E-11-4.87277893E-15 2
8.54512953E+04 4.80150373E+00 2.55423955E+00-3.21537724E-04 7.33792245E-07 3
-7.32234889E-10 2.66521446E-13 8.54438832E+04 4.53130848E+00 4
CH TPIS79C 1H 1 G 200.000 3500.000 1000.000 1
2.87846473E+00 9.70913681E-04 1.44445655E-07-1.30687849E-10 1.76079383E-14 2
7.10124364E+04 5.48497999E+00 3.48981665E+00 3.23835541E-04-1.68899065E-06 3
3.16217327E-09-1.40609067E-12 7.07972934E+04 2.08401108E+00 4
CH2 L S/93C 1H 2 G 200.000 3500.000 1000.000 1
2.87410113E+00 3.65639292E-03-1.40894597E-06 2.60179549E-10-1.87727567E-14 2
4.62636040E+04 6.17119324E+00 3.76267867E+00 9.68872143E-04 2.79489841E-06 3
-3.85091153E-09 1.68741719E-12 4.60040401E+04 1.56253185E+00 4
CH2(S) L S/93C 1H 2 G 200.000 3500.000 1000.000 1
2.29203842E+00 4.65588637E-03-2.01191947E-06 4.17906000E-10-3.39716365E-14 2
5.09259997E+04 8.62650169E+00 4.19860411E+00-2.36661419E-03 8.23296220E-06 3
-6.68815981E-09 1.94314737E-12 5.04968163E+04-7.69118967E-01 4
CH3 L11/89C 1H 3 G 200.000 3500.000 1000.000 1
2.28571772E+00 7.23990037E-03-2.98714348E-06 5.95684644E-10-4.67154394E-14 2
1.67755843E+04 8.48007179E+00 3.67359040E+00 2.01095175E-03 5.73021856E-06 3
-6.87117425E-09 2.54385734E-12 1.64449988E+04 1.60456433E+00 4
CH4 L 8/88C 1H 4 G 200.000 3500.000 1000.000 1
7.48514950E-02 1.33909467E-02-5.73285809E-06 1.22292535E-09-1.01815230E-13 2
-9.46834459E+03 1.84373180E+01 5.14987613E+00-1.36709788E-02 4.91800599E-05 3
-4.84743026E-08 1.66693956E-11-1.02466476E+04-4.64130376E+00 4
CO TPIS79C 1O 1 G 200.000 3500.000 1000.000 1
2.71518561E+00 2.06252743E-03-9.98825771E-07 2.30053008E-10-2.03647716E-14 2
-1.41518724E+04 7.81868772E+00 3.57953347E+00-6.10353680E-04 1.01681433E-06 3
9.07005884E-10-9.04424499E-13-1.43440860E+04 3.50840928E+00 4
CO2 L 7/88C 1O 2 G 200.000 3500.000 1000.000 1
3.85746029E+00 4.41437026E-03-2.21481404E-06 5.23490188E-10-4.72084164E-14 2
-4.87591660E+04 2.27163806E+00 2.35677352E+00 8.98459677E-03-7.12356269E-06 3
2.45919022E-09-1.43699548E-13-4.83719697E+04 9.90105222E+00 4
HCO L12/89H 1C 1O 1 G 200.000 3500.000 1000.000 1
2.77217438E+00 4.95695526E-03-2.48445613E-06 5.89161778E-10-5.33508711E-14 2
4.01191815E+03 9.79834492E+00 4.22118584E+00-3.24392532E-03 1.37799446E-05 3
-1.33144093E-08 4.33768865E-12 3.83956496E+03 3.39437243E+00 4
CH2O L 8/88H 2C 1O 1 G 200.000 3500.000 1000.000 1
1.76069008E+00 9.20000082E-03-4.42258813E-06 1.00641212E-09-8.83855640E-14 2
-1.39958323E+04 1.36563230E+01 4.79372315E+00-9.90833369E-03 3.73220008E-05 3
-3.79285261E-08 1.31772652E-11-1.43089567E+04 6.02812900E-01 4
CH2OH GUNL93C 1H 3O 1 G 200.000 3500.000 1000.000 1
3.69266569E+00 8.64576797E-03-3.75101120E-06 7.87234636E-10-6.48554201E-14 2
-3.24250627E+03 5.81043215E+00 3.86388918E+00 5.59672304E-03 5.93271791E-06 3
-1.04532012E-08 4.36967278E-12-3.19391367E+03 5.47302243E+00 4
CH3O 121686C 1H 3O 1 G 200.00 3000.00 1000.000 1
0.03770799E+02 0.07871497E-01-0.02656384E-04 0.03944431E-08-0.02112616E-12 2
0.12783252E+03 0.02929575E+02 0.02106204E+02 0.07216595E-01 0.05338472E-04 3
-0.07377636E-07 0.02075610E-10 0.09786011E+04 0.13152177E+02 4
CH3OH L 8/88C 1H 4O 1 G 200.000 3500.000 1000.000 1
1.78970791E+00 1.40938292E-02-6.36500835E-06 1.38171085E-09-1.17060220E-13 2
-2.53748747E+04 1.45023623E+01 5.71539582E+00-1.52309129E-02 6.52441155E-05 3
-7.10806889E-08 2.61352698E-11-2.56427656E+04-1.50409823E+00 4
C2H L 1/91C 2H 1 G 200.000 3500.000 1000.000 1
3.16780652E+00 4.75221902E-03-1.83787077E-06 3.04190252E-10-1.77232770E-14 2
6.71210650E+04 6.63589475E+00 2.88965733E+00 1.34099611E-02-2.84769501E-05 3
2.94791045E-08-1.09331511E-11 6.68393932E+04 6.22296438E+00 4
C2H2 L 1/91C 2H 2 G 200.000 3500.000 1000.000 1
4.14756964E+00 5.96166664E-03-2.37294852E-06 4.67412171E-10-3.61235213E-14 2
2.59359992E+04-1.23028121E+00 8.08681094E-01 2.33615629E-02-3.55171815E-05 3
2.80152437E-08-8.50072974E-12 2.64289807E+04 1.39397051E+01 4
C2H3 L 2/92C 2H 3 G 200.000 3500.000 1000.000 1
3.01672400E+00 1.03302292E-02-4.68082349E-06 1.01763288E-09-8.62607041E-14 2
3.46128739E+04 7.78732378E+00 3.21246645E+00 1.51479162E-03 2.59209412E-05 3
-3.57657847E-08 1.47150873E-11 3.48598468E+04 8.51054025E+00 4
C2H4 L 1/91C 2H 4 G 200.000 3500.000 1000.000 1
2.03611116E+00 1.46454151E-02-6.71077915E-06 1.47222923E-09-1.25706061E-13 2
4.93988614E+03 1.03053693E+01 3.95920148E+00-7.57052247E-03 5.70990292E-05 3
-6.91588753E-08 2.69884373E-11 5.08977593E+03 4.09733096E+00 4
C2H5 L12/92C 2H 5 G 200.000 3500.000 1000.000 1
1.95465642E+00 1.73972722E-02-7.98206668E-06 1.75217689E-09-1.49641576E-13 2
1.28575200E+04 1.34624343E+01 4.30646568E+00-4.18658892E-03 4.97142807E-05 3
-5.99126606E-08 2.30509004E-11 1.28416265E+04 4.70720924E+00 4
C2H6 L 8/88C 2H 6 G 200.000 3500.000 1000.000 1
1.07188150E+00 2.16852677E-02-1.00256067E-05 2.21412001E-09-1.90002890E-13 2
-1.14263932E+04 1.51156107E+01 4.29142492E+00-5.50154270E-03 5.99438288E-05 3
-7.08466285E-08 2.68685771E-11-1.15222055E+04 2.66682316E+00 4
CH2CO L 5/90C 2H 2O 1 G 200.000 3500.000 1000.000 1
4.51129732E+00 9.00359745E-03-4.16939635E-06 9.23345882E-10-7.94838201E-14 2
-7.55105311E+03 6.32247205E-01 2.13583630E+00 1.81188721E-02-1.73947474E-05 3
9.34397568E-09-2.01457615E-12-7.04291804E+03 1.22156480E+01 4
HCCO SRIC91H 1C 2O 1 G 200.00 4000.00 1000.000 1
0.56282058E+01 0.40853401E-02-0.15934547E-05 0.28626052E-09-0.19407832E-13 2
0.19327215E+05-0.39302595E+01 0.22517214E+01 0.17655021E-01-0.23729101E-04 3
0.17275759E-07-0.50664811E-11 0.20059449E+05 0.12490417E+02 4
HCCOH SRI91C 2O 1H 2 G 200.000 5000.000 1000.000 1
0.59238291E+01 0.67923600E-02-0.25658564E-05 0.44987841E-09-0.29940101E-13 2
0.72646260E+04-0.76017742E+01 0.12423733E+01 0.31072201E-01-0.50866864E-04 3
0.43137131E-07-0.14014594E-10 0.80316143E+04 0.13874319E+02 4
H2CN 41687H 2C 1N 1 G 200.00 4000.000 1000.000 1
0.52097030E+01 0.29692911E-02-0.28555891E-06-0.16355500E-09 0.30432589E-13 2
0.27677109E+05-0.44444780E+01 0.28516610E+01 0.56952331E-02 0.10711400E-05 3
-0.16226120E-08-0.23511081E-12 0.28637820E+05 0.89927511E+01 4
HCN GRI/98H 1C 1N 1 G 200.000 6000.000 1000.000 1
0.38022392E+01 0.31464228E-02-0.10632185E-05 0.16619757E-09-0.97997570E-14 2
0.14407292E+05 0.15754601E+01 0.22589886E+01 0.10051170E-01-0.13351763E-04 3
0.10092349E-07-0.30089028E-11 0.14712633E+05 0.89164419E+01 4
HNO And93 H 1N 1O 1 G 200.000 6000.000 1000.000 1
0.29792509E+01 0.34944059E-02-0.78549778E-06 0.57479594E-10-0.19335916E-15 2
0.11750582E+05 0.86063728E+01 0.45334916E+01-0.56696171E-02 0.18473207E-04 3
-0.17137094E-07 0.55454573E-11 0.11548297E+05 0.17498417E+01 4
N L 6/88N 1 G 200.000 6000.000 1000.000 1
0.24159429E+01 0.17489065E-03-0.11902369E-06 0.30226245E-10-0.20360982E-14 2
0.56133773E+05 0.46496096E+01 0.25000000E+01 0.00000000E+00 0.00000000E+00 3
0.00000000E+00 0.00000000E+00 0.56104637E+05 0.41939087E+01 4
NNH T07/93N 2H 1 G 200.000 6000.000 1000.000 1
0.37667544E+01 0.28915082E-02-0.10416620E-05 0.16842594E-09-0.10091896E-13 2
0.28650697E+05 0.44705067E+01 0.43446927E+01-0.48497072E-02 0.20059459E-04 3
-0.21726464E-07 0.79469539E-11 0.28791973E+05 0.29779410E+01 4
N2O L 7/88N 2O 1 G 200.000 6000.000 1000.000 1
0.48230729E+01 0.26270251E-02-0.95850874E-06 0.16000712E-09-0.97752303E-14 2
0.80734048E+04-0.22017207E+01 0.22571502E+01 0.11304728E-01-0.13671319E-04 3
0.96819806E-08-0.29307182E-11 0.87417744E+04 0.10757992E+02 4
NH And94 N 1H 1 G 200.000 6000.000 1000.000 1
0.27836928E+01 0.13298430E-02-0.42478047E-06 0.78348501E-10-0.55044470E-14 2
0.42120848E+05 0.57407799E+01 0.34929085E+01 0.31179198E-03-0.14890484E-05 3
0.24816442E-08-0.10356967E-11 0.41880629E+05 0.18483278E+01 4
NH2 And89 N 1H 2 G 200.000 6000.000 1000.000 1
0.28347421E+01 0.32073082E-02-0.93390804E-06 0.13702953E-09-0.79206144E-14 2
0.22171957E+05 0.65204163E+01 0.42040029E+01-0.21061385E-02 0.71068348E-05 3
-0.56115197E-08 0.16440717E-11 0.21885910E+05-0.14184248E+00 4
NH3 J 6/77N 1H 3 G 200.000 6000.000 1000.000 1
0.26344521E+01 0.56662560E-02-0.17278676E-05 0.23867161E-09-0.12578786E-13 2
-0.65446958E+04 0.65662928E+01 0.42860274E+01-0.46605230E-02 0.21718513E-04 3
-0.22808887E-07 0.82638046E-11-0.67417285E+04-0.62537277E+00 4
NO RUS 78N 1O 1 G 200.000 6000.000 1000.000 1
0.32606056E+01 0.11911043E-02-0.42917048E-06 0.69457669E-10-0.40336099E-14 2
0.99209746E+04 0.63693027E+01 0.42184763E+01-0.46389760E-02 0.11041022E-04 3
-0.93361354E-08 0.28035770E-11 0.98446230E+04 0.22808464E+01 4
NO2 L 7/88N 1O 2 G 200.000 6000.000 1000.000 1
0.48847542E+01 0.21723956E-02-0.82806906E-06 0.15747510E-09-0.10510895E-13 2
0.23164983E+04-0.11741695E+00 0.39440312E+01-0.15854290E-02 0.16657812E-04 3
-0.20475426E-07 0.78350564E-11 0.28966179E+04 0.63119917E+01 4
HCNO BDEA94H 1N 1C 1O 1G 200.000 5000.000 1382.000 1
6.59860456E+00 3.02778626E-03-1.07704346E-06 1.71666528E-10-1.01439391E-14 2
1.79661339E+04-1.03306599E+01 2.64727989E+00 1.27505342E-02-1.04794236E-05 3
4.41432836E-09-7.57521466E-13 1.92990252E+04 1.07332972E+01 4
HOCN BDEA94H 1N 1C 1O 1G 200.000 5000.000 1368.000 1
5.89784885E+00 3.16789393E-03-1.11801064E-06 1.77243144E-10-1.04339177E-14 2
-3.70653331E+03-6.18167825E+00 3.78604952E+00 6.88667922E-03-3.21487864E-06 3
5.17195767E-10 1.19360788E-14-2.82698400E+03 5.63292162E+00 4
HNCO BDEA94H 1N 1C 1O 1G 200.000 5000.000 1478.000 1
6.22395134E+00 3.17864004E-03-1.09378755E-06 1.70735163E-10-9.95021955E-15 2
-1.66599344E+04-8.38224741E+00 3.63096317E+00 7.30282357E-03-2.28050003E-06 3
-6.61271298E-10 3.62235752E-13-1.55873636E+04 6.19457727E+00 4
NCO EA 93 N 1C 1O 1 G 200.000 6000.000 1000.000 1
0.51521845E+01 0.23051761E-02-0.88033153E-06 0.14789098E-09-0.90977996E-14 2
0.14004123E+05-0.25442660E+01 0.28269308E+01 0.88051688E-02-0.83866134E-05 3
0.48016964E-08-0.13313595E-11 0.14682477E+05 0.95504646E+01 4
CN HBH92 C 1N 1 G 200.000 6000.000 1000.000 1
0.37459805E+01 0.43450775E-04 0.29705984E-06-0.68651806E-10 0.44134173E-14 2
0.51536188E+05 0.27867601E+01 0.36129351E+01-0.95551327E-03 0.21442977E-05 3
-0.31516323E-09-0.46430356E-12 0.51708340E+05 0.39804995E+01 4
HCNN SRI/94C 1N 2H 1 G 200.000 5000.000 1000.000 1
0.58946362E+01 0.39895959E-02-0.15982380E-05 0.29249395E-09-0.20094686E-13 2
0.53452941E+05-0.51030502E+01 0.25243194E+01 0.15960619E-01-0.18816354E-04 3
0.12125540E-07-0.32357378E-11 0.54261984E+05 0.11675870E+02 4
N2 121286N 2 G 200.000 5000.000 1000.000 1
0.02926640E+02 0.14879768E-02-0.05684760E-05 0.10097038E-09-0.06753351E-13 2
-0.09227977E+04 0.05980528E+02 0.03298677E+02 0.14082404E-02-0.03963222E-04 3
0.05641515E-07-0.02444854E-10-0.10208999E+04 0.03950372E+02 4
AR 120186AR 1 G 200.000 5000.000 1000.000 1
0.02500000E+02 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 2
-0.07453750E+04 0.04366000E+02 0.02500000E+02 0.00000000E+00 0.00000000E+00 3
0.00000000E+00 0.00000000E+00-0.07453750E+04 0.04366000E+02 4
C3H8 L 4/85C 3H 8 G 200.000 5000.000 1000.000 1
0.75341368E+01 0.18872239E-01-0.62718491E-05 0.91475649E-09-0.47838069E-13 2
-0.16467516E+05-0.17892349E+02 0.93355381E+00 0.26424579E-01 0.61059727E-05 3
-0.21977499E-07 0.95149253E-11-0.13958520E+05 0.19201691E+02 4
C3H7 L 9/84C 3H 7 G 200.000 5000.000 1000.000 1
0.77026987E+01 0.16044203E-01-0.52833220E-05 0.76298590E-09-0.39392284E-13 2
0.82984336E+04-0.15480180E+02 0.10515518E+01 0.25991980E-01 0.23800540E-05 3
-0.19609569E-07 0.93732470E-11 0.10631863E+05 0.21122559E+02 4
CH3CHO L 8/88C 2H 4O 1 G 200.000 6000.000 1000.000 1
0.54041108E+01 0.11723059E-01-0.42263137E-05 0.68372451E-09-0.40984863E-13 2
-0.22593122E+05-0.34807917E+01 0.47294595E+01-0.31932858E-02 0.47534921E-04 3
-0.57458611E-07 0.21931112E-10-0.21572878E+05 0.41030159E+01 4
CH2CHO SAND86O 1H 3C 2 G 200.000 5000.000 1000.000 1
0.05975670E+02 0.08130591E-01-0.02743624E-04 0.04070304E-08-0.02176017E-12 2
0.04903218E+04-0.05045251E+02 0.03409062E+02 0.10738574E-01 0.01891492E-04 3
-0.07158583E-07 0.02867385E-10 0.15214766E+04 0.09558290E+02 4
END

View File

@ -0,0 +1,33 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object chemistryProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
psiChemistryModel ODEChemistryModel<gasThermoPhysics>;
chemistry on;
initialChemicalTimeStep 1e-10;
chemistrySolver ode;
odeCoeffs
{
ODESolver SIBS;
eps 0.01;
}
// ************************************************************************* //

View File

@ -0,0 +1,34 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object initialConditions;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
constantProperty pressure;
fractionBasis mole;
fractions
{
CH4 0.5;
N2 3.76;
O2 1;
}
p 1.36789e+06;
T 1000;
// ************************************************************************* //

View File

@ -0,0 +1,25 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object thermophysicalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
thermoType hsPsiMixtureThermo<reactingMixture<gasThermoPhysics>>;
CHEMKINFile "$FOAM_CASE/chemkin/chem.inp";
CHEMKINThermoFile "$FOAM_CASE/chemkin/therm.dat";
// ************************************************************************* //

View File

@ -0,0 +1,21 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType laminar;
// ************************************************************************* //

View File

@ -0,0 +1,53 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application chemFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 0.07;
deltaT 1e-05;
maxDeltaT 1e-4;
adjustTimeStep on;
writeControl adjustableRunTime;
writeInterval 0.01;
purgeWrite 0;
writeFormat ascii;
writeCompression uncompressed;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;
suppressSolverInfo yes;
// ************************************************************************* //

View File

@ -0,0 +1,36 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default Euler;
}
gradSchemes
{}
divSchemes
{}
laplacianSchemes
{}
fluxRequired
{}
// ************************************************************************* //

View File

@ -0,0 +1,30 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
Yi
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-12;
relTol 0;
}
}
// ************************************************************************* //

Some files were not shown because too many files have changed in this diff Show More