Commit 7b3da686 authored by Andrew Heather's avatar Andrew Heather
Browse files
parents 69215358 ed37aaaf
......@@ -26,8 +26,13 @@ Application
coalChemistryFoam
Description
Transient solver for compressible, turbulent flow with coal and
limestone parcel injections, and combustion.
Transient solver for:
- compressible,
- turbulent flow,
with
- coal and limestone parcel injections,
- energy source, and
- combustion.
\*---------------------------------------------------------------------------*/
......@@ -38,7 +43,7 @@ Description
#include "CoalCloud.H"
#include "psiChemistryModel.H"
#include "chemistrySolver.H"
#include "timeActivatedExplicitCellSource.H"
#include "timeActivatedExplicitSource.H"
#include "radiationModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -127,10 +127,11 @@
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p)
);
Info<< "\nConstructing explicit enthalpy cell source" << endl;
timeActivatedExplicitCellSource enthalpySource
Info<< "\nConstructing explicit enthalpy source" << endl;
scalarTimeActivatedExplicitSourceList enthalpySource
(
"enthalpySource",
"energy",
mesh,
h.dimensions()*phi.dimensions()/mesh.V().dimensions()
dimEnergy/dimTime/dimVolume,
"h"
);
......@@ -7,6 +7,7 @@
==
rho.dimensionedInternalField()*g
+ parcels.SU()
+ momentumSource.Su()
);
pZones.addResistance(UEqn);
......
......@@ -28,7 +28,7 @@ tmp<fv::convectionScheme<scalar> > mvConvection
==
parcels.Srho(i)
+ kappa*chemistry.RR(i)().dimensionedInternalField()
+ pointMassSources.Su(i),
+ massSource.Su(i),
mesh.solver("Yi")
);
......
Info<< "\nConstructing reacting cloud" << endl;
icoPoly8ThermoReactingCloud parcels
icoPoly8ThermoReactingMultiphaseCloud parcels
(
"reactingCloud1",
rho,
......
Info<< "Creating mass source\n" << endl;
scalarTimeActivatedExplicitSourceList massSource
(
"mass",
mesh,
dimMass/dimTime/dimVolume,
composition.species()
);
Info<< "Creating momentum source\n" << endl;
vectorTimeActivatedExplicitSourceList momentumSource
(
"momentum",
mesh,
dimMass*dimVelocity/dimTime/dimVolume,
"U"
);
Info<< "Creating energy source\n" << endl;
scalarTimeActivatedExplicitSourceList energySource
(
"energy",
mesh,
dimEnergy/dimTime/dimVolume,
"h"
);
Info<< "\nConstructing multi-component mass flow rate point sources" << endl;
timeActivatedExplicitMulticomponentPointSource pointMassSources
(
"pointMassSources",
mesh,
Y,
dimMass/dimVolume/dimTime
);
......@@ -39,6 +39,7 @@
pWork()
+ parcels.Sh()
+ radiation->Sh(thermo)
+ energySource.Su()
);
thermo.correct();
......
......@@ -32,7 +32,7 @@
- fvm::laplacian(rho*rAU, p)
==
parcels.Srho()
+ pointMassSources.Su()
+ massSource.SuTot()
);
if (corr == nCorr-1 && nonOrth == nNonOrthCorr)
......
......@@ -27,10 +27,11 @@ Application
Description
Transient PISO solver for compressible, laminar or turbulent flow with
reacting Lagrangian parcels for porous media, including explicit sources
reacting multiphase Lagrangian parcels for porous media, including explicit
sources for mass, momentum and energy
The solver includes:
- reacting parcel cloud
- reacting multiphase parcel cloud
- porous media
- point mass sources
- polynomial based, incompressible thermodynamics (f(T))
......@@ -43,12 +44,12 @@ Description
#include "fvCFD.H"
#include "hReactionThermo.H"
#include "turbulenceModel.H"
#include "BasicReactingCloud.H"
#include "BasicReactingMultiphaseCloud.H"
#include "rhoChemistryModel.H"
#include "chemistrySolver.H"
#include "radiationModel.H"
#include "porousZones.H"
#include "timeActivatedExplicitMulticomponentPointSource.H"
#include "timeActivatedExplicitSource.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -63,7 +64,7 @@ int main(int argc, char *argv[])
#include "createFields.H"
#include "createRadiationModel.H"
#include "createClouds.H"
#include "createMulticomponentPointSources.H"
#include "createExplicitSources.H"
#include "createPorousZones.H"
#include "initContinuityErrs.H"
#include "readTimeControls.H"
......
......@@ -37,7 +37,7 @@ Description
+ fvc::div(phi)
==
parcels.Srho()
+ pointMassSources.Su()
+ massSource.SuTot()
);
rhoEqn.relax();
......
......@@ -53,7 +53,7 @@ int main(int argc, char *argv[])
const indirectPrimitivePatch& coupledPatch = globalData.coupledPatch();
// Test:print shared points
// Test:print (collocated) shared points
{
const labelListList& globalPointSlaves =
globalData.globalPointSlaves();
......@@ -90,7 +90,7 @@ int main(int argc, char *argv[])
// Test: point to faces addressing
// Test: (collocated) point to faces addressing
{
const labelListList& globalPointBoundaryFaces =
globalData.globalPointBoundaryFaces();
......@@ -137,7 +137,7 @@ int main(int argc, char *argv[])
// Test:point to cells addressing
// Test:(collocated) point to cells addressing
{
const labelList& boundaryCells = globalData.boundaryCells();
const labelListList& globalPointBoundaryCells =
......@@ -172,7 +172,7 @@ int main(int argc, char *argv[])
// Test:print shared edges
// Test:print (collocated) shared edges
{
const labelListList& globalEdgeSlaves =
globalData.globalEdgeSlaves();
......
// ignore special fields or fields that we don't handle
//
bool variableGood = true;
for (label n1=startTime; n1<endTime && variableGood; ++n1)
for (label n1=0; n1<Times.size() && variableGood; ++n1)
{
// ignore _0 fields
if (fieldName.size() > 2 && fieldName(fieldName.size() - 2, 2) == "_0")
......
......@@ -19,7 +19,7 @@ if (Pstream::master())
Info<< "Correcting time values. Adding " << Tcorr << endl;
}
for (int n=startTime; n<endTime; n++)
forAll(Times, n)
{
ensightCaseFile << setw(12) << Times[n].value() + Tcorr << " ";
......
......@@ -185,7 +185,6 @@ void writeAllFaceData
const labelList& prims,
const label nPrims,
const Field<Type>& pf,
const labelList& patchProcessors,
OFstream& ensightFile
)
{
......@@ -199,16 +198,12 @@ void writeAllFaceData
{
writeData(map(pf, prims, cmpt), ensightFile);
forAll(patchProcessors, i)
for (int slave=1; slave<Pstream::nProcs(); slave++)
{
if (patchProcessors[i] != 0)
{
label slave = patchProcessors[i];
IPstream fromSlave(Pstream::scheduled, slave);
scalarField pf(fromSlave);
IPstream fromSlave(Pstream::scheduled, slave);
scalarField pf(fromSlave);
writeData(pf, ensightFile);
}
writeData(pf, ensightFile);
}
}
}
......@@ -231,7 +226,6 @@ void writeAllFaceDataBinary
const labelList& prims,
const label nPrims,
const Field<Type>& pf,
const labelList& patchProcessors,
std::ofstream& ensightFile
)
{
......@@ -245,16 +239,12 @@ void writeAllFaceDataBinary
{
writeEnsDataBinary(map(pf, prims, cmpt), ensightFile);
forAll(patchProcessors, i)
for (int slave=1; slave<Pstream::nProcs(); slave++)
{
if (patchProcessors[i] != 0)
{
label slave = patchProcessors[i];
IPstream fromSlave(Pstream::scheduled, slave);
scalarField pf(fromSlave);
IPstream fromSlave(Pstream::scheduled, slave);
scalarField pf(fromSlave);
writeEnsDataBinary(pf, ensightFile);
}
writeEnsDataBinary(pf, ensightFile);
}
}
}
......@@ -278,7 +268,6 @@ bool writePatchField
const Foam::label ensightPatchI,
const Foam::faceSets& boundaryFaceSet,
const Foam::ensightMesh::nFacePrimitives& nfp,
const Foam::labelList& patchProcessors,
Foam::OFstream& ensightFile
)
{
......@@ -297,7 +286,6 @@ bool writePatchField
boundaryFaceSet.tris,
nfp.nTris,
pf,
patchProcessors,
ensightFile
);
......@@ -307,7 +295,6 @@ bool writePatchField
boundaryFaceSet.quads,
nfp.nQuads,
pf,
patchProcessors,
ensightFile
);
......@@ -317,7 +304,6 @@ bool writePatchField
boundaryFaceSet.polys,
nfp.nPolys,
pf,
patchProcessors,
ensightFile
);
......@@ -338,7 +324,6 @@ bool writePatchFieldBinary
const Foam::label ensightPatchI,
const Foam::faceSets& boundaryFaceSet,
const Foam::ensightMesh::nFacePrimitives& nfp,
const Foam::labelList& patchProcessors,
std::ofstream& ensightFile
)
{
......@@ -356,7 +341,6 @@ bool writePatchFieldBinary
boundaryFaceSet.tris,
nfp.nTris,
pf,
patchProcessors,
ensightFile
);
......@@ -366,7 +350,6 @@ bool writePatchFieldBinary
boundaryFaceSet.quads,
nfp.nQuads,
pf,
patchProcessors,
ensightFile
);
......@@ -376,7 +359,6 @@ bool writePatchFieldBinary
boundaryFaceSet.polys,
nfp.nPolys,
pf,
patchProcessors,
ensightFile
);
......@@ -406,7 +388,6 @@ void writePatchField
const List<faceSets>& boundaryFaceSets = eMesh.boundaryFaceSets();
const wordList& allPatchNames = eMesh.allPatchNames();
const List<labelList>& allPatchProcs = eMesh.allPatchProcs();
const HashTable<ensightMesh::nFacePrimitives>&
nPatchPrims = eMesh.nPatchPrims();
......@@ -425,8 +406,6 @@ void writePatchField
}
const labelList& patchProcessors = allPatchProcs[patchi];
word pfName = patchName + '.' + fieldName;
word timeFile = prepend + itoa(timeIndex);
......@@ -473,7 +452,6 @@ void writePatchField
ensightPatchI,
boundaryFaceSets[patchi],
nPatchPrims.find(patchName)(),
patchProcessors,
ensightFile
);
}
......@@ -488,7 +466,6 @@ void writePatchField
ensightPatchI,
nullFaceSets,
nPatchPrims.find(patchName)(),
patchProcessors,
ensightFile
);
}
......@@ -521,7 +498,6 @@ void ensightFieldAscii
const cellSets& meshCellSets = eMesh.meshCellSets();
const List<faceSets>& boundaryFaceSets = eMesh.boundaryFaceSets();
const wordList& allPatchNames = eMesh.allPatchNames();
const List<labelList>& allPatchProcs = eMesh.allPatchProcs();
const wordHashSet& patchNames = eMesh.patchNames();
const HashTable<ensightMesh::nFacePrimitives>&
nPatchPrims = eMesh.nPatchPrims();
......@@ -619,50 +595,23 @@ void ensightFieldAscii
forAll(allPatchNames, patchi)
{
const word& patchName = allPatchNames[patchi];
const labelList& patchProcessors = allPatchProcs[patchi];
if (patchNames.empty() || patchNames.found(patchName))
{
if (mesh.boundary()[patchi].size())
{
if
if
(
writePatchField
(
writePatchField
(
vf.boundaryField()[patchi],
patchi,
ensightPatchI,
boundaryFaceSets[patchi],
nPatchPrims.find(patchName)(),
patchProcessors,
ensightFile
)
vf.boundaryField()[patchi],
patchi,
ensightPatchI,
boundaryFaceSets[patchi],
nPatchPrims.find(patchName)(),
ensightFile
)
{
ensightPatchI++;
}
}
else if (Pstream::master())
)
{
faceSets nullFaceSet;
if
(
writePatchField
(
Field<Type>(),
-1,
ensightPatchI,
nullFaceSet,
nPatchPrims.find(patchName)(),
patchProcessors,
ensightFile
)
)
{
ensightPatchI++;
}
ensightPatchI++;
}
}
}
......@@ -695,7 +644,6 @@ void ensightFieldBinary
const cellSets& meshCellSets = eMesh.meshCellSets();
const List<faceSets>& boundaryFaceSets = eMesh.boundaryFaceSets();
const wordList& allPatchNames = eMesh.allPatchNames();
const List<labelList>& allPatchProcs = eMesh.allPatchProcs();
const wordHashSet& patchNames = eMesh.patchNames();
const HashTable<ensightMesh::nFacePrimitives>&
nPatchPrims = eMesh.nPatchPrims();
......@@ -819,50 +767,23 @@ void ensightFieldBinary
forAll(allPatchNames, patchi)
{
const word& patchName = allPatchNames[patchi];
const labelList& patchProcessors = allPatchProcs[patchi];
if (patchNames.empty() || patchNames.found(patchName))
{
if (mesh.boundary()[patchi].size())
{
if
if
(
writePatchFieldBinary
(
writePatchFieldBinary
(
vf.boundaryField()[patchi],
patchi,
ensightPatchI,
boundaryFaceSets[patchi],
nPatchPrims.find(patchName)(),
patchProcessors,
ensightFile
)
vf.boundaryField()[patchi],
patchi,
ensightPatchI,
boundaryFaceSets[patchi],
nPatchPrims.find(patchName)(),
ensightFile
)
{
ensightPatchI++;
}
}
else if (Pstream::master())
)
{
faceSets nullFaceSet;
if
(
writePatchFieldBinary
(
Field<Type>(),
-1,
ensightPatchI,
nullFaceSet,
nPatchPrims.find(patchName)(),
patchProcessors,
ensightFile
)
)
{
ensightPatchI++;
}
ensightPatchI++;
}
}
}
......
......@@ -63,14 +63,12 @@ public:
{
public:
label nPoints;
label nTris;
label nQuads;
label nPolys;
nFacePrimitives()
:
nPoints(0),
nTris(0),
nQuads(0),
nPolys(0)
......@@ -96,8 +94,6 @@ private:
wordList allPatchNames_;
List<labelList> allPatchProcs_;
wordHashSet patchNames_;
HashTable<nFacePrimitives> nPatchPrims_;
......@@ -111,16 +107,6 @@ private:
//- Disallow default bitwise assignment
void operator=(const ensightMesh&);
//- Construct map from mesh points to merged points.
// pointToGlobal : from mesh point to global point
// uniquePoints : my set of unique points
globalIndex mergeMeshPoints
(
labelList& pointToGlobal,
pointField& uniquePoints
) const;
void writePoints
(
const scalarField& pointsComponent,
......@@ -188,7 +174,6 @@ private:
void writeFacePrims
(
const faceList& patchFaces,
const label pointOffset,
OFstream& ensightGeometryFile
) const;
......@@ -198,8 +183,6 @@ private:
const labelList& prims,
const label nPrims,
const faceList& patchFaces,
const labelList& pointOffsets,
const labelList& patchProcessors,
OFstream& ensightGeometryFile
) const;
......@@ -212,7 +195,6 @@ private:
void writeNSidedPoints
(
const faceList& patchFaces,
const label pointOffset,
OFstream& ensightGeometryFile
) const;
......@@ -221,8 +203,6 @@ private:
const labelList& prims,
const label nPrims,
const faceList& patchFaces,
const labelList& pointOffsets,
const labelList& patchProcessors,
OFstream& ensightGeometryFile
) const;
......@@ -231,7 +211,10 @@ private:
const fileName& postProcPath,
const word& prepend,