Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev

This commit is contained in:
laurence
2013-05-08 12:10:19 +01:00
200 changed files with 4702 additions and 2679 deletions

View File

@ -37,7 +37,7 @@ Description
#include "fvCFD.H"
#include "turbulenceModel.H"
#include "fluidThermoCloud.H"
#include "basicThermoCloud.H"
#include "coalCloud.H"
#include "psiCombustionModel.H"
#include "fvIOoptionList.H"

View File

@ -9,7 +9,7 @@ coalCloud coalParcels
);
Info<< "\nConstructing limestone cloud" << endl;
fluidThermoCloud limestoneParcels
basicThermoCloud limestoneParcels
(
"limestoneCloud1",
rho,

View File

@ -1,7 +1,5 @@
{
label nAlphaCorr(readLabel(pimple.dict().lookup("nAlphaCorr")));
label nAlphaSubCycles(readLabel(pimple.dict().lookup("nAlphaSubCycles")));
#include "alphaControls.H"
surfaceScalarField phic(mag(phi/mesh.magSf()));
phic = min(interface.cAlpha()*phic, max(phic));

View File

@ -1,17 +1,5 @@
#include "readTimeControls.H"
label nAlphaCorr(readLabel(pimple.dict().lookup("nAlphaCorr")));
label nAlphaSubCycles(readLabel(pimple.dict().lookup("nAlphaSubCycles")));
if (nAlphaSubCycles > 1 && pimple.nCorrPIMPLE() != 1)
{
FatalErrorIn(args.executable())
<< "Sub-cycling alpha is only allowed for PISO, "
"i.e. when the number of outer-correctors = 1"
<< exit(FatalError);
}
bool correctPhi =
pimple.dict().lookupOrDefault<Switch>("correctPhi", true);

View File

@ -56,7 +56,7 @@ int main(int argc, char *argv[])
pimpleControl pimple(mesh);
#include "readControls.H"
#include "readTimeControls.H"
#include "initContinuityErrs.H"
#include "createFields.H"
#include "CourantNo.H"
@ -68,7 +68,7 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "readControls.H"
#include "readTimeControls.H"
#include "CourantNo.H"
#include "setDeltaT.H"

View File

@ -85,8 +85,8 @@
if (pimple.finalNonOrthogonalIter())
{
//p = max(p_rgh + (alpha1*rho1 + alpha2*rho2)*gh, pMin);
//p_rgh = p - (alpha1*rho1 + alpha2*rho2)*gh;
p = max(p_rgh + (alpha1*rho1 + alpha2*rho2)*gh, pMin);
p_rgh = p - (alpha1*rho1 + alpha2*rho2)*gh;
dgdt =
(
@ -102,7 +102,7 @@
}
}
p = max(p_rgh + (alpha1*rho1 + alpha2*rho2)*gh, pMin);
// p = max(p_rgh + (alpha1*rho1 + alpha2*rho2)*gh, pMin);
// Update densities from change in p_rgh
rho1 += psi1*(p_rgh - p_rgh_0);

View File

@ -1,13 +0,0 @@
#include "readTimeControls.H"
label nAlphaCorr(readLabel(pimple.dict().lookup("nAlphaCorr")));
label nAlphaSubCycles(readLabel(pimple.dict().lookup("nAlphaSubCycles")));
if (nAlphaSubCycles > 1 && pimple.nCorrPIMPLE() != 1)
{
FatalErrorIn(args.executable())
<< "Sub-cycling alpha is only allowed for PISO operation, "
"i.e. when the number of outer-correctors = 1"
<< exit(FatalError);
}

View File

@ -28,8 +28,8 @@
+ (
he1.name() == thermo1.phasePropertyName("e")
? fvc::div(alphaPhi1, p)
: -dalpha1pdt
? fvc::ddt(alpha1)*p + fvc::div(alphaPhi1, p)
: -alpha1*dpdt
)/rho1
- fvm::laplacian(k1, he1)
@ -50,8 +50,8 @@
+ (
he2.name() == thermo2.phasePropertyName("e")
? fvc::div(alphaPhi2, p)
: -dalpha2pdt
? fvc::ddt(alpha2)*p + fvc::div(alphaPhi2, p)
: -alpha2*dpdt
)/rho2
- fvm::laplacian(k2, he2)

View File

@ -275,8 +275,8 @@
);
Info<< "Creating field dalpha1pdt\n" << endl;
volScalarField dalpha1pdt
Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt
(
IOobject
(
@ -285,21 +285,9 @@
mesh
),
mesh,
dimensionedScalar("dalpha1pdt", p.dimensions()/dimTime, 0)
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
);
Info<< "Creating field dalpha2pdt\n" << endl;
volScalarField dalpha2pdt
(
IOobject
(
"dpdt",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar("dalpha2pdt", p.dimensions()/dimTime, 0)
);
Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K1("K" + phase1Name, 0.5*magSqr(U1));

View File

@ -208,13 +208,8 @@
K1 = 0.5*magSqr(U1);
K2 = 0.5*magSqr(U2);
if (thermo1.dpdt())
if (thermo1.dpdt() || thermo2.dpdt())
{
dalpha1pdt = fvc::ddt(alpha1, p);
}
if (thermo2.dpdt())
{
dalpha2pdt = fvc::ddt(alpha2, p);
dpdt = fvc::ddt(p);
}
}

View File

@ -1,4 +1,2 @@
#include "readTimeControls.H"
int nAlphaCorr(readInt(pimple.dict().lookup("nAlphaCorr")));
int nAlphaSubCycles(readInt(pimple.dict().lookup("nAlphaSubCycles")));
#include "alphaControls.H"

View File

@ -1,5 +1,4 @@
label nAlphaCorr(readLabel(pimple.dict().lookup("nAlphaCorr")));
label nAlphaSubCycles(readLabel(pimple.dict().lookup("nAlphaSubCycles")));
#include "alphaControls.H"
if (nAlphaSubCycles > 1)
{

View File

@ -130,10 +130,7 @@
<< ", " << gMax(1/rDeltaT.internalField()) << endl;
}
label nAlphaSubCycles
(
readLabel(pimpleDict.lookup("nAlphaSubCycles"))
);
#include "alphaControls.H"
rSubDeltaT = rDeltaT*nAlphaSubCycles;
}

View File

@ -1,5 +1,4 @@
label nAlphaCorr(readLabel(pimple.dict().lookup("nAlphaCorr")));
label nAlphaSubCycles(readLabel(pimple.dict().lookup("nAlphaSubCycles")));
#include "alphaControls.H"
if (nAlphaSubCycles > 1)
{

View File

@ -1,6 +1,4 @@
const dictionary& pimpleDict = pimple.dict();
label nAlphaCorr(readLabel(pimpleDict.lookup("nAlphaCorr")));
label nAlphaSubCycles(readLabel(pimpleDict.lookup("nAlphaSubCycles")));
#include "alphaControls.H"
if (nAlphaSubCycles > 1)
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -174,8 +174,10 @@ Foam::threePhaseInterfaceProperties::threePhaseInterfaceProperties
(
readScalar
(
mixture.U().mesh().solutionDict().subDict("PIMPLE").
lookup("cAlpha")
mixture.U().mesh().solverDict
(
mixture_.alpha1().name()
).lookup("cAlpha")
)
),
sigma12_(mixture.lookup("sigma12")),

View File

@ -4,9 +4,41 @@
surfaceScalarField phir("phir", phic*interface.nHatf());
for (int gCorr=0; gCorr<nAlphaCorr; gCorr++)
Pair<tmp<volScalarField> > vDotAlphal =
twoPhaseProperties->vDotAlphal();
const volScalarField& vDotcAlphal = vDotAlphal[0]();
const volScalarField& vDotvAlphal = vDotAlphal[1]();
const volScalarField vDotvmcAlphal(vDotvAlphal - vDotcAlphal);
tmp<surfaceScalarField> tphiAlpha;
if (MULESCorr)
{
surfaceScalarField phiAlpha
fvScalarMatrix alpha1Eqn
(
fvm::ddt(alpha1)
+ fvm::div(phi, alpha1, "UD") - fvm::Sp(divU, alpha1)
==
fvm::Sp(vDotvmcAlphal, alpha1)
+ vDotcAlphal
);
alpha1Eqn.solve();
Info<< "Phase-1 volume fraction = "
<< alpha1.weightedAverage(mesh.Vsc()).value()
<< " Min(alpha1) = " << min(alpha1).value()
<< " Max(alpha1) = " << max(alpha1).value()
<< endl;
tphiAlpha = alpha1Eqn.flux();
}
volScalarField alpha10("alpha10", alpha1);
for (int aCorr=0; aCorr<nAlphaCorr; aCorr++)
{
tmp<surfaceScalarField> tphiAlphaCorr
(
fvc::flux
(
@ -22,66 +54,52 @@
)
);
Pair<tmp<volScalarField> > vDotAlphal =
twoPhaseProperties->vDotAlphal();
const volScalarField& vDotcAlphal = vDotAlphal[0]();
const volScalarField& vDotvAlphal = vDotAlphal[1]();
if (MULESCorr)
{
tphiAlphaCorr() -= tphiAlpha();
volScalarField Sp
(
IOobject
volScalarField alpha100("alpha100", alpha10);
alpha10 = alpha1;
MULES::correct
(
"Sp",
runTime.timeName(),
mesh
),
vDotvAlphal - vDotcAlphal
);
geometricOneField(),
alpha1,
tphiAlphaCorr(),
vDotvmcAlphal,
(
divU*(alpha10 - alpha100)
- vDotvmcAlphal*alpha10
)(),
1,
0
);
volScalarField Su
(
IOobject
tphiAlpha() += tphiAlphaCorr();
}
else
{
MULES::explicitSolve
(
"Su",
runTime.timeName(),
mesh
),
// Divergence term is handled explicitly to be
// consistent with the explicit transport solution
divU*alpha1
+ vDotcAlphal
);
geometricOneField(),
alpha1,
phi,
tphiAlphaCorr(),
vDotvmcAlphal,
(divU*alpha1 + vDotcAlphal)(),
1,
0
);
//MULES::explicitSolve
//(
// geometricOneField(),
// alpha1,
// phi,
// phiAlpha,
// Sp,
// Su,
// 1,
// 0
//);
MULES::implicitSolve
(
geometricOneField(),
alpha1,
phi,
phiAlpha,
Sp,
Su,
1,
0
);
tphiAlpha = tphiAlphaCorr;
}
alpha2 = 1.0 - alpha1;
rhoPhi +=
(runTime.deltaT()/totalDeltaT)
*(phiAlpha*(rho1 - rho2) + phi*rho2);
}
rhoPhi = tphiAlpha()*(rho1 - rho2) + phi*rho2;
Info<< "Liquid phase volume fraction = "
<< alpha1.weightedAverage(mesh.V()).value()
<< " Min(alpha1) = " << min(alpha1).value()

View File

@ -11,21 +11,18 @@ surfaceScalarField rhoPhi
);
{
const dictionary& pimpleDict = pimple.dict();
label nAlphaCorr(readLabel(pimpleDict.lookup("nAlphaCorr")));
label nAlphaSubCycles(readLabel(pimpleDict.lookup("nAlphaSubCycles")));
#include "alphaControls.H"
surfaceScalarField phic(mag(phi/mesh.magSf()));
phic = min(interface.cAlpha()*phic, max(phic));
volScalarField divU(fvc::div(phi));
dimensionedScalar totalDeltaT = runTime.deltaT();
if (nAlphaSubCycles > 1)
{
dimensionedScalar totalDeltaT = runTime.deltaT();
surfaceScalarField rhoPhiSum("rhoPhiSum", rhoPhi);
for
(
subCycle<volScalarField> alphaSubCycle(alpha1, nAlphaSubCycles);
@ -33,7 +30,10 @@ surfaceScalarField rhoPhi
)
{
#include "alphaEqn.H"
rhoPhiSum += (runTime.deltaT()/totalDeltaT)*rhoPhi;
}
rhoPhi = rhoPhiSum;
}
else
{

View File

@ -41,7 +41,7 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "IMULES.H"
#include "MULES.H"
#include "subCycle.H"
#include "interfaceProperties.H"
#include "phaseChangeTwoPhaseMixture.H"

View File

@ -812,9 +812,8 @@ void Foam::multiphaseSystem::solve()
const Time& runTime = mesh_.time();
const dictionary& pimpleDict = mesh_.solutionDict().subDict("PIMPLE");
label nAlphaSubCycles(readLabel(pimpleDict.lookup("nAlphaSubCycles")));
const dictionary& alphaControls = mesh_.solverDict(phases_.first().name());
label nAlphaSubCycles(readLabel(alphaControls.lookup("nAlphaSubCycles")));
if (nAlphaSubCycles > 1)
{

View File

@ -249,15 +249,12 @@ void Foam::multiphaseMixture::solve()
const Time& runTime = mesh_.time();
const dictionary& pimpleDict = mesh_.solutionDict().subDict("PIMPLE");
label nAlphaSubCycles(readLabel(pimpleDict.lookup("nAlphaSubCycles")));
scalar cAlpha(readScalar(pimpleDict.lookup("cAlpha")));
volScalarField& alpha = phases_.first();
const dictionary& alphaControls = mesh_.solverDict(alpha.name());
label nAlphaSubCycles(readLabel(alphaControls.lookup("nAlphaSubCycles")));
scalar cAlpha(readScalar(alphaControls.lookup("cAlpha")));
if (nAlphaSubCycles > 1)
{
surfaceScalarField rhoPhiSum(0.0*rhoPhi_);

View File

@ -1,5 +1,4 @@
label nAlphaCorr(readLabel(pimple.dict().lookup("nAlphaCorr")));
label nAlphaSubCycles(readLabel(pimple.dict().lookup("nAlphaSubCycles")));
#include "alphaControls.H"
if (nAlphaSubCycles > 1)
{

View File

@ -1,5 +1,4 @@
#include "readTimeControls.H"
#include "alphaControls.H"
int nAlphaCorr(readInt(pimple.dict().lookup("nAlphaCorr")));
int nAlphaSubCycles(readInt(pimple.dict().lookup("nAlphaSubCycles")));
Switch correctAlpha(pimple.dict().lookup("correctAlpha"));

View File

@ -148,7 +148,7 @@ bool Foam::checkWedges
{
Info<< " ***Wedge patch " << pp.name() << " not planar."
<< " Point " << pt << " is not in patch plane by "
<< d << " meter."
<< d << " metre."
<< endl;
}
return true;

View File

@ -62,7 +62,7 @@ int main(int argc, char *argv[])
boundBox bb(points);
Info<< "bounding box: min = " << bb.min()
<< " max = " << bb.max() << " meters."
<< " max = " << bb.max() << " metres."
<< endl;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -54,7 +54,7 @@ Foam::label Foam::mergePolyMesh::patchIndex(const polyPatch& p)
{
if (patchNames_[patchI] == pName)
{
if (patchTypes_[patchI] == pType)
if (word(patchDicts_[patchI]["type"]) == pType)
{
// Found name and types match
return patchI;
@ -68,7 +68,11 @@ Foam::label Foam::mergePolyMesh::patchIndex(const polyPatch& p)
}
// Patch not found. Append to the list
patchTypes_.append(pType);
{
OStringStream os;
p.write(os);
patchDicts_.append(dictionary(IStringStream(os.str())()));
}
if (nameFound)
{
@ -121,20 +125,22 @@ Foam::mergePolyMesh::mergePolyMesh(const IOobject& io)
:
polyMesh(io),
meshMod_(*this),
patchTypes_(2*boundaryMesh().size()),
patchNames_(2*boundaryMesh().size()),
patchDicts_(2*boundaryMesh().size()),
pointZoneNames_(),
faceZoneNames_(),
cellZoneNames_()
{
// Insert the original patches into the list
wordList curPatchTypes = boundaryMesh().types();
wordList curPatchNames = boundaryMesh().names();
forAll(curPatchTypes, patchI)
forAll(boundaryMesh(), patchI)
{
patchTypes_.append(curPatchTypes[patchI]);
patchNames_.append(curPatchNames[patchI]);
patchNames_.append(boundaryMesh()[patchI].name());
OStringStream os;
boundaryMesh()[patchI].write(os);
patchDicts_.append(dictionary(IStringStream(os.str())()));
}
// Insert point, face and cell zones into the list
@ -379,7 +385,7 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
void Foam::mergePolyMesh::merge()
{
Info<< "patch names: " << patchNames_ << nl
<< "patch types: " << patchTypes_ << nl
<< "patch dicts: " << patchDicts_ << nl
<< "point zone names: " << pointZoneNames_ << nl
<< "face zone names: " << faceZoneNames_ << nl
<< "cell zone names: " << cellZoneNames_ << endl;
@ -409,14 +415,16 @@ void Foam::mergePolyMesh::merge()
for (; patchI < patchNames_.size(); patchI++)
{
// Add a patch
dictionary dict(patchDicts_[patchI]);
dict.set("nFaces", 0);
dict.set("startFace", endOfLastPatch);
newPatches[patchI] =
(
polyPatch::New
(
patchTypes_[patchI],
patchNames_[patchI],
0,
endOfLastPatch,
dict,
patchI,
oldPatches
).ptr()

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -58,12 +58,12 @@ class mergePolyMesh
//- Topological change to accumulated all mesh changes
polyTopoChange meshMod_;
//- Patch types
DynamicList<word> patchTypes_;
//- Patch names
DynamicList<word> patchNames_;
//- Patch dictionaries
DynamicList<dictionary> patchDicts_;
//- Point zone names
DynamicList<word> pointZoneNames_;

View File

@ -1043,7 +1043,6 @@ int main(int argc, char *argv[])
surfaceMeshWriter writer
(
vMesh,
binary,
pp,
fz.name(),

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -30,14 +30,12 @@ License
Foam::surfaceMeshWriter::surfaceMeshWriter
(
const vtkMesh& vMesh,
const bool binary,
const indirectPrimitivePatch& pp,
const word& name,
const fileName& fName
)
:
vMesh_(vMesh),
binary_(binary),
pp_(pp),
fName_(fName),
@ -78,8 +76,4 @@ Foam::surfaceMeshWriter::surfaceMeshWriter
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -53,13 +53,11 @@ namespace Foam
class volPointInterpolation;
/*---------------------------------------------------------------------------*\
Class surfaceMeshWriter Declaration
Class surfaceMeshWriter Declaration
\*---------------------------------------------------------------------------*/
class surfaceMeshWriter
{
const vtkMesh& vMesh_;
const bool binary_;
const indirectPrimitivePatch& pp_;
@ -68,9 +66,6 @@ class surfaceMeshWriter
std::ofstream os_;
// label nPoints_;
//
// label nFaces_;
public:
@ -79,7 +74,6 @@ public:
//- Construct from components
surfaceMeshWriter
(
const vtkMesh&,
const bool binary,
const indirectPrimitivePatch& pp,
const word& name,
@ -94,19 +88,6 @@ public:
return os_;
}
// label nPoints() const
// {
// return nPoints_;
// }
//
// label nFaces() const
// {
// return nFaces_;
// }
//
// //- Write cellIDs
// void writePatchIDs();
//- Extract face data
template<class Type>
tmp<Field<Type> > getFaceField

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -179,12 +179,13 @@ void Foam::vtkPV398Foam::convertMeshPatches
const word patchName = getPartName(partId);
labelHashSet patchIds(patches.patchSet(List<wordRe>(1, patchName)));
labelHashSet
patchIds(patches.patchSet(List<wordRe>(1, wordRe(patchName))));
if (debug)
{
Info<< "Creating VTK mesh for patches [" << patchIds <<"] "
<< patchName << endl;
<< patchName << endl;
}
vtkPolyData* vtkmesh = NULL;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -40,6 +40,7 @@ Description
#include "pairPatchAgglomeration.H"
#include "labelListIOList.H"
#include "syncTools.H"
#include "globalIndex.H"
using namespace Foam;
@ -53,7 +54,7 @@ int main(int argc, char *argv[])
#include "createTime.H"
#include "createNamedMesh.H"
const word dictName("faceAgglomerateDict");
const word dictName("viewFactorsDict");
#include "setConstantMeshDictionaryIO.H"
@ -79,16 +80,16 @@ int main(int argc, char *argv[])
boundary.size()
);
forAll(boundary, patchId)
label nCoarseFaces = 0;
forAllConstIter(dictionary, agglomDict, iter)
{
const polyPatch& pp = boundary[patchId];
label patchI = pp.index();
finalAgglom[patchI].setSize(pp.size(), 0);
if (!pp.coupled())
labelList patchIds = boundary.findIndices(iter().keyword());
forAll(patchIds, i)
{
if (agglomDict.found(pp.name()))
label patchI = patchIds[i];
const polyPatch& pp = boundary[patchI];
if (!pp.coupled())
{
Info << "\nAgglomerating patch : " << pp.name() << endl;
pairPatchAgglomeration agglomObject
@ -99,12 +100,11 @@ int main(int argc, char *argv[])
agglomObject.agglomerate();
finalAgglom[patchI] =
agglomObject.restrictTopBottomAddressing();
}
else
{
FatalErrorIn(args.executable())
<< "Patch " << pp.name() << " not found in dictionary: "
<< agglomDict.name() << exit(FatalError);
if (finalAgglom[patchI].size())
{
nCoarseFaces += max(finalAgglom[patchI] + 1);
}
}
}
}
@ -144,6 +144,7 @@ int main(int argc, char *argv[])
if (writeAgglom)
{
globalIndex index(nCoarseFaces);
volScalarField facesAgglomeration
(
IOobject
@ -158,14 +159,26 @@ int main(int argc, char *argv[])
dimensionedScalar("facesAgglomeration", dimless, 0)
);
label coarsePatchIndex = 0;
forAll(boundary, patchId)
{
fvPatchScalarField& bFacesAgglomeration =
facesAgglomeration.boundaryField()[patchId];
forAll(bFacesAgglomeration, j)
const polyPatch& pp = boundary[patchId];
if (pp.size() > 0)
{
bFacesAgglomeration[j] = finalAgglom[patchId][j];
fvPatchScalarField& bFacesAgglomeration =
facesAgglomeration.boundaryField()[patchId];
forAll(bFacesAgglomeration, j)
{
bFacesAgglomeration[j] =
index.toGlobal
(
Pstream::myProcNo(),
finalAgglom[patchId][j] + coarsePatchIndex
);
}
coarsePatchIndex += max(finalAgglom[patchId]) + 1;
}
}

View File

@ -17,6 +17,12 @@ FoamFile
// Write agglomeration as a volScalarField with calculated boundary values
writeFacesAgglomeration true;
//Debug option
debug 0;
//Dump connectivity rays
dumpRays false;
// Per patch (wildcard possible) the coarsening level
bottomAir_to_heater
{

View File

@ -0,0 +1,4 @@
mapLagrangian.C
mapFields.C
EXE = $(FOAM_APPBIN)/mapFieldsNew

View File

@ -0,0 +1,13 @@
EXE_INC = \
-DFULLDEBUG -g -O0 \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude
EXE_LIBS = \
-lsampling \
-lmeshTools \
-llagrangian \
-lfiniteVolume \
-lgenericPatchFields

View File

@ -0,0 +1,184 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
InNamespace
Foam
Description
Gets the indices of (source)particles that have been appended to the
target cloud and maps the lagrangian fields accordingly.
\*---------------------------------------------------------------------------*/
#ifndef MapLagrangianFields_H
#define MapLagrangianFields_H
#include "cloud.H"
#include "GeometricField.H"
#include "meshToMeshNew.H"
#include "IOobjectList.H"
#include "CompactIOField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
//- Gets the indices of (source)particles that have been appended to the
// target cloud and maps the lagrangian fields accordingly.
template<class Type>
void MapLagrangianFields
(
const string& cloudName,
const IOobjectList& objects,
const polyMesh& meshTarget,
const labelList& addParticles
)
{
{
IOobjectList fields = objects.lookupClass(IOField<Type>::typeName);
forAllIter(IOobjectList, fields, fieldIter)
{
const word& fieldName = fieldIter()->name();
Info<< " mapping lagrangian field " << fieldName << endl;
// Read field (does not need mesh)
IOField<Type> fieldSource(*fieldIter());
// Map
IOField<Type> fieldTarget
(
IOobject
(
fieldName,
meshTarget.time().timeName(),
cloud::prefix/cloudName,
meshTarget,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
addParticles.size()
);
forAll(addParticles, i)
{
fieldTarget[i] = fieldSource[addParticles[i]];
}
// Write field
fieldTarget.write();
}
}
{
IOobjectList fieldFields =
objects.lookupClass(IOField<Field<Type> >::typeName);
forAllIter(IOobjectList, fieldFields, fieldIter)
{
const word& fieldName = fieldIter()->name();
Info<< " mapping lagrangian fieldField " << fieldName << endl;
// Read field (does not need mesh)
IOField<Field<Type> > fieldSource(*fieldIter());
// Map - use CompactIOField to automatically write in
// compact form for binary format.
CompactIOField<Field<Type>, Type> fieldTarget
(
IOobject
(
fieldName,
meshTarget.time().timeName(),
cloud::prefix/cloudName,
meshTarget,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
addParticles.size()
);
forAll(addParticles, i)
{
fieldTarget[i] = fieldSource[addParticles[i]];
}
// Write field
fieldTarget.write();
}
}
{
IOobjectList fieldFields =
objects.lookupClass(CompactIOField<Field<Type>, Type>::typeName);
forAllIter(IOobjectList, fieldFields, fieldIter)
{
Info<< " mapping lagrangian fieldField "
<< fieldIter()->name() << endl;
// Read field (does not need mesh)
CompactIOField<Field<Type>, Type> fieldSource(*fieldIter());
// Map
CompactIOField<Field<Type>, Type> fieldTarget
(
IOobject
(
fieldIter()->name(),
meshTarget.time().timeName(),
cloud::prefix/cloudName,
meshTarget,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
addParticles.size()
);
forAll(addParticles, i)
{
fieldTarget[i] = fieldSource[addParticles[i]];
}
// Write field
fieldTarget.write();
}
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,131 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef MapMeshes_H
#define MapMeshes_H
#include "MapVolFields.H"
#include "mapLagrangian.H"
#include "UnMapped.H"
#include "pointMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
template<template<class> class CombineOp>
void MapMesh
(
const meshToMeshNew& interp,
const HashSet<word>& selectedFields,
const bool noLagrangian
)
{
{
const polyMesh& meshSource = interp.srcRegion();
// Search for list of objects for this time
IOobjectList objects(meshSource, meshSource.time().timeName());
// Map volFields
// ~~~~~~~~~~~~~
MapVolFields<scalar>
(
objects,
selectedFields,
interp,
CombineOp<scalar>()
);
MapVolFields<vector>
(
objects,
selectedFields,
interp,
CombineOp<vector>()
);
MapVolFields<sphericalTensor>
(
objects,
selectedFields,
interp,
CombineOp<sphericalTensor>()
);
MapVolFields<symmTensor>
(
objects,
selectedFields,
interp,
CombineOp<symmTensor>()
);
MapVolFields<tensor>
(
objects,
selectedFields,
interp,
CombineOp<tensor>()
);
}
{
const polyMesh& meshTarget = interp.tgtRegion();
// Search for list of target objects for this time
IOobjectList objects(meshTarget, meshTarget.time().timeName());
// Mark surfaceFields as unmapped
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
UnMapped<surfaceScalarField>(objects);
UnMapped<surfaceVectorField>(objects);
UnMapped<surfaceSphericalTensorField>(objects);
UnMapped<surfaceSymmTensorField>(objects);
UnMapped<surfaceTensorField>(objects);
// Mark pointFields as unmapped
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
UnMapped<pointScalarField>(objects);
UnMapped<pointVectorField>(objects);
UnMapped<pointSphericalTensorField>(objects);
UnMapped<pointSymmTensorField>(objects);
UnMapped<pointTensorField>(objects);
}
if (!noLagrangian)
{
mapLagrangian(interp);
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,104 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef MapConsistentVolFields_H
#define MapConsistentVolFields_H
#include "GeometricField.H"
#include "meshToMeshNew.H"
#include "IOobjectList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
template<class Type, class CombineOp>
void MapVolFields
(
const IOobjectList& objects,
const HashSet<word>& selectedFields,
const meshToMeshNew& interp,
const CombineOp& cop
)
{
typedef GeometricField<Type, fvPatchField, volMesh> fieldType;
const fvMesh& meshSource = static_cast<const fvMesh&>(interp.srcRegion());
const fvMesh& meshTarget = static_cast<const fvMesh&>(interp.tgtRegion());
IOobjectList fields = objects.lookupClass(fieldType::typeName);
forAllIter(IOobjectList, fields, fieldIter)
{
const word& fieldName = fieldIter()->name();
if (selectedFields.empty() || selectedFields.found(fieldName))
{
Info<< " interpolating " << fieldName << endl;
const fieldType fieldSource(*fieldIter(), meshSource);
IOobject targetIO
(
fieldName,
meshTarget.time().timeName(),
meshTarget,
IOobject::MUST_READ
);
if (targetIO.headerOk())
{
fieldType fieldTarget(targetIO, meshTarget);
interp.mapSrcToTgt(fieldSource, cop, fieldTarget);
fieldTarget.write();
}
else
{
targetIO.readOpt() = IOobject::NO_READ;
tmp<fieldType>
tfieldTarget(interp.mapSrcToTgt(fieldSource, cop));
fieldType fieldTarget(targetIO, tfieldTarget);
fieldTarget.write();
}
}
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,57 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef UnMapped_H
#define UnMapped_H
#include "IOobjectList.H"
#include "OSspecific.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
template<class Type>
void UnMapped(const IOobjectList& objects)
{
IOobjectList fields = objects.lookupClass(Type::typeName);
forAllConstIter(IOobjectList, fields, fieldIter)
{
mvBak(fieldIter()->objectPath(), "unmapped");
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,11 @@
Info<< "\nCreate databases as time" << endl;
HashTable<string> srcOptions(args.options());
srcOptions.erase("case");
srcOptions.insert("case", fileName(rootDirSource/caseDirSource));
argList argsSrc(args, srcOptions, false, false, false);
Time runTimeSource(Time::controlDictName, argsSrc);
Time runTimeTarget(Time::controlDictName, args);

View File

@ -0,0 +1,343 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
mapFields
Description
Maps volume fields from one mesh to another, reading and
interpolating all fields present in the time directory of both cases.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "meshToMeshNew.H"
#include "processorPolyPatch.H"
#include "MapMeshes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
void mapConsistentMesh
(
const fvMesh& meshSource,
const fvMesh& meshTarget,
const meshToMeshNew::interpolationMethod& mapMethod,
const bool subtract,
const HashSet<word>& selectedFields,
const bool noLagrangian
)
{
Info<< nl << "Consistently creating and mapping fields for time "
<< meshSource.time().timeName() << nl << endl;
meshToMeshNew interp(meshSource, meshTarget, mapMethod);
if (subtract)
{
MapMesh<minusEqOp>
(
interp,
selectedFields,
noLagrangian
);
}
else
{
MapMesh<plusEqOp>
(
interp,
selectedFields,
noLagrangian
);
}
}
void mapSubMesh
(
const fvMesh& meshSource,
const fvMesh& meshTarget,
const HashTable<word>& patchMap,
const wordList& cuttingPatches,
const meshToMeshNew::interpolationMethod& mapMethod,
const bool subtract,
const HashSet<word>& selectedFields,
const bool noLagrangian
)
{
Info<< nl << "Creating and mapping fields for time "
<< meshSource.time().timeName() << nl << endl;
meshToMeshNew interp
(
meshSource,
meshTarget,
mapMethod,
patchMap,
cuttingPatches
);
if (subtract)
{
MapMesh<minusEqOp>
(
interp,
selectedFields,
noLagrangian
);
}
else
{
MapMesh<plusEqOp>
(
interp,
selectedFields,
noLagrangian
);
}
}
wordList addProcessorPatches
(
const fvMesh& meshTarget,
const wordList& cuttingPatches
)
{
// Add the processor patches to the cutting list
HashSet<word> cuttingPatchTable;
forAll(cuttingPatches, i)
{
cuttingPatchTable.insert(cuttingPatches[i]);
}
const polyBoundaryMesh& pbm = meshTarget.boundaryMesh();
forAll(pbm, patchI)
{
if (isA<processorPolyPatch>(pbm[patchI]))
{
const word& patchName = pbm[patchI].name();
cuttingPatchTable.insert(patchName);
}
}
return cuttingPatchTable.toc();
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
argList::addNote
(
"map volume fields from one mesh to another"
);
argList::validArgs.append("sourceCase");
argList::addOption
(
"sourceTime",
"scalar|'latestTime'",
"specify the source time"
);
argList::addOption
(
"sourceRegion",
"word",
"specify the source region"
);
argList::addOption
(
"targetRegion",
"word",
"specify the target region"
);
argList::addBoolOption
(
"consistent",
"source and target geometry and boundary conditions identical"
);
argList::addOption
(
"mapMethod",
"word",
"specify the mapping method"
);
argList::addBoolOption
(
"subtract",
"subtract mapped source from target"
);
argList::addOption
(
"fields",
"list",
"specify a list of fields to be mapped. Eg, '(U T p)' - "
"regular expressions not currently supported"
);
argList::addBoolOption
(
"noLagrangian",
"skip mapping lagrangian positions and fields"
);
argList args(argc, argv);
fileName rootDirTarget(args.rootPath());
fileName caseDirTarget(args.globalCaseName());
const fileName casePath = args[1];
const fileName rootDirSource = casePath.path();
const fileName caseDirSource = casePath.name();
Info<< "Source: " << rootDirSource << " " << caseDirSource << endl;
word sourceRegion = fvMesh::defaultRegion;
if (args.optionFound("sourceRegion"))
{
sourceRegion = args["sourceRegion"];
Info<< "Source region: " << sourceRegion << endl;
}
Info<< "Target: " << rootDirTarget << " " << caseDirTarget << endl;
word targetRegion = fvMesh::defaultRegion;
if (args.optionFound("targetRegion"))
{
targetRegion = args["targetRegion"];
Info<< "Target region: " << targetRegion << endl;
}
const bool consistent = args.optionFound("consistent");
meshToMeshNew::interpolationMethod mapMethod =
meshToMeshNew::imCellVolumeWeight;
if (args.optionFound("mapMethod"))
{
mapMethod = meshToMeshNew::interpolationMethodNames_[args["mapMethod"]];
Info<< "Mapping method: "
<< meshToMeshNew::interpolationMethodNames_[mapMethod] << endl;
}
const bool subtract = args.optionFound("subtract");
if (subtract)
{
Info<< "Subtracting mapped source field from target" << endl;
}
HashSet<word> selectedFields;
if (args.optionFound("fields"))
{
args.optionLookup("fields")() >> selectedFields;
}
const bool noLagrangian = args.optionFound("noLagrangian");
#include "createTimes.H"
HashTable<word> patchMap;
wordList cuttingPatches;
if (!consistent)
{
IOdictionary mapFieldsDict
(
IOobject
(
"mapFieldsDict",
runTimeTarget.system(),
runTimeTarget,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE,
false
)
);
mapFieldsDict.lookup("patchMap") >> patchMap;
mapFieldsDict.lookup("cuttingPatches") >> cuttingPatches;
}
#include "setTimeIndex.H"
Info<< "\nCreate meshes\n" << endl;
fvMesh meshSource
(
IOobject
(
sourceRegion,
runTimeSource.timeName(),
runTimeSource
)
);
fvMesh meshTarget
(
IOobject
(
targetRegion,
runTimeTarget.timeName(),
runTimeTarget
)
);
Info<< "Source mesh size: " << meshSource.nCells() << tab
<< "Target mesh size: " << meshTarget.nCells() << nl << endl;
if (consistent)
{
mapConsistentMesh
(
meshSource,
meshTarget,
mapMethod,
subtract,
selectedFields,
noLagrangian
);
}
else
{
mapSubMesh
(
meshSource,
meshTarget,
patchMap,
addProcessorPatches(meshTarget, cuttingPatches),
mapMethod,
subtract,
selectedFields,
noLagrangian
);
}
Info<< "\nEnd\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,30 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object mapFieldsDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// List of pairs of source/target patches for mapping
patchMap
(
lid movingWall
);
// List of target patches cutting the source domain (these need to be
// handled specially e.g. interpolated from internal values)
cuttingPatches
(
fixedWalls
);
// ************************************************************************* //

View File

@ -0,0 +1,303 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "MapLagrangianFields.H"
#include "passiveParticleCloud.H"
#include "meshSearch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
static const scalar perturbFactor = 1e-6;
// Special version of findCell that generates a cell guaranteed to be
// compatible with tracking.
static label findCell(const Cloud<passiveParticle>& cloud, const point& pt)
{
label cellI = -1;
label tetFaceI = -1;
label tetPtI = -1;
const polyMesh& mesh = cloud.pMesh();
mesh.findCellFacePt(pt, cellI, tetFaceI, tetPtI);
if (cellI >= 0)
{
return cellI;
}
else
{
// See if particle on face by finding nearest face and shifting
// particle.
meshSearch meshSearcher
(
mesh,
polyMesh::FACEPLANES // no decomposition needed
);
label faceI = meshSearcher.findNearestBoundaryFace(pt);
if (faceI >= 0)
{
const point& cc = mesh.cellCentres()[mesh.faceOwner()[faceI]];
const point perturbPt = (1-perturbFactor)*pt+perturbFactor*cc;
mesh.findCellFacePt(perturbPt, cellI, tetFaceI, tetPtI);
return cellI;
}
}
return -1;
}
void mapLagrangian(const meshToMeshNew& interp)
{
// Determine which particles are in meshTarget
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const polyMesh& meshSource = interp.srcRegion();
const polyMesh& meshTarget = interp.tgtRegion();
const labelListList& sourceToTarget = interp.srcToTgtCellAddr();
const pointField& targetCc = meshTarget.cellCentres();
fileNameList cloudDirs
(
readDir
(
meshSource.time().timePath()/cloud::prefix,
fileName::DIRECTORY
)
);
forAll(cloudDirs, cloudI)
{
// Search for list of lagrangian objects for this time
IOobjectList objects
(
meshSource,
meshSource.time().timeName(),
cloud::prefix/cloudDirs[cloudI]
);
IOobject* positionsPtr = objects.lookup(word("positions"));
if (positionsPtr)
{
Info<< nl << " processing cloud " << cloudDirs[cloudI] << endl;
// Read positions & cell
passiveParticleCloud sourceParcels
(
meshSource,
cloudDirs[cloudI],
false
);
Info<< " read " << sourceParcels.size()
<< " parcels from source mesh." << endl;
// Construct empty target cloud
passiveParticleCloud targetParcels
(
meshTarget,
cloudDirs[cloudI],
IDLList<passiveParticle>()
);
particle::TrackingData<passiveParticleCloud> td(targetParcels);
label sourceParticleI = 0;
// Indices of source particles that get added to targetParcels
DynamicList<label> addParticles(sourceParcels.size());
// Unmapped particles
labelHashSet unmappedSource(sourceParcels.size());
// Initial: track from fine-mesh cell centre to particle position
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// This requires there to be no boundary in the way.
forAllConstIter(Cloud<passiveParticle>, sourceParcels, iter)
{
bool foundCell = false;
// Assume that cell from read parcel is the correct one...
if (iter().cell() >= 0)
{
const labelList& targetCells =
sourceToTarget[iter().cell()];
// Particle probably in one of the targetcells. Try
// all by tracking from their cell centre to the parcel
// position.
forAll(targetCells, i)
{
// Track from its cellcentre to position to make sure.
autoPtr<passiveParticle> newPtr
(
new passiveParticle
(
meshTarget,
targetCc[targetCells[i]],
targetCells[i]
)
);
passiveParticle& newP = newPtr();
label faceI = newP.track(iter().position(), td);
if (faceI < 0 && newP.cell() >= 0)
{
// Hit position.
foundCell = true;
addParticles.append(sourceParticleI);
targetParcels.addParticle(newPtr.ptr());
break;
}
}
}
if (!foundCell)
{
// Store for closer analysis
unmappedSource.insert(sourceParticleI);
}
sourceParticleI++;
}
Info<< " after meshToMesh addressing found "
<< targetParcels.size()
<< " parcels in target mesh." << endl;
// Do closer inspection for unmapped particles
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if (unmappedSource.size())
{
sourceParticleI = 0;
forAllIter(Cloud<passiveParticle>, sourceParcels, iter)
{
if (unmappedSource.found(sourceParticleI))
{
label targetCell =
findCell(targetParcels, iter().position());
if (targetCell >= 0)
{
unmappedSource.erase(sourceParticleI);
addParticles.append(sourceParticleI);
iter().cell() = targetCell;
targetParcels.addParticle
(
sourceParcels.remove(&iter())
);
}
}
sourceParticleI++;
}
}
addParticles.shrink();
Info<< " after additional mesh searching found "
<< targetParcels.size() << " parcels in target mesh." << endl;
if (addParticles.size())
{
IOPosition<passiveParticleCloud>(targetParcels).write();
// addParticles now contains the indices of the sourceMesh
// particles that were appended to the target mesh.
// Map lagrangian fields
// ~~~~~~~~~~~~~~~~~~~~~
MapLagrangianFields<label>
(
cloudDirs[cloudI],
objects,
meshTarget,
addParticles
);
MapLagrangianFields<scalar>
(
cloudDirs[cloudI],
objects,
meshTarget,
addParticles
);
MapLagrangianFields<vector>
(
cloudDirs[cloudI],
objects,
meshTarget,
addParticles
);
MapLagrangianFields<sphericalTensor>
(
cloudDirs[cloudI],
objects,
meshTarget,
addParticles
);
MapLagrangianFields<symmTensor>
(
cloudDirs[cloudI],
objects,
meshTarget,
addParticles
);
MapLagrangianFields<tensor>
(
cloudDirs[cloudI],
objects,
meshTarget,
addParticles
);
}
}
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,56 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
InNamespace
Foam
Description
Maps lagrangian positions and fields
SourceFiles
mapLagrangian.C
\*---------------------------------------------------------------------------*/
#ifndef mapLagrangian_H
#define mapLagrangian_H
#include "meshToMeshNew.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
//- Maps lagrangian positions and fields
void mapLagrangian(const meshToMeshNew& interp);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,33 @@
{
instantList sourceTimes = runTimeSource.times();
label sourceTimeIndex = runTimeSource.timeIndex();
if (args.optionFound("sourceTime"))
{
if (args["sourceTime"] == "latestTime")
{
sourceTimeIndex = sourceTimes.size() - 1;
}
else
{
sourceTimeIndex = Time::findClosestTimeIndex
(
sourceTimes,
args.optionRead<scalar>("sourceTime")
);
}
}
else
{
sourceTimeIndex = Time::findClosestTimeIndex
(
sourceTimes,
runTimeTarget.time().value()
);
}
runTimeSource.setTime(sourceTimes[sourceTimeIndex], sourceTimeIndex);
Info<< "\nSource time: " << runTimeSource.value()
<< "\nTarget time: " << runTimeTarget.value()
<< endl;
}

View File

@ -32,6 +32,19 @@ forAll(patches, patchI)
}
}
labelList triSurfaceToAgglom(5*nFineFaces);
const triSurface localSurface = triangulate
(
patches,
includePatches,
finalAgglom,
triSurfaceToAgglom,
globalNumbering,
coarsePatches
);
distributedTriSurfaceMesh surfacesMesh
(
IOobject
@ -43,12 +56,13 @@ distributedTriSurfaceMesh surfacesMesh
IOobject::NO_READ,
IOobject::NO_WRITE
),
triSurfaceTools::triangulate
(
patches,
includePatches
),
localSurface,
dict
);
triSurfaceToAgglom.resize(surfacesMesh.size());
//surfacesMesh.searchableSurface::write();
surfacesMesh.setField(triSurfaceToAgglom);

View File

@ -2,7 +2,7 @@
// Pre-size by assuming a certain percentage is visible.
// Maximum lenght for dynamicList
const label maxDynListLength = 10000;
const label maxDynListLength = 100000;
for (label procI = 0; procI < Pstream::nProcs(); procI++)
{
@ -14,12 +14,17 @@ for (label procI = 0; procI < Pstream::nProcs(); procI++)
DynamicList<label> startIndex(start.size());
DynamicList<label> endIndex(start.size());
DynamicList<label> startAgg(start.size());
DynamicList<label> endAgg(start.size());
const pointField& myFc = remoteCoarseCf[Pstream::myProcNo()];
const vectorField& myArea = remoteCoarseSf[Pstream::myProcNo()];
const labelField& myAgg = remoteCoarseAgg[Pstream::myProcNo()];
const pointField& remoteArea = remoteCoarseSf[procI];
const pointField& remoteFc = remoteCoarseCf[procI];
const labelField& remoteAgg = remoteCoarseAgg[procI];
label i = 0;
label j = 0;
@ -29,6 +34,7 @@ for (label procI = 0; procI < Pstream::nProcs(); procI++)
{
const point& fc = myFc[i];
const vector& fA = myArea[i];
const label& fAgg = myAgg[i];
for (; j < remoteFc.size(); j++)//
{
@ -36,26 +42,32 @@ for (label procI = 0; procI < Pstream::nProcs(); procI++)
{
const point& remFc = remoteFc[j];
const vector& remA = remoteArea[j];
const label& remAgg = remoteAgg[j];
const vector& d = remFc - fc;
if (((d & fA) < 0.) && ((d & remA) > 0))
{
start.append(fc + 0.0001*d);
start.append(fc + 0.001*d);
startIndex.append(i);
end.append(fc + 0.9999*d);
startAgg.append(globalNumbering.toGlobal(procI, fAgg));
end.append(fc + 0.999*d);
label globalI = globalNumbering.toGlobal(procI, j);
endIndex.append(globalI);
endAgg.append(globalNumbering.toGlobal(procI, remAgg));
if (startIndex.size() > maxDynListLength)
{
break;
FatalErrorIn
(
"shootRays"
) << "Dynamic list need from capacity."
<< "Actual size maxDynListLength : "
<< maxDynListLength
<< abort(FatalError);
}
}
}
}
if (startIndex.size() > maxDynListLength)
{
break;
}
if (j == remoteFc.size())
{
@ -63,23 +75,102 @@ for (label procI = 0; procI < Pstream::nProcs(); procI++)
}
}
List<pointIndexHit> hitInfo(startIndex.size());
surfacesMesh.findLine(start, end, hitInfo);
}while (returnReduce(i < myFc.size(), orOp<bool>()));
forAll (hitInfo, rayI)
List<pointIndexHit> hitInfo(startIndex.size());
surfacesMesh.findLine(start, end, hitInfo);
// Return hit global agglo index
labelList aggHitIndex;
surfacesMesh.getField(hitInfo, aggHitIndex);
DynamicList<label> dRayIs;
// Collect the rays which has not abstacle in bettween in rayStartFace
// and rayEndFace. If the ray hit itself get stored in dRayIs
forAll (hitInfo, rayI)
{
if (!hitInfo[rayI].hit())
{
if (!hitInfo[rayI].hit())
rayStartFace.append(startIndex[rayI]);
rayEndFace.append(endIndex[rayI]);
}
else if (aggHitIndex[rayI] == startAgg[rayI])
{
dRayIs.append(rayI);
}
}
start.clear();
// Continue rays which hit themself. If they hit the target
// agglomeration are added to rayStartFace and rayEndFace
bool firstLoop = true;
DynamicField<point> startHitItself;
DynamicField<point> endHitItself;
label iter = 0;
do
{
labelField rayIs;
rayIs.transfer(dRayIs);
dRayIs.clear();
forAll (rayIs, rayI)
{
const label rayID = rayIs[rayI];
label hitIndex = -1;
if (firstLoop)
{
rayStartFace.append(startIndex[rayI]);
rayEndFace.append(endIndex[rayI]);
hitIndex = rayIs[rayI];
}
else
{
hitIndex = rayI;
}
if (hitInfo[hitIndex].hit())
{
if (aggHitIndex[hitIndex] == startAgg[rayID])
{
const vector& endP = end[rayID];
const vector& startP = hitInfo[hitIndex].hitPoint();
const vector& d = endP - startP;
startHitItself.append(startP + 0.01*d);
endHitItself.append(startP + 1.01*d);
dRayIs.append(rayID);
}
else if (aggHitIndex[hitIndex] == endAgg[rayID])
{
rayStartFace.append(startIndex[rayID]);
rayEndFace.append(endIndex[rayID]);
}
}
}
start.clear();
startIndex.clear();
end.clear();
endIndex.clear();
hitInfo.clear();
hitInfo.resize(dRayIs.size());
}while (returnReduce(i < myFc.size(), orOp<bool>()));
surfacesMesh.findLine(startHitItself, endHitItself, hitInfo);
surfacesMesh.getField(hitInfo, aggHitIndex);
endHitItself.clear();
startHitItself.clear();
firstLoop = false;
iter ++;
}while (returnReduce(hitInfo.size(), orOp<bool>()) > 0 && iter < 10);
startIndex.clear();
end.clear();
endIndex.clear();
startAgg.clear();
endAgg.clear();
}

View File

@ -68,6 +68,101 @@ Description
using namespace Foam;
triSurface triangulate
(
const polyBoundaryMesh& bMesh,
const labelHashSet& includePatches,
const labelListIOList& finalAgglom,
labelList& triSurfaceToAgglom,
const globalIndex& globalNumbering,
const polyBoundaryMesh& coarsePatches
)
{
const polyMesh& mesh = bMesh.mesh();
// Storage for surfaceMesh. Size estimate.
DynamicList<labelledTri> triangles
(
mesh.nFaces() - mesh.nInternalFaces()
);
label newPatchI = 0;
label localTriFaceI = 0;
forAllConstIter(labelHashSet, includePatches, iter)
{
const label patchI = iter.key();
const polyPatch& patch = bMesh[patchI];
const pointField& points = patch.points();
label nTriTotal = 0;
forAll(patch, patchFaceI)
{
const face& f = patch[patchFaceI];
faceList triFaces(f.nTriangles(points));
label nTri = 0;
f.triangles(points, nTri, triFaces);
forAll(triFaces, triFaceI)
{
const face& f = triFaces[triFaceI];
triangles.append(labelledTri(f[0], f[1], f[2], newPatchI));
nTriTotal++;
triSurfaceToAgglom[localTriFaceI++] = globalNumbering.toGlobal
(
Pstream::myProcNo(),
finalAgglom[patchI][patchFaceI]
+ coarsePatches[patchI].start()
);
}
}
newPatchI++;
}
triSurfaceToAgglom.resize(localTriFaceI-1);
triangles.shrink();
// Create globally numbered tri surface
triSurface rawSurface(triangles, mesh.points());
// Create locally numbered tri surface
triSurface surface
(
rawSurface.localFaces(),
rawSurface.localPoints()
);
// Add patch names to surface
surface.patches().setSize(newPatchI);
newPatchI = 0;
forAllConstIter(labelHashSet, includePatches, iter)
{
const label patchI = iter.key();
const polyPatch& patch = bMesh[patchI];
surface.patches()[newPatchI].index() = patchI;
surface.patches()[newPatchI].name() = patch.name();
surface.patches()[newPatchI].geometricType() = patch.type();
newPatchI++;
}
return surface;
}
void writeRays
(
const fileName& fName,
@ -213,7 +308,7 @@ int main(int argc, char *argv[])
if (debug)
{
Info << "\nCreating single cell mesh..." << endl;
Pout << "\nCreating single cell mesh..." << endl;
}
singleCellFvMesh coarseMesh
@ -230,6 +325,11 @@ int main(int argc, char *argv[])
finalAgglom
);
if (debug)
{
Pout << "\nCreated single cell mesh..." << endl;
}
// Calculate total number of fine and coarse faces
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -283,6 +383,8 @@ int main(int argc, char *argv[])
DynamicList<point> localCoarseCf(nCoarseFaces);
DynamicList<point> localCoarseSf(nCoarseFaces);
DynamicList<label> localAgg(nCoarseFaces);
forAll (viewFactorsPatches, i)
{
const label patchID = viewFactorsPatches[i];
@ -296,11 +398,18 @@ int main(int argc, char *argv[])
const pointField& coarseCf = coarseMesh.Cf().boundaryField()[patchID];
const pointField& coarseSf = coarseMesh.Sf().boundaryField()[patchID];
labelHashSet includePatches;
includePatches.insert(patchID);
forAll(coarseCf, faceI)
{
point cf = coarseCf[faceI];
const label coarseFaceI = coarsePatchFace[faceI];
const labelList& fineFaces = coarseToFine[coarseFaceI];
const label agglomI =
agglom[fineFaces[0]] + coarsePatches[patchID].start();
// Construct single face
uindirectPrimitivePatch upp
(
@ -308,6 +417,7 @@ int main(int argc, char *argv[])
pp.points()
);
List<point> availablePoints
(
upp.faceCentres().size()
@ -342,6 +452,7 @@ int main(int argc, char *argv[])
point sf = coarseSf[faceI];
localCoarseCf.append(cf);
localCoarseSf.append(sf);
localAgg.append(agglomI);
}
}
@ -350,9 +461,12 @@ int main(int argc, char *argv[])
List<pointField> remoteCoarseCf(Pstream::nProcs());
List<pointField> remoteCoarseSf(Pstream::nProcs());
List<labelField> remoteCoarseAgg(Pstream::nProcs());
remoteCoarseCf[Pstream::myProcNo()] = localCoarseCf;
remoteCoarseSf[Pstream::myProcNo()] = localCoarseSf;
remoteCoarseAgg[Pstream::myProcNo()] = localAgg;
// Collect remote Cf and Sf on fine mesh
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -370,8 +484,12 @@ int main(int argc, char *argv[])
Pstream::scatterList(remoteCoarseCf);
Pstream::gatherList(remoteCoarseSf);
Pstream::scatterList(remoteCoarseSf);
Pstream::gatherList(remoteCoarseAgg);
Pstream::scatterList(remoteCoarseAgg);
globalIndex globalNumbering(nCoarseFaces);
// Set up searching engine for obstacles
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#include "searchingEngine.H"
@ -383,8 +501,6 @@ int main(int argc, char *argv[])
DynamicList<label> rayEndFace(rayStartFace.size());
globalIndex globalNumbering(nCoarseFaces);
// Return rayStartFace in local index andrayEndFace in global index
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -435,7 +435,7 @@ int main(int argc, char *argv[])
scalar smallDim = 1e-6 * bb.mag();
Info<< "Checking for points less than 1e-6 of bounding box ("
<< bb.span() << " meter) apart."
<< bb.span() << " metre) apart."
<< endl;
// Sort points

View File

@ -54,7 +54,7 @@ int main(int argc, char *argv[])
const fileName outFileName = args[3];
Info<< "Reading surface from " << surfFileName << " ..." << endl;
Info<< "Merging points within " << mergeTol << " meter." << endl;
Info<< "Merging points within " << mergeTol << " metre." << endl;
triSurface surf1(surfFileName);

View File

@ -224,6 +224,13 @@ case ThirdParty:
set mpfr_version=mpfr-3.1.0
set mpc_version=mpc-0.9
breaksw
case Gcc48:
case Gcc48++0x:
set gcc_version=gcc-4.8.0
set gmp_version=gmp-5.0.4
set mpfr_version=mpfr-3.1.0
set mpc_version=mpc-0.9
breaksw
case Gcc47:
case Gcc47++0x:
set gcc_version=gcc-4.7.2
@ -242,8 +249,7 @@ case ThirdParty:
# using clang - not gcc
setenv WM_CC 'clang'
setenv WM_CXX 'clang++'
set clang_version=llvm-3.1
#set clang_version=llvm-svn
set clang_version=llvm-3.2
breaksw
default:
echo

View File

@ -246,6 +246,12 @@ OpenFOAM | ThirdParty)
mpfr_version=mpfr-3.1.0
mpc_version=mpc-0.9
;;
Gcc48 | Gcc48++0x)
gcc_version=gcc-4.8.0
gmp_version=gmp-5.0.4
mpfr_version=mpfr-3.1.0
mpc_version=mpc-0.9
;;
Gcc47 | Gcc47++0x)
gcc_version=gcc-4.7.2
gmp_version=gmp-5.0.4
@ -262,8 +268,7 @@ OpenFOAM | ThirdParty)
# using clang - not gcc
export WM_CC='clang'
export WM_CXX='clang++'
clang_version=llvm-3.1
#clang_version=llvm-svn
clang_version=llvm-3.2
;;
*)
echo 1>&2

View File

@ -105,6 +105,7 @@ void Foam::IOdictionary::readFile(const bool masterOnly)
myComm.above(),
0,
Pstream::msgType(),
Pstream::worldComm,
IOstream::ASCII
);
IOdictionary::readData(fromAbove);
@ -124,6 +125,7 @@ void Foam::IOdictionary::readFile(const bool masterOnly)
myComm.below()[belowI],
0,
Pstream::msgType(),
Pstream::worldComm,
IOstream::ASCII
);
IOdictionary::writeData(toBelow);

View File

@ -243,6 +243,7 @@ bool Foam::regIOobject::read()
myComm.above(),
0,
Pstream::msgType(),
Pstream::worldComm,
IOstream::ASCII
);
ok = readData(fromAbove);
@ -257,6 +258,7 @@ bool Foam::regIOobject::read()
myComm.below()[belowI],
0,
Pstream::msgType(),
Pstream::worldComm,
IOstream::ASCII
);
writeData(toBelow);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -677,7 +677,6 @@ template<class Type>
template<class Form, class Cmpt, int nCmpt>
void Foam::Field<Type>::operator=(const VectorSpace<Form,Cmpt,nCmpt>& vs)
{
typedef VectorSpace<Form,Cmpt,nCmpt> VSType;
TFOR_ALL_F_OP_S(Type, *this, =, VSType, vs)
}

View File

@ -122,7 +122,8 @@ void Foam::processorCyclicPointPatchField<Type>::initSwapAddSeparated
procPatch_.neighbProcNo(),
reinterpret_cast<char*>(receiveBuf_.begin()),
receiveBuf_.byteSize(),
procPatch_.tag()
procPatch_.tag(),
procPatch_.comm()
);
}
OPstream::write
@ -131,7 +132,8 @@ void Foam::processorCyclicPointPatchField<Type>::initSwapAddSeparated
procPatch_.neighbProcNo(),
reinterpret_cast<const char*>(pf.begin()),
pf.byteSize(),
procPatch_.tag()
procPatch_.tag(),
procPatch_.comm()
);
}
}
@ -156,7 +158,8 @@ void Foam::processorCyclicPointPatchField<Type>::swapAddSeparated
procPatch_.neighbProcNo(),
reinterpret_cast<char*>(receiveBuf_.begin()),
receiveBuf_.byteSize(),
procPatch_.tag()
procPatch_.tag(),
procPatch_.comm()
);
}

View File

@ -373,7 +373,8 @@ Foam::argList::argList
int& argc,
char**& argv,
bool checkArgs,
bool checkOpts
bool checkOpts,
const bool initialise
)
:
args_(argc),
@ -405,12 +406,12 @@ Foam::argList::argList
// Check arguments and options, we already have argv[0]
int nArgs = 1;
string argListString = args_[0];
argListStr_ = args_[0];
for (int argI = 1; argI < args_.size(); ++argI)
{
argListString += ' ';
argListString += args_[argI];
argListStr_ += ' ';
argListStr_ += args_[argI];
if (args_[argI][0] == '-')
{
@ -438,8 +439,8 @@ Foam::argList::argList
FatalError.exit();
}
argListString += ' ';
argListString += args_[argI];
argListStr_ += ' ';
argListStr_ += args_[argI];
options_.insert(optionName, args_[argI]);
}
else
@ -459,6 +460,39 @@ Foam::argList::argList
args_.setSize(nArgs);
parse(checkArgs, checkOpts, initialise);
}
Foam::argList::argList
(
const argList& args,
const HashTable<string>& options,
bool checkArgs,
bool checkOpts,
bool initialise
)
:
args_(args.args_),
options_(options),
executable_(args.executable_),
rootPath_(args.rootPath_),
globalCase_(args.globalCase_),
case_(args.case_),
argListStr_(args.argListStr_),
parRunControl_(args.parRunControl_)
{
parse(checkArgs, checkOpts, initialise);
}
void Foam::argList::parse
(
bool checkArgs,
bool checkOpts,
bool initialise
)
{
// Help/documentation options:
// -help print the usage
// -doc display application documentation in browser
@ -495,42 +529,44 @@ Foam::argList::argList
}
string dateString = clock::date();
string timeString = clock::clockTime();
// Print the banner once only for parallel runs
if (Pstream::master() && bannerEnabled)
if (initialise)
{
IOobject::writeBanner(Info, true)
<< "Build : " << Foam::FOAMbuild << nl
<< "Exec : " << argListString.c_str() << nl
<< "Date : " << dateString.c_str() << nl
<< "Time : " << timeString.c_str() << nl
<< "Host : " << hostName() << nl
<< "PID : " << pid() << endl;
}
string dateString = clock::date();
string timeString = clock::clockTime();
jobInfo.add("startDate", dateString);
jobInfo.add("startTime", timeString);
jobInfo.add("userName", userName());
jobInfo.add("foamVersion", word(FOAMversion));
jobInfo.add("code", executable_);
jobInfo.add("argList", argListString);
jobInfo.add("currentDir", cwd());
jobInfo.add("PPID", ppid());
jobInfo.add("PGID", pgid());
// add build information - only use the first word
{
std::string build(Foam::FOAMbuild);
std::string::size_type found = build.find(' ');
if (found != std::string::npos)
// Print the banner once only for parallel runs
if (Pstream::master() && bannerEnabled)
{
build.resize(found);
IOobject::writeBanner(Info, true)
<< "Build : " << Foam::FOAMbuild << nl
<< "Exec : " << argListStr_.c_str() << nl
<< "Date : " << dateString.c_str() << nl
<< "Time : " << timeString.c_str() << nl
<< "Host : " << hostName() << nl
<< "PID : " << pid() << endl;
}
jobInfo.add("foamBuild", build);
}
jobInfo.add("startDate", dateString);
jobInfo.add("startTime", timeString);
jobInfo.add("userName", userName());
jobInfo.add("foamVersion", word(FOAMversion));
jobInfo.add("code", executable_);
jobInfo.add("argList", argListStr_);
jobInfo.add("currentDir", cwd());
jobInfo.add("PPID", ppid());
jobInfo.add("PGID", pgid());
// add build information - only use the first word
{
std::string build(Foam::FOAMbuild);
std::string::size_type found = build.find(' ');
if (found != std::string::npos)
{
build.resize(found);
}
jobInfo.add("foamBuild", build);
}
}
// Case is a single processor run unless it is running parallel
int nProcs = 1;
@ -781,51 +817,55 @@ Foam::argList::argList
}
}
jobInfo.add("root", rootPath_);
jobInfo.add("case", globalCase_);
jobInfo.add("nProcs", nProcs);
if (slaveProcs.size())
if (initialise)
{
jobInfo.add("slaves", slaveProcs);
}
if (roots.size())
{
jobInfo.add("roots", roots);
}
jobInfo.write();
// Switch on signal trapping. We have to wait until after Pstream::init
// since this sets up its own ones.
sigFpe_.set(bannerEnabled);
sigInt_.set(bannerEnabled);
sigQuit_.set(bannerEnabled);
sigSegv_.set(bannerEnabled);
if (bannerEnabled)
{
Info<< "fileModificationChecking : "
<< "Monitoring run-time modified files using "
<< regIOobject::fileCheckTypesNames
[
regIOobject::fileModificationChecking
]
<< endl;
Info<< "allowSystemOperations : ";
if (dynamicCode::allowSystemOperations)
jobInfo.add("root", rootPath_);
jobInfo.add("case", globalCase_);
jobInfo.add("nProcs", nProcs);
if (slaveProcs.size())
{
Info<< "Allowing user-supplied system call operations" << endl;
jobInfo.add("slaves", slaveProcs);
}
else
if (roots.size())
{
Info<< "Disallowing user-supplied system call operations" << endl;
jobInfo.add("roots", roots);
}
}
jobInfo.write();
if (Pstream::master() && bannerEnabled)
{
Info<< endl;
IOobject::writeDivider(Info);
// Switch on signal trapping. We have to wait until after Pstream::init
// since this sets up its own ones.
sigFpe_.set(bannerEnabled);
sigInt_.set(bannerEnabled);
sigQuit_.set(bannerEnabled);
sigSegv_.set(bannerEnabled);
if (bannerEnabled)
{
Info<< "fileModificationChecking : "
<< "Monitoring run-time modified files using "
<< regIOobject::fileCheckTypesNames
[
regIOobject::fileModificationChecking
]
<< endl;
Info<< "allowSystemOperations : ";
if (dynamicCode::allowSystemOperations)
{
Info<< "Allowing user-supplied system call operations" << endl;
}
else
{
Info<< "Disallowing user-supplied system call operations"
<< endl;
}
}
if (Pstream::master() && bannerEnabled)
{
Info<< endl;
IOobject::writeDivider(Info);
}
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -41,7 +41,7 @@ Description
\par Default command-line options
\param -case \<dir\> \n
select an case directory instead of the current working directory
select a case directory instead of the current working directory
\param -parallel \n
specify case as a parallel job
\param -doc \n
@ -69,6 +69,7 @@ Note
SourceFiles
argList.C
argListI.H
\*---------------------------------------------------------------------------*/
@ -111,6 +112,7 @@ class argList
fileName rootPath_;
fileName globalCase_;
fileName case_;
string argListStr_;
ParRunControl parRunControl_;
@ -186,17 +188,37 @@ public:
(
int& argc,
char**& argv,
bool checkArgs=true,
bool checkOpts=true
bool checkArgs = true,
bool checkOpts = true,
bool initialise = true
);
//- Construct copy with new options
argList
(
const argList& args,
const HashTable<string>& options,
bool checkArgs = true,
bool checkOpts = true,
bool initialise = true
);
//- Destructor
virtual ~argList();
//- Destructor
virtual ~argList();
// Member functions
//- Parse
void parse
(
bool checkArgs,
bool checkOpts,
bool initialise
);
// Access
//- Name of executable without the path
@ -211,12 +233,18 @@ public:
//- Return case name
inline const fileName& globalCaseName() const;
//- Return parRunControl
inline const ParRunControl& parRunControl() const;
//- Return the path to the caseName
inline fileName path() const;
//- Return arguments
inline const stringList& args() const;
//- Return non-const access to arguments
inline stringList& args();
//- Return the argument corresponding to index.
inline const string& arg(const label index) const;
@ -240,6 +268,9 @@ public:
//- Return options
inline const Foam::HashTable<string>& options() const;
//- Return non-const access to options
inline Foam::HashTable<string>& options();
//- Return the argument string associated with the named option
inline const string& option(const word& opt) const;
@ -295,6 +326,7 @@ public:
// \sa option()
inline const string& operator[](const word& opt) const;
// Edit
//- Add to a bool option to validOptions with usage information

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -51,6 +51,12 @@ inline const Foam::fileName& Foam::argList::globalCaseName() const
}
inline const Foam::ParRunControl& Foam::argList::parRunControl() const
{
return parRunControl_;
}
inline Foam::fileName Foam::argList::path() const
{
return rootPath()/caseName();
@ -63,6 +69,12 @@ inline const Foam::stringList& Foam::argList::args() const
}
inline Foam::stringList& Foam::argList::args()
{
return args_;
}
inline const Foam::string& Foam::argList::arg(const label index) const
{
return args_[index];
@ -81,6 +93,12 @@ inline const Foam::HashTable<Foam::string>& Foam::argList::options() const
}
inline Foam::HashTable<Foam::string>& Foam::argList::options()
{
return options_;
}
inline const Foam::string& Foam::argList::option(const word& opt) const
{
return options_[opt];

View File

@ -122,7 +122,7 @@ void Foam::lduPrimitiveMesh::checkUpperTriangular
}
Foam::label Foam::lduPrimitiveMesh::size
Foam::label Foam::lduPrimitiveMesh::totalSize
(
const PtrList<lduPrimitiveMesh>& meshes
)
@ -294,7 +294,7 @@ Foam::lduPrimitiveMesh::lduPrimitiveMesh
labelListListList& boundaryFaceMap
)
:
lduAddressing(myMesh.lduAddr().size() + size(otherMeshes)),
lduAddressing(myMesh.lduAddr().size() + totalSize(otherMeshes)),
lowerAddr_(0),
upperAddr_(0),
interfaces_(0),

View File

@ -76,7 +76,7 @@ class lduPrimitiveMesh
// Private Member Functions
//- Get size of all meshes
static label size(const PtrList<lduPrimitiveMesh>&);
static label totalSize(const PtrList<lduPrimitiveMesh>&);
static labelList upperTriOrder
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -134,6 +134,12 @@ public:
return procPolyPatch_.tag();
}
//- Return communicator used for communication
virtual label comm() const
{
return procPolyPatch_.comm();
}
//- Return the constraint type this pointPatch implements.
virtual const word& constraintType() const
{

View File

@ -246,14 +246,6 @@ public:
}
}
//- Return communicator used for communication
label comm() const
{
//return comm_;
return boundaryMesh().mesh().comm();
}
//- Return processor number
int myProcNo() const
{
@ -266,30 +258,6 @@ public:
return neighbProcNo_;
}
// For testing
// //- Return communicator used for communication
// label& comm()
// {
// return comm_;
// }
//- Return processor number
int& myProcNo()
{
return myProcNo_;
}
//- Return neigbour processor number
int& neighbProcNo()
{
return neighbProcNo_;
}
//- Does the processor own the patch ?
virtual bool owner() const
{
@ -332,6 +300,12 @@ public:
return Pstream::msgType();
}
//- Return communicator used for communication
virtual label comm() const
{
return boundaryMesh().mesh().comm();
}
//- Transform a patch-based position from other side to this side
virtual void transformPosition(pointField& l) const
{}

View File

@ -1542,7 +1542,7 @@ void Foam::faceCoupleInfo::perfectPointMatch
) << "Did not match all of the master faces to the slave faces"
<< endl
<< "This usually means that the slave patch and master patch"
<< " do not align to within " << absTol << " meter."
<< " do not align to within " << absTol << " metre."
<< abort(FatalError);
}

View File

@ -485,7 +485,7 @@ Foam::polyMeshFilter::polyMeshFilter(const fvMesh& mesh)
faceFilterFactor_()
{
Info<< "Merging:" << nl
<< " edges with length less than " << minLen_ << " meters" << nl
<< " edges with length less than " << minLen_ << " metres" << nl
<< " edges split by a point with edges in line to within "
<< radToDeg(::acos(maxCos_)) << " degrees" << nl
<< " Minimum edge length reduction factor = "

View File

@ -181,6 +181,7 @@ $(derivedFvPatchFields)/translatingWallVelocity/translatingWallVelocityFvPatchVe
$(derivedFvPatchFields)/turbulentInlet/turbulentInletFvPatchFields.C
$(derivedFvPatchFields)/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.C
$(derivedFvPatchFields)/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.C
$(derivedFvPatchFields)/uniformFixedGradient/uniformFixedGradientFvPatchFields.C
$(derivedFvPatchFields)/uniformFixedValue/uniformFixedValueFvPatchFields.C
$(derivedFvPatchFields)/uniformJump/uniformJumpFvPatchFields.C
$(derivedFvPatchFields)/uniformJumpAMI/uniformJumpAMIFvPatchFields.C
@ -321,8 +322,6 @@ $(ddtSchemes)/CoEulerDdtScheme/CoEulerDdtSchemes.C
$(ddtSchemes)/SLTSDdtScheme/SLTSDdtSchemes.C
$(ddtSchemes)/localEulerDdtScheme/localEulerDdtSchemes.C
$(ddtSchemes)/backwardDdtScheme/backwardDdtSchemes.C
$(ddtSchemes)/boundedBackwardDdtScheme/boundedBackwardDdtScheme.C
$(ddtSchemes)/boundedBackwardDdtScheme/boundedBackwardDdtSchemes.C
$(ddtSchemes)/CrankNicolsonDdtScheme/CrankNicolsonDdtSchemes.C
$(ddtSchemes)/boundedDdtScheme/boundedDdtSchemes.C
@ -404,5 +403,4 @@ $(SRF)/SRFModel/rpm/rpm.C
$(SRF)/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.C
$(SRF)/derivedFvPatchFields/SRFFreestreamVelocityFvPatchVectorField/SRFFreestreamVelocityFvPatchVectorField.C
LIB = $(FOAM_LIBBIN)/libfiniteVolume

View File

@ -0,0 +1,12 @@
const dictionary& alphaControls = mesh.solverDict(alpha1.name());
label nAlphaCorr(readLabel(alphaControls.lookup("nAlphaCorr")));
label nAlphaSubCycles(readLabel(alphaControls.lookup("nAlphaSubCycles")));
Switch MULESCorr(alphaControls.lookupOrDefault<Switch>("MULESCorr", false));
if (nAlphaSubCycles > 1 && pimple.nCorrPIMPLE() != 1)
{
FatalErrorIn(args.executable())
<< "Sub-cycling alpha is only allowed for PISO operation, "
"i.e. when the number of outer-correctors = 1"
<< exit(FatalError);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -95,8 +95,6 @@ mappedFixedPushedInternalValueFvPatchField
template<class Type>
void Foam::mappedFixedPushedInternalValueFvPatchField<Type>::updateCoeffs()
{
typedef GeometricField<Type, fvPatchField, volMesh> FieldType;
if (this->updated())
{
return;

View File

@ -0,0 +1,172 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "uniformFixedGradientFvPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
uniformFixedGradientFvPatchField<Type>::uniformFixedGradientFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF
)
:
fixedGradientFvPatchField<Type>(p, iF),
uniformGradient_()
{}
template<class Type>
uniformFixedGradientFvPatchField<Type>::uniformFixedGradientFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const Field<Type>& fld
)
:
fixedGradientFvPatchField<Type>(p, iF, fld),
uniformGradient_()
{}
template<class Type>
uniformFixedGradientFvPatchField<Type>::uniformFixedGradientFvPatchField
(
const uniformFixedGradientFvPatchField<Type>& ptf,
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
fixedGradientFvPatchField<Type>(ptf, p, iF, mapper),
uniformGradient_(ptf.uniformGradient_().clone().ptr())
{
// For safety re-evaluate
const scalar t = this->db().time().timeOutputValue();
this->gradient() = uniformGradient_->value(t);
}
template<class Type>
uniformFixedGradientFvPatchField<Type>::uniformFixedGradientFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const dictionary& dict
)
:
fixedGradientFvPatchField<Type>(p, iF),
uniformGradient_(DataEntry<Type>::New("uniformGradient", dict))
{
if (dict.found("gradient"))
{
this->gradient() = Field<Type>("gradient", dict, p.size());
}
else
{
const scalar t = this->db().time().timeOutputValue();
this->gradient() = uniformGradient_->value(t);
}
}
template<class Type>
uniformFixedGradientFvPatchField<Type>::uniformFixedGradientFvPatchField
(
const uniformFixedGradientFvPatchField<Type>& ptf
)
:
fixedGradientFvPatchField<Type>(ptf),
uniformGradient_
(
ptf.uniformGradient_.valid()
? ptf.uniformGradient_().clone().ptr()
: NULL
)
{}
template<class Type>
uniformFixedGradientFvPatchField<Type>::uniformFixedGradientFvPatchField
(
const uniformFixedGradientFvPatchField<Type>& ptf,
const DimensionedField<Type, volMesh>& iF
)
:
fixedGradientFvPatchField<Type>(ptf, iF),
uniformGradient_
(
ptf.uniformGradient_.valid()
? ptf.uniformGradient_().clone().ptr()
: NULL
)
{
// For safety re-evaluate
const scalar t = this->db().time().timeOutputValue();
if (ptf.uniformGradient_.valid())
{
this->gradient() = uniformGradient_->value(t);
}
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void uniformFixedGradientFvPatchField<Type>::updateCoeffs()
{
if (this->updated())
{
return;
}
const scalar t = this->db().time().timeOutputValue();
this->gradient() = uniformGradient_->value(t);
fixedGradientFvPatchField<Type>::updateCoeffs();
}
template<class Type>
void uniformFixedGradientFvPatchField<Type>::write(Ostream& os) const
{
fixedGradientFvPatchField<Type>::write(os);
uniformGradient_->writeData(os);
this->writeEntry("value", os);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,193 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::uniformFixedGradientFvPatchField
Group
grpGenericBoundaryConditions
Description
This boundary condition provides a uniform fixed gradient condition.
\heading Patch usage
\table
Property | Description | Required | Default value
uniformGradient | uniform gradient | yes |
\endtable
Example of the boundary condition specification:
\verbatim
myPatch
{
type uniformFixedGradient;
uniformGradient constant 0.2;
}
\endverbatim
Note
The uniformGradient entry is a DataEntry type, able to describe time
varying functions. The example above gives the usage for supplying a
constant value.
SeeAlso
Foam::DataEntry
Foam::fixedGradientFvPatchField
SourceFiles
uniformFixedGradientFvPatchField.C
\*---------------------------------------------------------------------------*/
#ifndef uniformFixedGradientFvPatchField_H
#define uniformFixedGradientFvPatchField_H
#include "fixedGradientFvPatchFields.H"
#include "DataEntry.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class uniformFixedGradientFvPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class uniformFixedGradientFvPatchField
:
public fixedGradientFvPatchField<Type>
{
// Private data
//- Gradient
autoPtr<DataEntry<Type> > uniformGradient_;
public:
//- Runtime type information
TypeName("uniformFixedGradient");
// Constructors
//- Construct from patch and internal field
uniformFixedGradientFvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&
);
//- Construct from patch and internal field and patch field
uniformFixedGradientFvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const Field<Type>& fld
);
//- Construct from patch, internal field and dictionary
uniformFixedGradientFvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const dictionary&
);
//- Construct by mapping given uniformFixedGradientFvPatchField
// onto a new patch
uniformFixedGradientFvPatchField
(
const uniformFixedGradientFvPatchField<Type>&,
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
uniformFixedGradientFvPatchField
(
const uniformFixedGradientFvPatchField<Type>&
);
//- Construct and return a clone
virtual tmp<fvPatchField<Type> > clone() const
{
return tmp<fvPatchField<Type> >
(
new uniformFixedGradientFvPatchField<Type>(*this)
);
}
//- Construct as copy setting internal field reference
uniformFixedGradientFvPatchField
(
const uniformFixedGradientFvPatchField<Type>&,
const DimensionedField<Type, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchField<Type> > clone
(
const DimensionedField<Type, volMesh>& iF
) const
{
return tmp<fvPatchField<Type> >
(
new uniformFixedGradientFvPatchField<Type>(*this, iF)
);
}
// Member functions
// Evaluation functions
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
//- Write
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "uniformFixedGradientFvPatchField.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -23,22 +23,21 @@ License
\*---------------------------------------------------------------------------*/
#include "boundedBackwardDdtScheme.H"
#include "fvMesh.H"
#include "uniformFixedGradientFvPatchFields.H"
#include "addToRunTimeSelectionTable.H"
#include "volFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace fv
{
defineTypeNameAndDebug(boundedBackwardDdtScheme, 0);
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
ddtScheme<scalar>::addIstreamConstructorToTable<boundedBackwardDdtScheme>
addboundedBackwardDdtSchemeIstreamConstructorToTable_;
makePatchFields(uniformFixedGradient);
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,49 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef uniformFixedGradientFvPatchFields_H
#define uniformFixedGradientFvPatchFields_H
#include "uniformFixedGradientFvPatchField.H"
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeFieldTypedefs(uniformFixedGradient);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,50 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef uniformFixedGradientFvPatchFieldsFwd_H
#define uniformFixedGradientFvPatchFieldsFwd_H
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class uniformFixedGradientFvPatchField;
makePatchTypeFieldTypedefs(uniform);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,708 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "boundedBackwardDdtScheme.H"
#include "surfaceInterpolate.H"
#include "fvcDiv.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace fv
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
scalar boundedBackwardDdtScheme::deltaT_() const
{
return mesh().time().deltaTValue();
}
scalar boundedBackwardDdtScheme::deltaT0_() const
{
return mesh().time().deltaT0Value();
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
tmp<volScalarField>
boundedBackwardDdtScheme::fvcDdt
(
const dimensionedScalar& dt
)
{
// No change compared to backward
dimensionedScalar rDeltaT = 1.0/mesh().time().deltaT();
IOobject ddtIOobject
(
"ddt("+dt.name()+')',
mesh().time().timeName(),
mesh()
);
scalar deltaT = deltaT_();
scalar deltaT0 = deltaT0_();
scalar coefft = 1 + deltaT/(deltaT + deltaT0);
scalar coefft00 = deltaT*deltaT/(deltaT0*(deltaT + deltaT0));
scalar coefft0 = coefft + coefft00;
if (mesh().moving())
{
tmp<volScalarField> tdtdt
(
new volScalarField
(
ddtIOobject,
mesh(),
dimensionedScalar
(
"0",
dt.dimensions()/dimTime,
0.0
)
)
);
tdtdt().internalField() = rDeltaT.value()*dt.value()*
(
coefft - (coefft0*mesh().V0() - coefft00*mesh().V00())/mesh().V()
);
return tdtdt;
}
else
{
return tmp<volScalarField>
(
new volScalarField
(
ddtIOobject,
mesh(),
dimensionedScalar
(
"0",
dt.dimensions()/dimTime,
0.0
),
calculatedFvPatchScalarField::typeName
)
);
}
}
tmp<volScalarField>
boundedBackwardDdtScheme::fvcDdt
(
const volScalarField& vf
)
{
dimensionedScalar rDeltaT = 1.0/mesh().time().deltaT();
IOobject ddtIOobject
(
"ddt("+vf.name()+')',
mesh().time().timeName(),
mesh()
);
scalar deltaT = deltaT_();
scalar deltaT0 = deltaT0_(vf);
// Calculate unboundedness indicator
// Note: all times moved by one because access to internal field
// copies current field into the old-time level.
const volScalarField phict
(
mag
(
vf.oldTime().oldTime()
- vf.oldTime().oldTime().oldTime()
)/
(
mag
(
vf.oldTime()
- vf.oldTime().oldTime()
)
+ dimensionedScalar("small", vf.dimensions(), VSMALL)
)
);
const volScalarField limiter(pos(phict) - pos(phict - scalar(1)));
const volScalarField coefft(scalar(1) + limiter*deltaT/(deltaT + deltaT0));
const volScalarField coefft00
(
limiter*sqr(deltaT)/(deltaT0*(deltaT + deltaT0))
);
const volScalarField coefft0(coefft + coefft00);
if (mesh().moving())
{
return tmp<volScalarField>
(
new volScalarField
(
ddtIOobject,
mesh(),
rDeltaT.dimensions()*vf.dimensions(),
rDeltaT.value()*
(
coefft*vf.internalField() -
(
coefft0.internalField()
*vf.oldTime().internalField()*mesh().V0()
- coefft00.internalField()
*vf.oldTime().oldTime().internalField()
*mesh().V00()
)/mesh().V()
),
rDeltaT.value()*
(
coefft.boundaryField()*vf.boundaryField() -
(
coefft0.boundaryField()*
vf.oldTime().boundaryField()
- coefft00.boundaryField()*
vf.oldTime().oldTime().boundaryField()
)
)
)
);
}
else
{
return tmp<volScalarField>
(
new volScalarField
(
ddtIOobject,
rDeltaT*
(
coefft*vf
- coefft0*vf.oldTime()
+ coefft00*vf.oldTime().oldTime()
)
)
);
}
}
tmp<volScalarField>
boundedBackwardDdtScheme::fvcDdt
(
const dimensionedScalar& rho,
const volScalarField& vf
)
{
dimensionedScalar rDeltaT = 1.0/mesh().time().deltaT();
IOobject ddtIOobject
(
"ddt("+rho.name()+','+vf.name()+')',
mesh().time().timeName(),
mesh()
);
scalar deltaT = deltaT_();
scalar deltaT0 = deltaT0_(vf);
// Calculate unboundedness indicator
// Note: all times moved by one because access to internal field
// copies current field into the old-time level.
const volScalarField phict
(
mag
(
vf.oldTime().oldTime()
- vf.oldTime().oldTime().oldTime()
)/
(
mag
(
vf.oldTime()
- vf.oldTime().oldTime()
)
+ dimensionedScalar("small", vf.dimensions(), VSMALL)
)
);
const volScalarField limiter(pos(phict) - pos(phict - scalar(1)));
const volScalarField coefft(scalar(1) + limiter*deltaT/(deltaT + deltaT0));
const volScalarField coefft00
(
limiter*sqr(deltaT)/(deltaT0*(deltaT + deltaT0))
);
const volScalarField coefft0(coefft + coefft00);
if (mesh().moving())
{
return tmp<volScalarField>
(
new volScalarField
(
ddtIOobject,
mesh(),
rDeltaT.dimensions()*rho.dimensions()*vf.dimensions(),
rDeltaT.value()*rho.value()*
(
coefft*vf.internalField() -
(
coefft0.internalField()*
vf.oldTime().internalField()*mesh().V0()
- coefft00.internalField()*
vf.oldTime().oldTime().internalField()
*mesh().V00()
)/mesh().V()
),
rDeltaT.value()*rho.value()*
(
coefft.boundaryField()*vf.boundaryField() -
(
coefft0.boundaryField()*
vf.oldTime().boundaryField()
- coefft00.boundaryField()*
vf.oldTime().oldTime().boundaryField()
)
)
)
);
}
else
{
return tmp<volScalarField>
(
new volScalarField
(
ddtIOobject,
rDeltaT*rho*
(
coefft*vf
- coefft0*vf.oldTime()
+ coefft00*vf.oldTime().oldTime()
)
)
);
}
}
tmp<volScalarField>
boundedBackwardDdtScheme::fvcDdt
(
const volScalarField& rho,
const volScalarField& vf
)
{
dimensionedScalar rDeltaT = 1.0/mesh().time().deltaT();
IOobject ddtIOobject
(
"ddt("+rho.name()+','+vf.name()+')',
mesh().time().timeName(),
mesh()
);
scalar deltaT = deltaT_();
scalar deltaT0 = deltaT0_(vf);
// Calculate unboundedness indicator
// Note: all times moved by one because access to internal field
// copies current field into the old-time level.
const volScalarField phict
(
mag
(
rho.oldTime().oldTime()*vf.oldTime().oldTime()
- rho.oldTime().oldTime().oldTime()*vf.oldTime().oldTime().oldTime()
)/
(
mag
(
rho.oldTime()*vf.oldTime()
- rho.oldTime().oldTime()*vf.oldTime().oldTime()
)
+ dimensionedScalar("small", rho.dimensions()*vf.dimensions(), VSMALL)
)
);
const volScalarField limiter(pos(phict) - pos(phict - scalar(1)));
const volScalarField coefft(scalar(1) + limiter*deltaT/(deltaT + deltaT0));
const volScalarField coefft00
(
limiter*sqr(deltaT)/(deltaT0*(deltaT + deltaT0))
);
const volScalarField coefft0(coefft + coefft00);
if (mesh().moving())
{
return tmp<volScalarField>
(
new volScalarField
(
ddtIOobject,
mesh(),
rDeltaT.dimensions()*rho.dimensions()*vf.dimensions(),
rDeltaT.value()*
(
coefft*rho.internalField()*vf.internalField() -
(
coefft0.internalField()*
rho.oldTime().internalField()*
vf.oldTime().internalField()*mesh().V0()
- coefft00.internalField()*
rho.oldTime().oldTime().internalField()
*vf.oldTime().oldTime().internalField()*mesh().V00()
)/mesh().V()
),
rDeltaT.value()*
(
coefft.boundaryField()*vf.boundaryField() -
(
coefft0.boundaryField()*
rho.oldTime().boundaryField()*
vf.oldTime().boundaryField()
- coefft00.boundaryField()*
rho.oldTime().oldTime().boundaryField()*
vf.oldTime().oldTime().boundaryField()
)
)
)
);
}
else
{
return tmp<volScalarField>
(
new volScalarField
(
ddtIOobject,
rDeltaT*
(
coefft*rho*vf
- coefft0*rho.oldTime()*vf.oldTime()
+ coefft00*rho.oldTime().oldTime()*vf.oldTime().oldTime()
)
)
);
}
}
tmp<fvScalarMatrix>
boundedBackwardDdtScheme::fvmDdt
(
const volScalarField& vf
)
{
tmp<fvScalarMatrix> tfvm
(
new fvScalarMatrix
(
vf,
vf.dimensions()*dimVol/dimTime
)
);
fvScalarMatrix& fvm = tfvm();
scalar rDeltaT = 1.0/deltaT_();
scalar deltaT = deltaT_();
scalar deltaT0 = deltaT0_(vf);
// Calculate unboundedness indicator
// Note: all times moved by one because access to internal field
// copies current field into the old-time level.
const scalarField phict
(
mag
(
vf.oldTime().oldTime().internalField()
- vf.oldTime().oldTime().oldTime().internalField()
)/
(
mag
(
vf.oldTime().internalField()
- vf.oldTime().oldTime().internalField()
)
+ VSMALL
)
);
const scalarField limiter(pos(phict) - pos(phict - 1.0));
const scalarField coefft(1.0 + limiter*deltaT/(deltaT + deltaT0));
const scalarField coefft00
(
limiter*deltaT*deltaT/(deltaT0*(deltaT + deltaT0))
);
const scalarField coefft0(coefft + coefft00);
fvm.diag() = (coefft*rDeltaT)*mesh().V();
if (mesh().moving())
{
fvm.source() = rDeltaT*
(
coefft0*vf.oldTime().internalField()*mesh().V0()
- coefft00*vf.oldTime().oldTime().internalField()
*mesh().V00()
);
}
else
{
fvm.source() = rDeltaT*mesh().V()*
(
coefft0*vf.oldTime().internalField()
- coefft00*vf.oldTime().oldTime().internalField()
);
}
return tfvm;
}
tmp<fvScalarMatrix>
boundedBackwardDdtScheme::fvmDdt
(
const dimensionedScalar& rho,
const volScalarField& vf
)
{
tmp<fvScalarMatrix> tfvm
(
new fvScalarMatrix
(
vf,
rho.dimensions()*vf.dimensions()*dimVol/dimTime
)
);
fvScalarMatrix& fvm = tfvm();
scalar rDeltaT = 1.0/deltaT_();
scalar deltaT = deltaT_();
scalar deltaT0 = deltaT0_(vf);
// Calculate unboundedness indicator
// Note: all times moved by one because access to internal field
// copies current field into the old-time level.
const scalarField phict
(
mag
(
vf.oldTime().oldTime().internalField()
- vf.oldTime().oldTime().oldTime().internalField()
)/
(
mag
(
vf.oldTime().internalField()
- vf.oldTime().oldTime().internalField()
)
+ VSMALL
)
);
const scalarField limiter(pos(phict) - pos(phict - 1.0));
const scalarField coefft(1.0 + limiter*deltaT/(deltaT + deltaT0));
const scalarField coefft00
(
limiter*deltaT*deltaT/(deltaT0*(deltaT + deltaT0))
);
const scalarField coefft0(coefft + coefft00);
fvm.diag() = (coefft*rDeltaT*rho.value())*mesh().V();
if (mesh().moving())
{
fvm.source() = rDeltaT*rho.value()*
(
coefft0*vf.oldTime().internalField()*mesh().V0()
- coefft00*vf.oldTime().oldTime().internalField()
*mesh().V00()
);
}
else
{
fvm.source() = rDeltaT*mesh().V()*rho.value()*
(
coefft0*vf.oldTime().internalField()
- coefft00*vf.oldTime().oldTime().internalField()
);
}
return tfvm;
}
tmp<fvScalarMatrix>
boundedBackwardDdtScheme::fvmDdt
(
const volScalarField& rho,
const volScalarField& vf
)
{
tmp<fvScalarMatrix> tfvm
(
new fvScalarMatrix
(
vf,
rho.dimensions()*vf.dimensions()*dimVol/dimTime
)
);
fvScalarMatrix& fvm = tfvm();
scalar rDeltaT = 1.0/deltaT_();
scalar deltaT = deltaT_();
scalar deltaT0 = deltaT0_(vf);
// Calculate unboundedness indicator
// Note: all times moved by one because access to internal field
// copies current field into the old-time level.
const scalarField phict
(
mag
(
rho.oldTime().oldTime().internalField()*
vf.oldTime().oldTime().internalField()
- rho.oldTime().oldTime().oldTime().internalField()*
vf.oldTime().oldTime().oldTime().internalField()
)/
(
mag
(
rho.oldTime().internalField()*
vf.oldTime().internalField()
- rho.oldTime().oldTime().internalField()*
vf.oldTime().oldTime().internalField()
)
+ VSMALL
)
);
const scalarField limiter(pos(phict) - pos(phict - 1.0));
const scalarField coefft(1.0 + limiter*deltaT/(deltaT + deltaT0));
const scalarField coefft00
(
limiter*deltaT*deltaT/(deltaT0*(deltaT + deltaT0))
);
const scalarField coefft0(coefft + coefft00);
fvm.diag() = (coefft*rDeltaT)*rho.internalField()*mesh().V();
if (mesh().moving())
{
fvm.source() = rDeltaT*
(
coefft0*rho.oldTime().internalField()
*vf.oldTime().internalField()*mesh().V0()
- coefft00*rho.oldTime().oldTime().internalField()
*vf.oldTime().oldTime().internalField()*mesh().V00()
);
}
else
{
fvm.source() = rDeltaT*mesh().V()*
(
coefft0*rho.oldTime().internalField()
*vf.oldTime().internalField()
- coefft00*rho.oldTime().oldTime().internalField()
*vf.oldTime().oldTime().internalField()
);
}
return tfvm;
}
tmp<surfaceScalarField> boundedBackwardDdtScheme::fvcDdtPhiCorr
(
const volScalarField& rA,
const volScalarField& U,
const surfaceScalarField& phi
)
{
notImplemented
(
"boundedBackwardDdtScheme::fvcDdtPhiCorr"
);
return surfaceScalarField::null();
}
tmp<surfaceScalarField> boundedBackwardDdtScheme::fvcDdtPhiCorr
(
const volScalarField& rA,
const volScalarField& rho,
const volScalarField& U,
const surfaceScalarField& phi
)
{
notImplemented
(
"boundedBackwardDdtScheme::fvcDdtPhiCorr"
);
return surfaceScalarField::null();
}
tmp<surfaceScalarField> boundedBackwardDdtScheme::meshPhi
(
const volScalarField& vf
)
{
notImplemented
(
"boundedBackwardDdtScheme::meshPhi(const volScalarField& vf)"
);
return surfaceScalarField::null();
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace fv
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -1,193 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::fv::boundedBackwardDdtScheme
Description
Second-order bounded-backward-differencing ddt using the current and
two previous time-step values.
SourceFiles
boundedBackwardDdtScheme.C
\*---------------------------------------------------------------------------*/
#ifndef boundedBackwardDdtScheme_H
#define boundedBackwardDdtScheme_H
#include "ddtScheme.H"
#include "fvMatrices.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace fv
{
/*---------------------------------------------------------------------------*\
Class boundedBackwardDdtScheme Declaration
\*---------------------------------------------------------------------------*/
class boundedBackwardDdtScheme
:
public fv::ddtScheme<scalar>
{
// Private Member Functions
//- Return the current time-step
scalar deltaT_() const;
//- Return the previous time-step
scalar deltaT0_() const;
//- Return the previous time-step or GREAT if the old timestep field
// wasn't available in which case Euler ddt is used
template<class GeoField>
scalar deltaT0_(const GeoField& vf) const
{
if (vf.oldTime().timeIndex() == vf.oldTime().oldTime().timeIndex())
{
return GREAT;
}
else
{
return deltaT0_();
}
}
//- Disallow default bitwise copy construct
boundedBackwardDdtScheme(const boundedBackwardDdtScheme&);
//- Disallow default bitwise assignment
void operator=(const boundedBackwardDdtScheme&);
public:
//- Runtime type information
TypeName("boundedBackward");
// Constructors
//- Construct from mesh
boundedBackwardDdtScheme(const fvMesh& mesh)
:
ddtScheme<scalar>(mesh)
{}
//- Construct from mesh and Istream
boundedBackwardDdtScheme(const fvMesh& mesh, Istream& is)
:
ddtScheme<scalar>(mesh, is)
{}
// Member Functions
//- Return mesh reference
const fvMesh& mesh() const
{
return fv::ddtScheme<scalar>::mesh();
}
tmp<volScalarField> fvcDdt
(
const dimensionedScalar&
);
tmp<volScalarField> fvcDdt
(
const volScalarField&
);
tmp<volScalarField> fvcDdt
(
const dimensionedScalar&,
const volScalarField&
);
tmp<volScalarField> fvcDdt
(
const volScalarField&,
const volScalarField&
);
tmp<fvScalarMatrix> fvmDdt
(
const volScalarField&
);
tmp<fvScalarMatrix> fvmDdt
(
const dimensionedScalar&,
const volScalarField&
);
tmp<fvScalarMatrix> fvmDdt
(
const volScalarField&,
const volScalarField&
);
tmp<surfaceScalarField> fvcDdtPhiCorr
(
const volScalarField& rA,
const volScalarField& U,
const surfaceScalarField& phi
);
tmp<surfaceScalarField> fvcDdtPhiCorr
(
const volScalarField& rA,
const volScalarField& rho,
const volScalarField& U,
const surfaceScalarField& phi
);
tmp<surfaceScalarField> meshPhi
(
const volScalarField&
);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace fv
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -48,6 +48,25 @@ void Foam::MULES::explicitSolve
}
void Foam::MULES::correct
(
volScalarField& psi,
surfaceScalarField& phiPsiCorr,
const scalar psiMax,
const scalar psiMin
)
{
correct
(
geometricOneField(),
psi,
phiPsiCorr,
zeroField(), zeroField(),
psiMax, psiMin
);
}
void Foam::MULES::limitSum(UPtrList<scalarField>& phiPsiCorrs)
{
forAll(phiPsiCorrs[0], facei)

View File

@ -92,6 +92,38 @@ void explicitSolve
const scalar psiMin
);
template<class RhoType, class SpType, class SuType>
void correct
(
const RhoType& rho,
volScalarField& psi,
const surfaceScalarField& phiCorr,
const SpType& Sp,
const SuType& Su
);
template<class RhoType, class SpType, class SuType>
void correct
(
const RhoType& rho,
volScalarField& psi,
surfaceScalarField& phiCorr,
const SpType& Sp,
const SuType& Su,
const scalar psiMax,
const scalar psiMin
);
void correct
(
volScalarField& psi,
surfaceScalarField& phiCorr,
const scalar psiMax,
const scalar psiMin
);
template<class RhoType, class SpType, class SuType>
void limiter
(
@ -122,6 +154,35 @@ void limit
const bool returnCorr
);
template<class RhoType, class SpType, class SuType>
void limiterCorr
(
scalarField& allLambda,
const RhoType& rho,
const volScalarField& psi,
const surfaceScalarField& phiCorr,
const SpType& Sp,
const SuType& Su,
const scalar psiMax,
const scalar psiMin,
const label nLimiterIter
);
template<class RhoType, class SpType, class SuType>
void limitCorr
(
const RhoType& rho,
const volScalarField& psi,
surfaceScalarField& phiCorr,
const SpType& Sp,
const SuType& Su,
const scalar psiMax,
const scalar psiMin,
const label nLimiterIter
);
void limitSum(UPtrList<scalarField>& phiPsiCorrs);
template<class SurfaceScalarFieldList>

View File

@ -96,6 +96,74 @@ void Foam::MULES::explicitSolve
}
template<class RhoType, class SpType, class SuType>
void Foam::MULES::correct
(
const RhoType& rho,
volScalarField& psi,
const surfaceScalarField& phiCorr,
const SpType& Sp,
const SuType& Su
)
{
Info<< "MULES: Correcting " << psi.name() << endl;
const fvMesh& mesh = psi.mesh();
const scalar deltaT = mesh.time().deltaTValue();
scalarField psiIf(psi.size(), 0);
fvc::surfaceIntegrate(psiIf, phiCorr);
if (mesh.moving())
{
psi.internalField() =
(
rho.field()*psi.internalField()/deltaT
+ Su.field()
- psiIf
)/(rho.field()/deltaT - Sp.field());
}
else
{
psi.internalField() =
(
rho.field()*psi.internalField()/deltaT
+ Su.field()
- psiIf
)/(rho.field()/deltaT - Sp.field());
}
psi.correctBoundaryConditions();
}
template<class RhoType, class SpType, class SuType>
void Foam::MULES::correct
(
const RhoType& rho,
volScalarField& psi,
surfaceScalarField& phiCorr,
const SpType& Sp,
const SuType& Su,
const scalar psiMax,
const scalar psiMin
)
{
const fvMesh& mesh = psi.mesh();
const dictionary& MULEScontrols = mesh.solverDict(psi.name());
label nLimiterIter
(
readLabel(MULEScontrols.lookup("nLimiterIter"))
);
limitCorr(rho, psi, phiCorr, Sp, Su, psiMax, psiMin, nLimiterIter);
correct(rho, psi, phiCorr, Sp, Su);
}
template<class RhoType, class SpType, class SuType>
void Foam::MULES::limiter
(
@ -511,6 +579,364 @@ void Foam::MULES::limit
}
template<class RhoType, class SpType, class SuType>
void Foam::MULES::limiterCorr
(
scalarField& allLambda,
const RhoType& rho,
const volScalarField& psi,
const surfaceScalarField& phiCorr,
const SpType& Sp,
const SuType& Su,
const scalar psiMax,
const scalar psiMin,
const label nLimiterIter
)
{
const scalarField& psiIf = psi;
const volScalarField::GeometricBoundaryField& psiBf = psi.boundaryField();
const fvMesh& mesh = psi.mesh();
const labelUList& owner = mesh.owner();
const labelUList& neighb = mesh.neighbour();
tmp<volScalarField::DimensionedInternalField> tVsc = mesh.Vsc();
const scalarField& V = tVsc();
const scalar deltaT = mesh.time().deltaTValue();
const scalarField& phiCorrIf = phiCorr;
const surfaceScalarField::GeometricBoundaryField& phiCorrBf =
phiCorr.boundaryField();
slicedSurfaceScalarField lambda
(
IOobject
(
"lambda",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh,
dimless,
allLambda,
false // Use slices for the couples
);
scalarField& lambdaIf = lambda;
surfaceScalarField::GeometricBoundaryField& lambdaBf =
lambda.boundaryField();
scalarField psiMaxn(psiIf.size(), psiMin);
scalarField psiMinn(psiIf.size(), psiMax);
scalarField sumPhip(psiIf.size(), VSMALL);
scalarField mSumPhim(psiIf.size(), VSMALL);
forAll(phiCorrIf, facei)
{
label own = owner[facei];
label nei = neighb[facei];
psiMaxn[own] = max(psiMaxn[own], psiIf[nei]);
psiMinn[own] = min(psiMinn[own], psiIf[nei]);
psiMaxn[nei] = max(psiMaxn[nei], psiIf[own]);
psiMinn[nei] = min(psiMinn[nei], psiIf[own]);
scalar phiCorrf = phiCorrIf[facei];
if (phiCorrf > 0.0)
{
sumPhip[own] += phiCorrf;
mSumPhim[nei] += phiCorrf;
}
else
{
mSumPhim[own] -= phiCorrf;
sumPhip[nei] -= phiCorrf;
}
}
forAll(phiCorrBf, patchi)
{
const fvPatchScalarField& psiPf = psiBf[patchi];
const scalarField& phiCorrPf = phiCorrBf[patchi];
const labelList& pFaceCells = mesh.boundary()[patchi].faceCells();
if (psiPf.coupled())
{
const scalarField psiPNf(psiPf.patchNeighbourField());
forAll(phiCorrPf, pFacei)
{
label pfCelli = pFaceCells[pFacei];
psiMaxn[pfCelli] = max(psiMaxn[pfCelli], psiPNf[pFacei]);
psiMinn[pfCelli] = min(psiMinn[pfCelli], psiPNf[pFacei]);
}
}
else
{
forAll(phiCorrPf, pFacei)
{
label pfCelli = pFaceCells[pFacei];
psiMaxn[pfCelli] = max(psiMaxn[pfCelli], psiPf[pFacei]);
psiMinn[pfCelli] = min(psiMinn[pfCelli], psiPf[pFacei]);
}
}
forAll(phiCorrPf, pFacei)
{
label pfCelli = pFaceCells[pFacei];
scalar phiCorrf = phiCorrPf[pFacei];
if (phiCorrf > 0.0)
{
sumPhip[pfCelli] += phiCorrf;
}
else
{
mSumPhim[pfCelli] -= phiCorrf;
}
}
}
psiMaxn = min(psiMaxn, psiMax);
psiMinn = max(psiMinn, psiMin);
// scalar smooth = 0.5;
// psiMaxn = min((1.0 - smooth)*psiIf + smooth*psiMaxn, psiMax);
// psiMinn = max((1.0 - smooth)*psiIf + smooth*psiMinn, psiMin);
psiMaxn =
V
*(
(rho.field()/deltaT - Sp.field())*psiMaxn
- Su.field()
- rho.field()*psi.internalField()/deltaT
);
psiMinn =
V
*(
Su.field()
- (rho.field()/deltaT - Sp.field())*psiMinn
+ rho.field()*psi.internalField()/deltaT
);
scalarField sumlPhip(psiIf.size());
scalarField mSumlPhim(psiIf.size());
for (int j=0; j<nLimiterIter; j++)
{
sumlPhip = 0.0;
mSumlPhim = 0.0;
forAll(lambdaIf, facei)
{
label own = owner[facei];
label nei = neighb[facei];
scalar lambdaPhiCorrf = lambdaIf[facei]*phiCorrIf[facei];
if (lambdaPhiCorrf > 0.0)
{
sumlPhip[own] += lambdaPhiCorrf;
mSumlPhim[nei] += lambdaPhiCorrf;
}
else
{
mSumlPhim[own] -= lambdaPhiCorrf;
sumlPhip[nei] -= lambdaPhiCorrf;
}
}
forAll(lambdaBf, patchi)
{
scalarField& lambdaPf = lambdaBf[patchi];
const scalarField& phiCorrfPf = phiCorrBf[patchi];
const labelList& pFaceCells = mesh.boundary()[patchi].faceCells();
forAll(lambdaPf, pFacei)
{
label pfCelli = pFaceCells[pFacei];
scalar lambdaPhiCorrf = lambdaPf[pFacei]*phiCorrfPf[pFacei];
if (lambdaPhiCorrf > 0.0)
{
sumlPhip[pfCelli] += lambdaPhiCorrf;
}
else
{
mSumlPhim[pfCelli] -= lambdaPhiCorrf;
}
}
}
forAll(sumlPhip, celli)
{
sumlPhip[celli] =
max(min
(
(sumlPhip[celli] + psiMaxn[celli])/mSumPhim[celli],
1.0), 0.0
);
mSumlPhim[celli] =
max(min
(
(mSumlPhim[celli] + psiMinn[celli])/sumPhip[celli],
1.0), 0.0
);
}
const scalarField& lambdam = sumlPhip;
const scalarField& lambdap = mSumlPhim;
forAll(lambdaIf, facei)
{
if (phiCorrIf[facei] > 0.0)
{
lambdaIf[facei] = min
(
lambdaIf[facei],
min(lambdap[owner[facei]], lambdam[neighb[facei]])
);
}
else
{
lambdaIf[facei] = min
(
lambdaIf[facei],
min(lambdam[owner[facei]], lambdap[neighb[facei]])
);
}
}
forAll(lambdaBf, patchi)
{
fvsPatchScalarField& lambdaPf = lambdaBf[patchi];
const scalarField& phiCorrfPf = phiCorrBf[patchi];
const fvPatchScalarField& psiPf = psiBf[patchi];
if (isA<wedgeFvPatch>(mesh.boundary()[patchi]))
{
lambdaPf = 0;
}
else if (psiPf.coupled())
{
const labelList& pFaceCells =
mesh.boundary()[patchi].faceCells();
forAll(lambdaPf, pFacei)
{
label pfCelli = pFaceCells[pFacei];
if (phiCorrfPf[pFacei] > 0.0)
{
lambdaPf[pFacei] =
min(lambdaPf[pFacei], lambdap[pfCelli]);
}
else
{
lambdaPf[pFacei] =
min(lambdaPf[pFacei], lambdam[pfCelli]);
}
}
}
else
{
const labelList& pFaceCells =
mesh.boundary()[patchi].faceCells();
const scalarField& phiCorrPf = phiCorrBf[patchi];
forAll(lambdaPf, pFacei)
{
// Limit outlet faces only
if (phiCorrPf[pFacei] > 0)
{
label pfCelli = pFaceCells[pFacei];
if (phiCorrfPf[pFacei] > 0.0)
{
lambdaPf[pFacei] =
min(lambdaPf[pFacei], lambdap[pfCelli]);
}
else
{
lambdaPf[pFacei] =
min(lambdaPf[pFacei], lambdam[pfCelli]);
}
}
}
}
}
syncTools::syncFaceList(mesh, allLambda, minEqOp<scalar>());
}
}
template<class RhoType, class SpType, class SuType>
void Foam::MULES::limitCorr
(
const RhoType& rho,
const volScalarField& psi,
surfaceScalarField& phiCorr,
const SpType& Sp,
const SuType& Su,
const scalar psiMax,
const scalar psiMin,
const label nLimiterIter
)
{
const fvMesh& mesh = psi.mesh();
scalarField allLambda(mesh.nFaces(), 1.0);
slicedSurfaceScalarField lambda
(
IOobject
(
"lambda",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh,
dimless,
allLambda,
false // Use slices for the couples
);
limiterCorr
(
allLambda,
rho,
psi,
phiCorr,
Sp,
Su,
psiMax,
psiMin,
nLimiterIter
);
phiCorr *= lambda;
}
template<class SurfaceScalarFieldList>
void Foam::MULES::limitSum(SurfaceScalarFieldList& phiPsiCorrs)
{

View File

@ -119,7 +119,8 @@ Foam::MGridGenGAMGAgglomeration::MGridGenGAMGAgglomeration
new scalarField(meshLevels_[nCreatedLevels].size())
);
restrictField(*aggVPtr, *VPtr, nCreatedLevels);
// Restrict but no parallel agglomeration (not supported)
restrictField(*aggVPtr, *VPtr, nCreatedLevels, false);
if (nCreatedLevels)
{
@ -157,7 +158,8 @@ Foam::MGridGenGAMGAgglomeration::MGridGenGAMGAgglomeration
new scalarField(meshLevels_[nCreatedLevels].size())
);
restrictField(*aggSbPtr, *SbPtr, nCreatedLevels);
// Restrict but no parallel agglomeration (not supported)
restrictField(*aggSbPtr, *SbPtr, nCreatedLevels, false);
delete SbPtr;
SbPtr = aggSbPtr;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -43,8 +43,10 @@ bool Foam::pairPatchAgglomeration::continueAgglomerating
)
{
// Check the need for further agglomeration on all processors
bool contAgg = nCoarseFaces >= nFacesInCoarsestLevel_;
reduce(contAgg, andOp<bool>());
label localnCoarseFaces = nCoarseFaces;
// reduce(localnCoarseFaces, sumOp<label>());
bool contAgg = localnCoarseFaces >= nFacesInCoarsestLevel_;
//reduce(contAgg, andOp<bool>());
return contAgg;
}
@ -263,6 +265,11 @@ bool Foam::pairPatchAgglomeration::agglomeratePatch
) << "min(fineToCoarse) == -1" << exit(FatalError);
}
if (fineToCoarse.size() == 0)
{
return true;
}
if (fineToCoarse.size() != patch.size())
{
FatalErrorIn
@ -282,6 +289,7 @@ bool Foam::pairPatchAgglomeration::agglomeratePatch
const label nCoarseI = max(fineToCoarse)+1;
List<face> patchFaces(nCoarseI);
// Patch faces per agglomeration
labelListList coarseToFine(invertOneToMany(nCoarseI, fineToCoarse));
@ -335,6 +343,7 @@ bool Foam::pairPatchAgglomeration::agglomeratePatch
patch.points()
)
);
return true;
}
@ -343,59 +352,73 @@ void Foam::pairPatchAgglomeration:: agglomerate()
{
label nPairLevels = 0;
label nCreatedLevels = 1; //0 level is the base patch
label nCoarseFaces = 0;
label nCoarseFacesOld = 0;
while (nCreatedLevels < maxLevels_)
{
label nCoarseCells = -1;
const bPatch& patch = patchLevels_[nCreatedLevels - 1];
tmp<labelField> finalAgglomPtr(new labelField(patch.size()));
bool agglomOK = false;
while (!agglomOK && patch.size())
while (!agglomOK)
{
finalAgglomPtr = agglomerateOneLevel
(
nCoarseCells,
nCoarseFaces,
patch
);
agglomOK = agglomeratePatch
(
patch,
finalAgglomPtr,
nCreatedLevels
);
if (nCoarseFaces > 0)
{
agglomOK = agglomeratePatch
(
patch,
finalAgglomPtr,
nCreatedLevels
);
restrictAddressing_.set(nCreatedLevels, finalAgglomPtr);
mapBaseToTopAgglom(nCreatedLevels);
setEdgeWeights(nCreatedLevels);
if (nPairLevels % mergeLevels_)
{
combineLevels(nCreatedLevels);
}
else
{
nCreatedLevels++;
}
nPairLevels++;
}
else
{
agglomOK = true;
}
reduce(nCoarseFaces, sumOp<label>());
}
nFaces_[nCreatedLevels] = nCoarseCells;
restrictAddressing_.set(nCreatedLevels, finalAgglomPtr);
mapBaseToTopAgglom(nCreatedLevels);
nFaces_[nCreatedLevels] = nCoarseFaces;
if (!continueAgglomerating(nCoarseCells))
if
(
!continueAgglomerating(nCoarseFaces)
|| (nCoarseFacesOld == nCoarseFaces)
)
{
break;
}
setEdgeWeights(nCreatedLevels);
if (nPairLevels % mergeLevels_)
{
combineLevels(nCreatedLevels);
}
else
{
nCreatedLevels++;
}
nPairLevels++;
nCoarseFacesOld = nCoarseFaces;
}
}
Foam::tmp<Foam::labelField> Foam::pairPatchAgglomeration::agglomerateOneLevel
(
label& nCoarseCells,
label& nCoarseFaces,
const bPatch& patch
)
{
@ -406,7 +429,7 @@ Foam::tmp<Foam::labelField> Foam::pairPatchAgglomeration::agglomerateOneLevel
const labelListList& faceFaces = patch.faceFaces();
nCoarseCells = 0;
nCoarseFaces = 0;
forAll(faceFaces, facei)
{
@ -440,9 +463,9 @@ Foam::tmp<Foam::labelField> Foam::pairPatchAgglomeration::agglomerateOneLevel
if (matchFaceNo >= 0)
{
// Make a new group
coarseCellMap[matchFaceNo] = nCoarseCells;
coarseCellMap[matchFaceNeibNo] = nCoarseCells;
nCoarseCells++;
coarseCellMap[matchFaceNo] = nCoarseFaces;
coarseCellMap[matchFaceNeibNo] = nCoarseFaces;
nCoarseFaces++;
}
else
{
@ -475,8 +498,8 @@ Foam::tmp<Foam::labelField> Foam::pairPatchAgglomeration::agglomerateOneLevel
else
{
// if not create single-cell "clusters" for each
coarseCellMap[facei] = nCoarseCells;
nCoarseCells ++;
coarseCellMap[facei] = nCoarseFaces;
nCoarseFaces ++;
}
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -47,8 +47,7 @@ Foam::distributionModels::uniform::uniform
:
distributionModel(typeName, dict, rndGen),
minValue_(readScalar(distributionModelDict_.lookup("minValue"))),
maxValue_(readScalar(distributionModelDict_.lookup("maxValue"))),
range_(maxValue_ - minValue_)
maxValue_(readScalar(distributionModelDict_.lookup("maxValue")))
{
check();
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -60,9 +60,6 @@ class uniform
//- Distribution maximum
scalar maxValue_;
//- Distribution range
scalar range_;
public:

View File

@ -25,7 +25,7 @@ $(KINEMATICCOLLIDINGPARCEL)/makeBasicKinematicCollidingParcelSubmodels.C
/* thermo parcel sub-models */
THERMOPARCEL=$(DERIVEDPARCELS)/fluidThermoParcel
THERMOPARCEL=$(DERIVEDPARCELS)/basicThermoParcel
$(THERMOPARCEL)/defineBasicThermoParcel.C
$(THERMOPARCEL)/makeBasicThermoParcelSubmodels.C

View File

@ -31,6 +31,7 @@ License
#include "InjectionModelList.H"
#include "DispersionModel.H"
#include "PatchInteractionModel.H"
#include "StochasticCollisionModel.H"
#include "SurfaceFilmModel.H"
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
@ -56,6 +57,15 @@ void Foam::KinematicCloud<CloudType>::setModels()
).ptr()
);
stochasticCollisionModel_.reset
(
StochasticCollisionModel<KinematicCloud<CloudType> >::New
(
subModelProperties_,
*this
).ptr()
);
surfaceFilmModel_.reset
(
SurfaceFilmModel<KinematicCloud<CloudType> >::New
@ -181,7 +191,6 @@ void Foam::KinematicCloud<CloudType>::evolveCloud(TrackData& td)
if (preInjectionSize != this->size())
{
updateCellOccupancy();
preInjectionSize = this->size();
}
@ -191,6 +200,8 @@ void Foam::KinematicCloud<CloudType>::evolveCloud(TrackData& td)
// Assume that motion will update the cellOccupancy as necessary
// before it is required.
td.cloud().motion(td);
stochasticCollision().update(solution_.trackTime());
}
else
{
@ -249,6 +260,7 @@ void Foam::KinematicCloud<CloudType>::cloudReset(KinematicCloud<CloudType>& c)
dispersionModel_.reset(c.dispersionModel_.ptr());
patchInteractionModel_.reset(c.patchInteractionModel_.ptr());
stochasticCollisionModel_.reset(c.stochasticCollisionModel_.ptr());
surfaceFilmModel_.reset(c.surfaceFilmModel_.ptr());
UIntegrator_.reset(c.UIntegrator_.ptr());
@ -338,6 +350,7 @@ Foam::KinematicCloud<CloudType>::KinematicCloud
),
dispersionModel_(NULL),
patchInteractionModel_(NULL),
stochasticCollisionModel_(NULL),
surfaceFilmModel_(NULL),
UIntegrator_(NULL),
UTrans_
@ -418,6 +431,7 @@ Foam::KinematicCloud<CloudType>::KinematicCloud
injectors_(c.injectors_),
dispersionModel_(c.dispersionModel_->clone()),
patchInteractionModel_(c.patchInteractionModel_->clone()),
stochasticCollisionModel_(c.stochasticCollisionModel_->clone()),
surfaceFilmModel_(c.surfaceFilmModel_->clone()),
UIntegrator_(c.UIntegrator_->clone()),
UTrans_
@ -507,6 +521,7 @@ Foam::KinematicCloud<CloudType>::KinematicCloud
injectors_(*this),
dispersionModel_(NULL),
patchInteractionModel_(NULL),
stochasticCollisionModel_(NULL),
surfaceFilmModel_(NULL),
UIntegrator_(NULL),
UTrans_(NULL),

View File

@ -39,6 +39,7 @@ Description
- dispersion model
- injection model
- patch interaction model
- stochastic collision model
- surface film model
SourceFiles
@ -84,6 +85,9 @@ class PatchInteractionModel;
template<class CloudType>
class SurfaceFilmModel;
template<class CloudType>
class StochasticCollisionModel;
/*---------------------------------------------------------------------------*\
Class KinematicCloud Declaration
@ -203,6 +207,10 @@ protected:
autoPtr<PatchInteractionModel<KinematicCloud<CloudType> > >
patchInteractionModel_;
//- Stochastic collision model
autoPtr<StochasticCollisionModel<KinematicCloud<CloudType> > >
stochasticCollisionModel_;
//- Surface film model
autoPtr<SurfaceFilmModel<KinematicCloud<CloudType> > >
surfaceFilmModel_;
@ -416,6 +424,15 @@ public:
inline PatchInteractionModel<KinematicCloud<CloudType> >&
patchInteraction();
//- Return const-access to the stochastic collision model
inline const
StochasticCollisionModel<KinematicCloud<CloudType> >&
stochasticCollision() const;
//- Return reference to the stochastic collision model
inline StochasticCollisionModel<KinematicCloud<CloudType> >&
stochasticCollision();
//- Return const-access to the surface film model
inline const SurfaceFilmModel<KinematicCloud<CloudType> >&
surfaceFilm() const;
@ -482,6 +499,9 @@ public:
// Fields
//- Volume swept rate of parcels per cell
inline const tmp<volScalarField> vDotSweep() const;
//- Return the particle volume fraction field
// Note: for particles belonging to this cloud only
inline const tmp<volScalarField> theta() const;

View File

@ -204,6 +204,22 @@ Foam::KinematicCloud<CloudType>::patchInteraction()
}
template<class CloudType>
inline const Foam::StochasticCollisionModel<Foam::KinematicCloud<CloudType> >&
Foam::KinematicCloud<CloudType>::stochasticCollision() const
{
return stochasticCollisionModel_();
}
template<class CloudType>
inline Foam::StochasticCollisionModel<Foam::KinematicCloud<CloudType> >&
Foam::KinematicCloud<CloudType>::stochasticCollision()
{
return stochasticCollisionModel_();
}
template<class CloudType>
inline const Foam::SurfaceFilmModel<Foam::KinematicCloud<CloudType> >&
Foam::KinematicCloud<CloudType>::surfaceFilm() const
@ -571,6 +587,45 @@ Foam::KinematicCloud<CloudType>::SU(volVectorField& U) const
}
template<class CloudType>
inline const Foam::tmp<Foam::volScalarField>
Foam::KinematicCloud<CloudType>::vDotSweep() const
{
tmp<volScalarField> tvDotSweep
(
new volScalarField
(
IOobject
(
this->name() + ":vDotSweep",
this->db().time().timeName(),
this->db(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh_,
dimensionedScalar("zero", dimless/dimTime, 0.0),
zeroGradientFvPatchScalarField::typeName
)
);
volScalarField& vDotSweep = tvDotSweep();
forAllConstIter(typename KinematicCloud<CloudType>, *this, iter)
{
const parcelType& p = iter();
const label cellI = p.cell();
vDotSweep[cellI] += p.nParticle()*p.areaP()*mag(p.U() - U_[cellI]);
}
vDotSweep.internalField() /= mesh_.V();
vDotSweep.correctBoundaryConditions();
return tvDotSweep;
}
template<class CloudType>
inline const Foam::tmp<Foam::volScalarField>
Foam::KinematicCloud<CloudType>::theta() const

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -100,6 +100,9 @@ public:
// Fields
//- Volume swept rate of parcels per cell
virtual const tmp<volScalarField> vDotSweep() const = 0;
//- Return the particle volume fraction field
// Note: for particles belonging to this cloud only
virtual const tmp<volScalarField> theta() const = 0;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -22,18 +22,18 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::fluidThermoCloud
Foam::basicThermoCloud
Description
Cloud class to introduce thermodynamic parcels
\*---------------------------------------------------------------------------*/
#ifndef fluidThermoCloud_H
#define fluidThermoCloud_H
#ifndef basicThermoCloud_H
#define basicThermoCloud_H
#include "ThermoCloud.H"
#include "fluidThermoParcel.H"
#include "basicThermoParcel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -45,10 +45,10 @@ namespace Foam
<
Cloud
<
fluidThermoParcel
basicThermoParcel
>
>
> fluidThermoCloud;
> basicThermoCloud;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -138,6 +138,8 @@ bool Foam::CollidingParcel<ParcelType>::move
}
p.age() += dt;
td.cloud().functions().postMove(p, cellI, dt, td.keepParticle);
}
break;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -520,8 +520,7 @@ public:
// Helper functions
//- Return the index of the face to be used in the interpolation
// routine
//- Return the index of the face used in the interpolation routine
inline label faceInterpolation() const;
//- Cell owner mass

View File

@ -498,7 +498,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calcDevolatilisation
const scalarField& YGasEff,
const scalarField& YLiquidEff,
const scalarField& YSolidEff,
bool& canCombust,
label& canCombust,
scalarField& dMassDV,
scalar& Sh,
scalar& N,
@ -512,6 +512,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calcDevolatilisation
(
!td.cloud().devolatilisation().active()
|| T < td.cloud().constProps().Tvap()
|| canCombust == -1
)
{
return;
@ -588,7 +589,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calcSurfaceReactions
const scalar d,
const scalar T,
const scalar mass,
const bool canCombust,
const label canCombust,
const scalar N,
const scalarField& YMix,
const scalarField& YGas,
@ -603,7 +604,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calcSurfaceReactions
) const
{
// Check that model is active
if (!td.cloud().surfaceReaction().active() || !canCombust)
if (!td.cloud().surfaceReaction().active() || (canCombust != 1))
{
return;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -183,9 +183,13 @@ protected:
//- Mass fractions of solids []
scalarField YSolid_;
//- Flag to say that the particle is allowed to combust
// Only true after volatile content falls below threshold value
bool canCombust_;
//- Flag to identify if the particle can devolatilise and combust
// Combustion possible only after volatile content falls below
// threshold value. States include:
// 0 = can devolatilise, cannot combust but can change
// 1 = can devolatilise, can combust
// -1 = cannot devolatilise or combust, and cannot change
label canCombust_;
// Protected Member Functions
@ -205,7 +209,7 @@ protected:
const scalarField& YGasEff,// gas component mass fractions
const scalarField& YLiquidEff,// liquid component mass fractions
const scalarField& YSolidEff,// solid component mass fractions
bool& canCombust, // 'can combust' flag
label& canCombust, // 'can combust' flag
scalarField& dMassDV, // mass transfer - local to particle
scalar& Sh, // explicit particle enthalpy source
scalar& N, // flux of species emitted from particle
@ -223,7 +227,7 @@ protected:
const scalar d, // diameter
const scalar T, // temperature
const scalar mass, // mass
const bool canCombust, // 'can combust' flag
const label canCombust, // 'can combust' flag
const scalar N, // flux of species emitted from particle
const scalarField& YMix, // mixture mass fractions
const scalarField& YGas, // gas-phase mass fractions
@ -362,7 +366,7 @@ public:
inline const scalarField& YSolid() const;
//- Return const access to the canCombust flag
inline bool canCombust() const;
inline label canCombust() const;
// Edit
@ -377,7 +381,7 @@ public:
inline scalarField& YSolid();
//- Return access to the canCombust flag
inline bool& canCombust();
inline label& canCombust();
// Main calculation loop

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -94,7 +94,7 @@ inline Foam::ReactingMultiphaseParcel<ParcelType>::ReactingMultiphaseParcel
YGas_(0),
YLiquid_(0),
YSolid_(0),
canCombust_(false)
canCombust_(0)
{}
@ -142,7 +142,7 @@ inline Foam::ReactingMultiphaseParcel<ParcelType>::ReactingMultiphaseParcel
YGas_(YGas0),
YLiquid_(YLiquid0),
YSolid_(YSolid0),
canCombust_(false)
canCombust_(0)
{}
@ -192,7 +192,8 @@ YSolid() const
template<class ParcelType>
inline bool Foam::ReactingMultiphaseParcel<ParcelType>::canCombust() const
inline Foam::label
Foam::ReactingMultiphaseParcel<ParcelType>::canCombust() const
{
return canCombust_;
}
@ -220,7 +221,7 @@ inline Foam::scalarField& Foam::ReactingMultiphaseParcel<ParcelType>::YSolid()
template<class ParcelType>
inline bool& Foam::ReactingMultiphaseParcel<ParcelType>::canCombust()
inline Foam::label& Foam::ReactingMultiphaseParcel<ParcelType>::canCombust()
{
return canCombust_;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -47,7 +47,7 @@ Foam::ReactingMultiphaseParcel<ParcelType>::ReactingMultiphaseParcel
YGas_(0),
YLiquid_(0),
YSolid_(0),
canCombust_(false)
canCombust_(0)
{
if (readFields)
{

View File

@ -32,6 +32,169 @@ using namespace Foam::constant::mathematical;
// * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * //
template<class ParcelType>
template<class TrackData>
void Foam::ReactingParcel<ParcelType>::calcPhaseChange
(
TrackData& td,
const scalar dt,
const label cellI,
const scalar Re,
const scalar Pr,
const scalar Ts,
const scalar nus,
const scalar d,
const scalar T,
const scalar mass,
const label idPhase,
const scalar YPhase,
const scalarField& YComponents,
scalarField& dMassPC,
scalar& Sh,
scalar& N,
scalar& NCpW,
scalarField& Cs
)
{
if
(
!td.cloud().phaseChange().active()
|| T < td.cloud().constProps().Tvap()
|| YPhase < SMALL
)
{
return;
}
typedef typename TrackData::cloudType::reactingCloudType reactingCloudType;
const CompositionModel<reactingCloudType>& composition =
td.cloud().composition();
const scalar TMax = td.cloud().phaseChange().TMax(pc_, this->Tc_);
const scalar Tdash = min(T, TMax);
const scalar Tsdash = min(Ts, TMax);
// Calculate mass transfer due to phase change
td.cloud().phaseChange().calculate
(
dt,
cellI,
Re,
Pr,
d,
nus,
Tdash,
Tsdash,
pc_,
this->Tc_,
YComponents,
dMassPC
);
// Limit phase change mass by availability of each specie
dMassPC = min(mass*YPhase*YComponents, dMassPC);
const scalar dMassTot = sum(dMassPC);
// Add to cumulative phase change mass
td.cloud().phaseChange().addToPhaseChangeMass(this->nParticle_*dMassTot);
forAll(dMassPC, i)
{
const label idc = composition.localToGlobalCarrierId(idPhase, i);
const label idl = composition.globalIds(idPhase)[i];
const scalar dh = td.cloud().phaseChange().dh(idc, idl, pc_, Tdash);
Sh -= dMassPC[i]*dh/dt;
}
// Update molar emissions
if (td.cloud().heatTransfer().BirdCorrection())
{
// Average molecular weight of carrier mix - assumes perfect gas
const scalar Wc = this->rhoc_*specie::RR*this->Tc_/this->pc_;
forAll(dMassPC, i)
{
const label idc = composition.localToGlobalCarrierId(idPhase, i);
const label idl = composition.globalIds(idPhase)[i];
const scalar Cp = composition.carrier().Cp(idc, pc_, Tsdash);
const scalar W = composition.carrier().W(idc);
const scalar Ni = dMassPC[i]/(this->areaS(d)*dt*W);
const scalar Dab =
composition.liquids().properties()[idl].D(pc_, Tsdash, Wc);
// Molar flux of species coming from the particle (kmol/m^2/s)
N += Ni;
// Sum of Ni*Cpi*Wi of emission species
NCpW += Ni*Cp*W;
// Concentrations of emission species
Cs[idc] += Ni*d/(2.0*Dab);
}
}
}
template<class ParcelType>
Foam::scalar Foam::ReactingParcel<ParcelType>::updateMassFraction
(
const scalar mass0,
const scalarField& dMass,
scalarField& Y
) const
{
scalar mass1 = mass0 - sum(dMass);
// only update the mass fractions if the new particle mass is finite
if (mass1 > ROOTVSMALL)
{
forAll(Y, i)
{
Y[i] = (Y[i]*mass0 - dMass[i])/mass1;
}
}
return mass1;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class ParcelType>
Foam::ReactingParcel<ParcelType>::ReactingParcel
(
const ReactingParcel<ParcelType>& p
)
:
ParcelType(p),
mass0_(p.mass0_),
Y_(p.Y_),
pc_(p.pc_)
{}
template<class ParcelType>
Foam::ReactingParcel<ParcelType>::ReactingParcel
(
const ReactingParcel<ParcelType>& p,
const polyMesh& mesh
)
:
ParcelType(p, mesh),
mass0_(p.mass0_),
Y_(p.Y_),
pc_(p.pc_)
{}
// * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * * //
template<class ParcelType>
template<class TrackData>
void Foam::ReactingParcel<ParcelType>::setCellValues
@ -165,7 +328,7 @@ void Foam::ReactingParcel<ParcelType>::correctSurfaceValues
const SLGThermo& thermo = td.cloud().thermo();
// Far field carrier molar fractions
scalarField Xinf(td.cloud().thermo().carrier().species().size());
scalarField Xinf(thermo.carrier().species().size());
forAll(Xinf, i)
{
@ -234,29 +397,6 @@ void Foam::ReactingParcel<ParcelType>::correctSurfaceValues
}
template<class ParcelType>
Foam::scalar Foam::ReactingParcel<ParcelType>::updateMassFraction
(
const scalar mass0,
const scalarField& dMass,
scalarField& Y
) const
{
scalar mass1 = mass0 - sum(dMass);
// only update the mass fractions if the new particle mass is finite
if (mass1 > ROOTVSMALL)
{
forAll(Y, i)
{
Y[i] = (Y[i]*mass0 - dMass[i])/mass1;
}
}
return mass1;
}
template<class ParcelType>
template<class TrackData>
void Foam::ReactingParcel<ParcelType>::calc
@ -472,144 +612,6 @@ void Foam::ReactingParcel<ParcelType>::calc
}
template<class ParcelType>
template<class TrackData>
void Foam::ReactingParcel<ParcelType>::calcPhaseChange
(
TrackData& td,
const scalar dt,
const label cellI,
const scalar Re,
const scalar Pr,
const scalar Ts,
const scalar nus,
const scalar d,
const scalar T,
const scalar mass,
const label idPhase,
const scalar YPhase,
const scalarField& YComponents,
scalarField& dMassPC,
scalar& Sh,
scalar& N,
scalar& NCpW,
scalarField& Cs
)
{
if
(
!td.cloud().phaseChange().active()
|| T < td.cloud().constProps().Tvap()
|| YPhase < SMALL
)
{
return;
}
typedef typename TrackData::cloudType::reactingCloudType reactingCloudType;
const CompositionModel<reactingCloudType>& composition =
td.cloud().composition();
const scalar TMax = td.cloud().phaseChange().TMax(pc_, this->Tc_);
const scalar Tdash = min(T, TMax);
const scalar Tsdash = min(Ts, TMax);
// Calculate mass transfer due to phase change
td.cloud().phaseChange().calculate
(
dt,
cellI,
Re,
Pr,
d,
nus,
Tdash,
Tsdash,
pc_,
this->Tc_,
YComponents,
dMassPC
);
// Limit phase change mass by availability of each specie
dMassPC = min(mass*YPhase*YComponents, dMassPC);
const scalar dMassTot = sum(dMassPC);
// Add to cumulative phase change mass
td.cloud().phaseChange().addToPhaseChangeMass(this->nParticle_*dMassTot);
forAll(dMassPC, i)
{
const label idc = composition.localToGlobalCarrierId(idPhase, i);
const label idl = composition.globalIds(idPhase)[i];
const scalar dh = td.cloud().phaseChange().dh(idc, idl, pc_, Tdash);
Sh -= dMassPC[i]*dh/dt;
}
// Update molar emissions
if (td.cloud().heatTransfer().BirdCorrection())
{
// Average molecular weight of carrier mix - assumes perfect gas
const scalar Wc = this->rhoc_*specie::RR*this->Tc_/this->pc_;
forAll(dMassPC, i)
{
const label idc = composition.localToGlobalCarrierId(idPhase, i);
const label idl = composition.globalIds(idPhase)[i];
const scalar Cp = composition.carrier().Cp(idc, pc_, Tsdash);
const scalar W = composition.carrier().W(idc);
const scalar Ni = dMassPC[i]/(this->areaS(d)*dt*W);
const scalar Dab =
composition.liquids().properties()[idl].D(pc_, Tsdash, Wc);
// Molar flux of species coming from the particle (kmol/m^2/s)
N += Ni;
// Sum of Ni*Cpi*Wi of emission species
NCpW += Ni*Cp*W;
// Concentrations of emission species
Cs[idc] += Ni*d/(2.0*Dab);
}
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class ParcelType>
Foam::ReactingParcel<ParcelType>::ReactingParcel
(
const ReactingParcel<ParcelType>& p
)
:
ParcelType(p),
mass0_(p.mass0_),
Y_(p.Y_),
pc_(p.pc_)
{}
template<class ParcelType>
Foam::ReactingParcel<ParcelType>::ReactingParcel
(
const ReactingParcel<ParcelType>& p,
const polyMesh& mesh
)
:
ParcelType(p, mesh),
mass0_(p.mass0_),
Y_(p.Y_),
pc_(p.pc_)
{}
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
#include "ReactingParcelIO.C"

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -33,6 +33,7 @@ License
#include "makeParcelInjectionModels.H"
#include "makeParcelCollisionModels.H"
#include "makeParcelPatchInteractionModels.H"
#include "makeParcelStochasticCollisionModels.H"
#include "makeParcelSurfaceFilmModels.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -47,6 +48,7 @@ namespace Foam
makeParcelInjectionModels(basicKinematicCollidingCloud);
makeParcelCollisionModels(basicKinematicCollidingCloud);
makeParcelPatchInteractionModels(basicKinematicCollidingCloud);
makeParcelStochasticCollisionModels(basicKinematicCollidingCloud);
makeParcelSurfaceFilmModels(basicKinematicCollidingCloud);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -32,6 +32,7 @@ License
#include "makeParcelDispersionModels.H"
#include "makeParcelInjectionModels.H"
#include "makeParcelPatchInteractionModels.H"
#include "makeParcelStochasticCollisionModels.H"
#include "makeParcelSurfaceFilmModels.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -45,6 +46,7 @@ namespace Foam
makeParcelDispersionModels(basicKinematicCloud);
makeParcelInjectionModels(basicKinematicCloud);
makeParcelPatchInteractionModels(basicKinematicCloud);
makeParcelStochasticCollisionModels(basicKinematicCloud);
makeParcelSurfaceFilmModels(basicKinematicCloud);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -32,6 +32,8 @@ License
#include "makeParcelDispersionModels.H"
#include "makeReactingMultiphaseParcelInjectionModels.H" // MP variant
#include "makeParcelPatchInteractionModels.H"
#include "makeReactingMultiphaseParcelStochasticCollisionModels.H" // MP variant
#include "makeReactingParcelSurfaceFilmModels.H" // Reacting variant
// Thermodynamic
#include "makeParcelHeatTransferModels.H"
@ -39,7 +41,6 @@ License
// Reacting
#include "makeReactingMultiphaseParcelCompositionModels.H" // MP Variant
#include "makeReactingParcelPhaseChangeModels.H"
#include "makeReactingParcelSurfaceFilmModels.H"
// Reacting multiphase
#include "makeReactingMultiphaseParcelDevolatilisationModels.H"
@ -56,6 +57,11 @@ namespace Foam
makeParcelDispersionModels(basicReactingMultiphaseCloud);
makeReactingMultiphaseParcelInjectionModels(basicReactingMultiphaseCloud);
makeParcelPatchInteractionModels(basicReactingMultiphaseCloud);
makeReactingMultiphaseParcelStochasticCollisionModels
(
basicReactingMultiphaseCloud
);
makeReactingParcelSurfaceFilmModels(basicReactingMultiphaseCloud);
// Thermo sub-models
makeParcelHeatTransferModels(basicReactingMultiphaseCloud);
@ -72,10 +78,6 @@ namespace Foam
(
basicReactingMultiphaseCloud
);
makeReactingParcelSurfaceFilmModels
(
basicReactingMultiphaseCloud
);
makeReactingMultiphaseParcelSurfaceReactionModels
(
basicReactingMultiphaseCloud

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