mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -37,7 +37,7 @@ Description
|
|||||||
|
|
||||||
#include "fvCFD.H"
|
#include "fvCFD.H"
|
||||||
#include "turbulenceModel.H"
|
#include "turbulenceModel.H"
|
||||||
#include "fluidThermoCloud.H"
|
#include "basicThermoCloud.H"
|
||||||
#include "coalCloud.H"
|
#include "coalCloud.H"
|
||||||
#include "psiCombustionModel.H"
|
#include "psiCombustionModel.H"
|
||||||
#include "fvIOoptionList.H"
|
#include "fvIOoptionList.H"
|
||||||
|
|||||||
@ -9,7 +9,7 @@ coalCloud coalParcels
|
|||||||
);
|
);
|
||||||
|
|
||||||
Info<< "\nConstructing limestone cloud" << endl;
|
Info<< "\nConstructing limestone cloud" << endl;
|
||||||
fluidThermoCloud limestoneParcels
|
basicThermoCloud limestoneParcels
|
||||||
(
|
(
|
||||||
"limestoneCloud1",
|
"limestoneCloud1",
|
||||||
rho,
|
rho,
|
||||||
|
|||||||
@ -1,7 +1,5 @@
|
|||||||
{
|
{
|
||||||
label nAlphaCorr(readLabel(pimple.dict().lookup("nAlphaCorr")));
|
#include "alphaControls.H"
|
||||||
|
|
||||||
label nAlphaSubCycles(readLabel(pimple.dict().lookup("nAlphaSubCycles")));
|
|
||||||
|
|
||||||
surfaceScalarField phic(mag(phi/mesh.magSf()));
|
surfaceScalarField phic(mag(phi/mesh.magSf()));
|
||||||
phic = min(interface.cAlpha()*phic, max(phic));
|
phic = min(interface.cAlpha()*phic, max(phic));
|
||||||
|
|||||||
@ -1,17 +1,5 @@
|
|||||||
#include "readTimeControls.H"
|
#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 =
|
bool correctPhi =
|
||||||
pimple.dict().lookupOrDefault<Switch>("correctPhi", true);
|
pimple.dict().lookupOrDefault<Switch>("correctPhi", true);
|
||||||
|
|
||||||
|
|||||||
@ -56,7 +56,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
pimpleControl pimple(mesh);
|
pimpleControl pimple(mesh);
|
||||||
|
|
||||||
#include "readControls.H"
|
#include "readTimeControls.H"
|
||||||
#include "initContinuityErrs.H"
|
#include "initContinuityErrs.H"
|
||||||
#include "createFields.H"
|
#include "createFields.H"
|
||||||
#include "CourantNo.H"
|
#include "CourantNo.H"
|
||||||
@ -68,7 +68,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
while (runTime.run())
|
while (runTime.run())
|
||||||
{
|
{
|
||||||
#include "readControls.H"
|
#include "readTimeControls.H"
|
||||||
#include "CourantNo.H"
|
#include "CourantNo.H"
|
||||||
#include "setDeltaT.H"
|
#include "setDeltaT.H"
|
||||||
|
|
||||||
|
|||||||
@ -85,8 +85,8 @@
|
|||||||
|
|
||||||
if (pimple.finalNonOrthogonalIter())
|
if (pimple.finalNonOrthogonalIter())
|
||||||
{
|
{
|
||||||
//p = max(p_rgh + (alpha1*rho1 + alpha2*rho2)*gh, pMin);
|
p = max(p_rgh + (alpha1*rho1 + alpha2*rho2)*gh, pMin);
|
||||||
//p_rgh = p - (alpha1*rho1 + alpha2*rho2)*gh;
|
p_rgh = p - (alpha1*rho1 + alpha2*rho2)*gh;
|
||||||
|
|
||||||
dgdt =
|
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
|
// Update densities from change in p_rgh
|
||||||
rho1 += psi1*(p_rgh - p_rgh_0);
|
rho1 += psi1*(p_rgh - p_rgh_0);
|
||||||
|
|||||||
@ -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);
|
|
||||||
}
|
|
||||||
@ -28,8 +28,8 @@
|
|||||||
|
|
||||||
+ (
|
+ (
|
||||||
he1.name() == thermo1.phasePropertyName("e")
|
he1.name() == thermo1.phasePropertyName("e")
|
||||||
? fvc::div(alphaPhi1, p)
|
? fvc::ddt(alpha1)*p + fvc::div(alphaPhi1, p)
|
||||||
: -dalpha1pdt
|
: -alpha1*dpdt
|
||||||
)/rho1
|
)/rho1
|
||||||
|
|
||||||
- fvm::laplacian(k1, he1)
|
- fvm::laplacian(k1, he1)
|
||||||
@ -50,8 +50,8 @@
|
|||||||
|
|
||||||
+ (
|
+ (
|
||||||
he2.name() == thermo2.phasePropertyName("e")
|
he2.name() == thermo2.phasePropertyName("e")
|
||||||
? fvc::div(alphaPhi2, p)
|
? fvc::ddt(alpha2)*p + fvc::div(alphaPhi2, p)
|
||||||
: -dalpha2pdt
|
: -alpha2*dpdt
|
||||||
)/rho2
|
)/rho2
|
||||||
|
|
||||||
- fvm::laplacian(k2, he2)
|
- fvm::laplacian(k2, he2)
|
||||||
|
|||||||
@ -275,8 +275,8 @@
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
Info<< "Creating field dalpha1pdt\n" << endl;
|
Info<< "Creating field dpdt\n" << endl;
|
||||||
volScalarField dalpha1pdt
|
volScalarField dpdt
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
@ -285,21 +285,9 @@
|
|||||||
mesh
|
mesh
|
||||||
),
|
),
|
||||||
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;
|
Info<< "Creating field kinetic energy K\n" << endl;
|
||||||
volScalarField K1("K" + phase1Name, 0.5*magSqr(U1));
|
volScalarField K1("K" + phase1Name, 0.5*magSqr(U1));
|
||||||
|
|||||||
@ -208,13 +208,8 @@
|
|||||||
K1 = 0.5*magSqr(U1);
|
K1 = 0.5*magSqr(U1);
|
||||||
K2 = 0.5*magSqr(U2);
|
K2 = 0.5*magSqr(U2);
|
||||||
|
|
||||||
if (thermo1.dpdt())
|
if (thermo1.dpdt() || thermo2.dpdt())
|
||||||
{
|
{
|
||||||
dalpha1pdt = fvc::ddt(alpha1, p);
|
dpdt = fvc::ddt(p);
|
||||||
}
|
|
||||||
|
|
||||||
if (thermo2.dpdt())
|
|
||||||
{
|
|
||||||
dalpha2pdt = fvc::ddt(alpha2, p);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,2 @@
|
|||||||
#include "readTimeControls.H"
|
#include "readTimeControls.H"
|
||||||
|
#include "alphaControls.H"
|
||||||
int nAlphaCorr(readInt(pimple.dict().lookup("nAlphaCorr")));
|
|
||||||
int nAlphaSubCycles(readInt(pimple.dict().lookup("nAlphaSubCycles")));
|
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
label nAlphaCorr(readLabel(pimple.dict().lookup("nAlphaCorr")));
|
#include "alphaControls.H"
|
||||||
label nAlphaSubCycles(readLabel(pimple.dict().lookup("nAlphaSubCycles")));
|
|
||||||
|
|
||||||
if (nAlphaSubCycles > 1)
|
if (nAlphaSubCycles > 1)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -130,10 +130,7 @@
|
|||||||
<< ", " << gMax(1/rDeltaT.internalField()) << endl;
|
<< ", " << gMax(1/rDeltaT.internalField()) << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
label nAlphaSubCycles
|
#include "alphaControls.H"
|
||||||
(
|
|
||||||
readLabel(pimpleDict.lookup("nAlphaSubCycles"))
|
|
||||||
);
|
|
||||||
|
|
||||||
rSubDeltaT = rDeltaT*nAlphaSubCycles;
|
rSubDeltaT = rDeltaT*nAlphaSubCycles;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
label nAlphaCorr(readLabel(pimple.dict().lookup("nAlphaCorr")));
|
#include "alphaControls.H"
|
||||||
label nAlphaSubCycles(readLabel(pimple.dict().lookup("nAlphaSubCycles")));
|
|
||||||
|
|
||||||
if (nAlphaSubCycles > 1)
|
if (nAlphaSubCycles > 1)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,6 +1,4 @@
|
|||||||
const dictionary& pimpleDict = pimple.dict();
|
#include "alphaControls.H"
|
||||||
label nAlphaCorr(readLabel(pimpleDict.lookup("nAlphaCorr")));
|
|
||||||
label nAlphaSubCycles(readLabel(pimpleDict.lookup("nAlphaSubCycles")));
|
|
||||||
|
|
||||||
if (nAlphaSubCycles > 1)
|
if (nAlphaSubCycles > 1)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -174,8 +174,10 @@ Foam::threePhaseInterfaceProperties::threePhaseInterfaceProperties
|
|||||||
(
|
(
|
||||||
readScalar
|
readScalar
|
||||||
(
|
(
|
||||||
mixture.U().mesh().solutionDict().subDict("PIMPLE").
|
mixture.U().mesh().solverDict
|
||||||
lookup("cAlpha")
|
(
|
||||||
|
mixture_.alpha1().name()
|
||||||
|
).lookup("cAlpha")
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
sigma12_(mixture.lookup("sigma12")),
|
sigma12_(mixture.lookup("sigma12")),
|
||||||
|
|||||||
@ -4,9 +4,41 @@
|
|||||||
|
|
||||||
surfaceScalarField phir("phir", phic*interface.nHatf());
|
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
|
fvc::flux
|
||||||
(
|
(
|
||||||
@ -22,66 +54,52 @@
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
Pair<tmp<volScalarField> > vDotAlphal =
|
if (MULESCorr)
|
||||||
twoPhaseProperties->vDotAlphal();
|
{
|
||||||
const volScalarField& vDotcAlphal = vDotAlphal[0]();
|
tphiAlphaCorr() -= tphiAlpha();
|
||||||
const volScalarField& vDotvAlphal = vDotAlphal[1]();
|
|
||||||
|
|
||||||
volScalarField Sp
|
|
||||||
(
|
volScalarField alpha100("alpha100", alpha10);
|
||||||
IOobject
|
alpha10 = alpha1;
|
||||||
|
|
||||||
|
MULES::correct
|
||||||
(
|
(
|
||||||
"Sp",
|
geometricOneField(),
|
||||||
runTime.timeName(),
|
alpha1,
|
||||||
mesh
|
tphiAlphaCorr(),
|
||||||
),
|
vDotvmcAlphal,
|
||||||
vDotvAlphal - vDotcAlphal
|
(
|
||||||
);
|
divU*(alpha10 - alpha100)
|
||||||
|
- vDotvmcAlphal*alpha10
|
||||||
|
)(),
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
);
|
||||||
|
|
||||||
volScalarField Su
|
tphiAlpha() += tphiAlphaCorr();
|
||||||
(
|
}
|
||||||
IOobject
|
else
|
||||||
|
{
|
||||||
|
MULES::explicitSolve
|
||||||
(
|
(
|
||||||
"Su",
|
geometricOneField(),
|
||||||
runTime.timeName(),
|
alpha1,
|
||||||
mesh
|
phi,
|
||||||
),
|
tphiAlphaCorr(),
|
||||||
// Divergence term is handled explicitly to be
|
vDotvmcAlphal,
|
||||||
// consistent with the explicit transport solution
|
(divU*alpha1 + vDotcAlphal)(),
|
||||||
divU*alpha1
|
1,
|
||||||
+ vDotcAlphal
|
0
|
||||||
);
|
);
|
||||||
|
|
||||||
//MULES::explicitSolve
|
tphiAlpha = tphiAlphaCorr;
|
||||||
//(
|
}
|
||||||
// geometricOneField(),
|
|
||||||
// alpha1,
|
|
||||||
// phi,
|
|
||||||
// phiAlpha,
|
|
||||||
// Sp,
|
|
||||||
// Su,
|
|
||||||
// 1,
|
|
||||||
// 0
|
|
||||||
//);
|
|
||||||
|
|
||||||
MULES::implicitSolve
|
|
||||||
(
|
|
||||||
geometricOneField(),
|
|
||||||
alpha1,
|
|
||||||
phi,
|
|
||||||
phiAlpha,
|
|
||||||
Sp,
|
|
||||||
Su,
|
|
||||||
1,
|
|
||||||
0
|
|
||||||
);
|
|
||||||
|
|
||||||
alpha2 = 1.0 - alpha1;
|
alpha2 = 1.0 - alpha1;
|
||||||
rhoPhi +=
|
|
||||||
(runTime.deltaT()/totalDeltaT)
|
|
||||||
*(phiAlpha*(rho1 - rho2) + phi*rho2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rhoPhi = tphiAlpha()*(rho1 - rho2) + phi*rho2;
|
||||||
|
|
||||||
Info<< "Liquid phase volume fraction = "
|
Info<< "Liquid phase volume fraction = "
|
||||||
<< alpha1.weightedAverage(mesh.V()).value()
|
<< alpha1.weightedAverage(mesh.V()).value()
|
||||||
<< " Min(alpha1) = " << min(alpha1).value()
|
<< " Min(alpha1) = " << min(alpha1).value()
|
||||||
|
|||||||
@ -11,21 +11,18 @@ surfaceScalarField rhoPhi
|
|||||||
);
|
);
|
||||||
|
|
||||||
{
|
{
|
||||||
const dictionary& pimpleDict = pimple.dict();
|
#include "alphaControls.H"
|
||||||
|
|
||||||
label nAlphaCorr(readLabel(pimpleDict.lookup("nAlphaCorr")));
|
|
||||||
|
|
||||||
label nAlphaSubCycles(readLabel(pimpleDict.lookup("nAlphaSubCycles")));
|
|
||||||
|
|
||||||
surfaceScalarField phic(mag(phi/mesh.magSf()));
|
surfaceScalarField phic(mag(phi/mesh.magSf()));
|
||||||
phic = min(interface.cAlpha()*phic, max(phic));
|
phic = min(interface.cAlpha()*phic, max(phic));
|
||||||
|
|
||||||
volScalarField divU(fvc::div(phi));
|
volScalarField divU(fvc::div(phi));
|
||||||
|
|
||||||
dimensionedScalar totalDeltaT = runTime.deltaT();
|
|
||||||
|
|
||||||
if (nAlphaSubCycles > 1)
|
if (nAlphaSubCycles > 1)
|
||||||
{
|
{
|
||||||
|
dimensionedScalar totalDeltaT = runTime.deltaT();
|
||||||
|
surfaceScalarField rhoPhiSum("rhoPhiSum", rhoPhi);
|
||||||
|
|
||||||
for
|
for
|
||||||
(
|
(
|
||||||
subCycle<volScalarField> alphaSubCycle(alpha1, nAlphaSubCycles);
|
subCycle<volScalarField> alphaSubCycle(alpha1, nAlphaSubCycles);
|
||||||
@ -33,7 +30,10 @@ surfaceScalarField rhoPhi
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
#include "alphaEqn.H"
|
#include "alphaEqn.H"
|
||||||
|
rhoPhiSum += (runTime.deltaT()/totalDeltaT)*rhoPhi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rhoPhi = rhoPhiSum;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -41,7 +41,7 @@ Description
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "fvCFD.H"
|
#include "fvCFD.H"
|
||||||
#include "IMULES.H"
|
#include "MULES.H"
|
||||||
#include "subCycle.H"
|
#include "subCycle.H"
|
||||||
#include "interfaceProperties.H"
|
#include "interfaceProperties.H"
|
||||||
#include "phaseChangeTwoPhaseMixture.H"
|
#include "phaseChangeTwoPhaseMixture.H"
|
||||||
|
|||||||
@ -812,9 +812,8 @@ void Foam::multiphaseSystem::solve()
|
|||||||
|
|
||||||
const Time& runTime = mesh_.time();
|
const Time& runTime = mesh_.time();
|
||||||
|
|
||||||
const dictionary& pimpleDict = mesh_.solutionDict().subDict("PIMPLE");
|
const dictionary& alphaControls = mesh_.solverDict(phases_.first().name());
|
||||||
|
label nAlphaSubCycles(readLabel(alphaControls.lookup("nAlphaSubCycles")));
|
||||||
label nAlphaSubCycles(readLabel(pimpleDict.lookup("nAlphaSubCycles")));
|
|
||||||
|
|
||||||
if (nAlphaSubCycles > 1)
|
if (nAlphaSubCycles > 1)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -249,15 +249,12 @@ void Foam::multiphaseMixture::solve()
|
|||||||
|
|
||||||
const Time& runTime = mesh_.time();
|
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();
|
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)
|
if (nAlphaSubCycles > 1)
|
||||||
{
|
{
|
||||||
surfaceScalarField rhoPhiSum(0.0*rhoPhi_);
|
surfaceScalarField rhoPhiSum(0.0*rhoPhi_);
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
label nAlphaCorr(readLabel(pimple.dict().lookup("nAlphaCorr")));
|
#include "alphaControls.H"
|
||||||
label nAlphaSubCycles(readLabel(pimple.dict().lookup("nAlphaSubCycles")));
|
|
||||||
|
|
||||||
if (nAlphaSubCycles > 1)
|
if (nAlphaSubCycles > 1)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
#include "readTimeControls.H"
|
#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"));
|
Switch correctAlpha(pimple.dict().lookup("correctAlpha"));
|
||||||
|
|||||||
@ -148,7 +148,7 @@ bool Foam::checkWedges
|
|||||||
{
|
{
|
||||||
Info<< " ***Wedge patch " << pp.name() << " not planar."
|
Info<< " ***Wedge patch " << pp.name() << " not planar."
|
||||||
<< " Point " << pt << " is not in patch plane by "
|
<< " Point " << pt << " is not in patch plane by "
|
||||||
<< d << " meter."
|
<< d << " metre."
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@ -62,7 +62,7 @@ int main(int argc, char *argv[])
|
|||||||
boundBox bb(points);
|
boundBox bb(points);
|
||||||
|
|
||||||
Info<< "bounding box: min = " << bb.min()
|
Info<< "bounding box: min = " << bb.min()
|
||||||
<< " max = " << bb.max() << " meters."
|
<< " max = " << bb.max() << " metres."
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -54,7 +54,7 @@ Foam::label Foam::mergePolyMesh::patchIndex(const polyPatch& p)
|
|||||||
{
|
{
|
||||||
if (patchNames_[patchI] == pName)
|
if (patchNames_[patchI] == pName)
|
||||||
{
|
{
|
||||||
if (patchTypes_[patchI] == pType)
|
if (word(patchDicts_[patchI]["type"]) == pType)
|
||||||
{
|
{
|
||||||
// Found name and types match
|
// Found name and types match
|
||||||
return patchI;
|
return patchI;
|
||||||
@ -68,7 +68,11 @@ Foam::label Foam::mergePolyMesh::patchIndex(const polyPatch& p)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Patch not found. Append to the list
|
// Patch not found. Append to the list
|
||||||
patchTypes_.append(pType);
|
{
|
||||||
|
OStringStream os;
|
||||||
|
p.write(os);
|
||||||
|
patchDicts_.append(dictionary(IStringStream(os.str())()));
|
||||||
|
}
|
||||||
|
|
||||||
if (nameFound)
|
if (nameFound)
|
||||||
{
|
{
|
||||||
@ -121,20 +125,22 @@ Foam::mergePolyMesh::mergePolyMesh(const IOobject& io)
|
|||||||
:
|
:
|
||||||
polyMesh(io),
|
polyMesh(io),
|
||||||
meshMod_(*this),
|
meshMod_(*this),
|
||||||
patchTypes_(2*boundaryMesh().size()),
|
|
||||||
patchNames_(2*boundaryMesh().size()),
|
patchNames_(2*boundaryMesh().size()),
|
||||||
|
patchDicts_(2*boundaryMesh().size()),
|
||||||
pointZoneNames_(),
|
pointZoneNames_(),
|
||||||
faceZoneNames_(),
|
faceZoneNames_(),
|
||||||
cellZoneNames_()
|
cellZoneNames_()
|
||||||
{
|
{
|
||||||
// Insert the original patches into the list
|
// Insert the original patches into the list
|
||||||
wordList curPatchTypes = boundaryMesh().types();
|
|
||||||
wordList curPatchNames = boundaryMesh().names();
|
wordList curPatchNames = boundaryMesh().names();
|
||||||
|
|
||||||
forAll(curPatchTypes, patchI)
|
forAll(boundaryMesh(), patchI)
|
||||||
{
|
{
|
||||||
patchTypes_.append(curPatchTypes[patchI]);
|
patchNames_.append(boundaryMesh()[patchI].name());
|
||||||
patchNames_.append(curPatchNames[patchI]);
|
|
||||||
|
OStringStream os;
|
||||||
|
boundaryMesh()[patchI].write(os);
|
||||||
|
patchDicts_.append(dictionary(IStringStream(os.str())()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Insert point, face and cell zones into the list
|
// Insert point, face and cell zones into the list
|
||||||
@ -379,7 +385,7 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
|
|||||||
void Foam::mergePolyMesh::merge()
|
void Foam::mergePolyMesh::merge()
|
||||||
{
|
{
|
||||||
Info<< "patch names: " << patchNames_ << nl
|
Info<< "patch names: " << patchNames_ << nl
|
||||||
<< "patch types: " << patchTypes_ << nl
|
<< "patch dicts: " << patchDicts_ << nl
|
||||||
<< "point zone names: " << pointZoneNames_ << nl
|
<< "point zone names: " << pointZoneNames_ << nl
|
||||||
<< "face zone names: " << faceZoneNames_ << nl
|
<< "face zone names: " << faceZoneNames_ << nl
|
||||||
<< "cell zone names: " << cellZoneNames_ << endl;
|
<< "cell zone names: " << cellZoneNames_ << endl;
|
||||||
@ -409,14 +415,16 @@ void Foam::mergePolyMesh::merge()
|
|||||||
for (; patchI < patchNames_.size(); patchI++)
|
for (; patchI < patchNames_.size(); patchI++)
|
||||||
{
|
{
|
||||||
// Add a patch
|
// Add a patch
|
||||||
|
dictionary dict(patchDicts_[patchI]);
|
||||||
|
dict.set("nFaces", 0);
|
||||||
|
dict.set("startFace", endOfLastPatch);
|
||||||
|
|
||||||
newPatches[patchI] =
|
newPatches[patchI] =
|
||||||
(
|
(
|
||||||
polyPatch::New
|
polyPatch::New
|
||||||
(
|
(
|
||||||
patchTypes_[patchI],
|
|
||||||
patchNames_[patchI],
|
patchNames_[patchI],
|
||||||
0,
|
dict,
|
||||||
endOfLastPatch,
|
|
||||||
patchI,
|
patchI,
|
||||||
oldPatches
|
oldPatches
|
||||||
).ptr()
|
).ptr()
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -58,12 +58,12 @@ class mergePolyMesh
|
|||||||
//- Topological change to accumulated all mesh changes
|
//- Topological change to accumulated all mesh changes
|
||||||
polyTopoChange meshMod_;
|
polyTopoChange meshMod_;
|
||||||
|
|
||||||
//- Patch types
|
|
||||||
DynamicList<word> patchTypes_;
|
|
||||||
|
|
||||||
//- Patch names
|
//- Patch names
|
||||||
DynamicList<word> patchNames_;
|
DynamicList<word> patchNames_;
|
||||||
|
|
||||||
|
//- Patch dictionaries
|
||||||
|
DynamicList<dictionary> patchDicts_;
|
||||||
|
|
||||||
//- Point zone names
|
//- Point zone names
|
||||||
DynamicList<word> pointZoneNames_;
|
DynamicList<word> pointZoneNames_;
|
||||||
|
|
||||||
|
|||||||
@ -1043,7 +1043,6 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
surfaceMeshWriter writer
|
surfaceMeshWriter writer
|
||||||
(
|
(
|
||||||
vMesh,
|
|
||||||
binary,
|
binary,
|
||||||
pp,
|
pp,
|
||||||
fz.name(),
|
fz.name(),
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -30,14 +30,12 @@ License
|
|||||||
|
|
||||||
Foam::surfaceMeshWriter::surfaceMeshWriter
|
Foam::surfaceMeshWriter::surfaceMeshWriter
|
||||||
(
|
(
|
||||||
const vtkMesh& vMesh,
|
|
||||||
const bool binary,
|
const bool binary,
|
||||||
const indirectPrimitivePatch& pp,
|
const indirectPrimitivePatch& pp,
|
||||||
const word& name,
|
const word& name,
|
||||||
const fileName& fName
|
const fileName& fName
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
vMesh_(vMesh),
|
|
||||||
binary_(binary),
|
binary_(binary),
|
||||||
pp_(pp),
|
pp_(pp),
|
||||||
fName_(fName),
|
fName_(fName),
|
||||||
@ -78,8 +76,4 @@ Foam::surfaceMeshWriter::surfaceMeshWriter
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -53,13 +53,11 @@ namespace Foam
|
|||||||
class volPointInterpolation;
|
class volPointInterpolation;
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class surfaceMeshWriter Declaration
|
Class surfaceMeshWriter Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class surfaceMeshWriter
|
class surfaceMeshWriter
|
||||||
{
|
{
|
||||||
const vtkMesh& vMesh_;
|
|
||||||
|
|
||||||
const bool binary_;
|
const bool binary_;
|
||||||
|
|
||||||
const indirectPrimitivePatch& pp_;
|
const indirectPrimitivePatch& pp_;
|
||||||
@ -68,9 +66,6 @@ class surfaceMeshWriter
|
|||||||
|
|
||||||
std::ofstream os_;
|
std::ofstream os_;
|
||||||
|
|
||||||
// label nPoints_;
|
|
||||||
//
|
|
||||||
// label nFaces_;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -79,7 +74,6 @@ public:
|
|||||||
//- Construct from components
|
//- Construct from components
|
||||||
surfaceMeshWriter
|
surfaceMeshWriter
|
||||||
(
|
(
|
||||||
const vtkMesh&,
|
|
||||||
const bool binary,
|
const bool binary,
|
||||||
const indirectPrimitivePatch& pp,
|
const indirectPrimitivePatch& pp,
|
||||||
const word& name,
|
const word& name,
|
||||||
@ -94,19 +88,6 @@ public:
|
|||||||
return os_;
|
return os_;
|
||||||
}
|
}
|
||||||
|
|
||||||
// label nPoints() const
|
|
||||||
// {
|
|
||||||
// return nPoints_;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// label nFaces() const
|
|
||||||
// {
|
|
||||||
// return nFaces_;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// //- Write cellIDs
|
|
||||||
// void writePatchIDs();
|
|
||||||
|
|
||||||
//- Extract face data
|
//- Extract face data
|
||||||
template<class Type>
|
template<class Type>
|
||||||
tmp<Field<Type> > getFaceField
|
tmp<Field<Type> > getFaceField
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
|
|||||||
@ -179,12 +179,13 @@ void Foam::vtkPV398Foam::convertMeshPatches
|
|||||||
|
|
||||||
const word patchName = getPartName(partId);
|
const word patchName = getPartName(partId);
|
||||||
|
|
||||||
labelHashSet patchIds(patches.patchSet(List<wordRe>(1, patchName)));
|
labelHashSet
|
||||||
|
patchIds(patches.patchSet(List<wordRe>(1, wordRe(patchName))));
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "Creating VTK mesh for patches [" << patchIds <<"] "
|
Info<< "Creating VTK mesh for patches [" << patchIds <<"] "
|
||||||
<< patchName << endl;
|
<< patchName << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
vtkPolyData* vtkmesh = NULL;
|
vtkPolyData* vtkmesh = NULL;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -40,6 +40,7 @@ Description
|
|||||||
#include "pairPatchAgglomeration.H"
|
#include "pairPatchAgglomeration.H"
|
||||||
#include "labelListIOList.H"
|
#include "labelListIOList.H"
|
||||||
#include "syncTools.H"
|
#include "syncTools.H"
|
||||||
|
#include "globalIndex.H"
|
||||||
|
|
||||||
using namespace Foam;
|
using namespace Foam;
|
||||||
|
|
||||||
@ -53,7 +54,7 @@ int main(int argc, char *argv[])
|
|||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
#include "createNamedMesh.H"
|
#include "createNamedMesh.H"
|
||||||
|
|
||||||
const word dictName("faceAgglomerateDict");
|
const word dictName("viewFactorsDict");
|
||||||
|
|
||||||
#include "setConstantMeshDictionaryIO.H"
|
#include "setConstantMeshDictionaryIO.H"
|
||||||
|
|
||||||
@ -79,16 +80,16 @@ int main(int argc, char *argv[])
|
|||||||
boundary.size()
|
boundary.size()
|
||||||
);
|
);
|
||||||
|
|
||||||
forAll(boundary, patchId)
|
label nCoarseFaces = 0;
|
||||||
|
|
||||||
|
forAllConstIter(dictionary, agglomDict, iter)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = boundary[patchId];
|
labelList patchIds = boundary.findIndices(iter().keyword());
|
||||||
|
forAll(patchIds, i)
|
||||||
label patchI = pp.index();
|
|
||||||
finalAgglom[patchI].setSize(pp.size(), 0);
|
|
||||||
|
|
||||||
if (!pp.coupled())
|
|
||||||
{
|
{
|
||||||
if (agglomDict.found(pp.name()))
|
label patchI = patchIds[i];
|
||||||
|
const polyPatch& pp = boundary[patchI];
|
||||||
|
if (!pp.coupled())
|
||||||
{
|
{
|
||||||
Info << "\nAgglomerating patch : " << pp.name() << endl;
|
Info << "\nAgglomerating patch : " << pp.name() << endl;
|
||||||
pairPatchAgglomeration agglomObject
|
pairPatchAgglomeration agglomObject
|
||||||
@ -99,12 +100,11 @@ int main(int argc, char *argv[])
|
|||||||
agglomObject.agglomerate();
|
agglomObject.agglomerate();
|
||||||
finalAgglom[patchI] =
|
finalAgglom[patchI] =
|
||||||
agglomObject.restrictTopBottomAddressing();
|
agglomObject.restrictTopBottomAddressing();
|
||||||
}
|
|
||||||
else
|
if (finalAgglom[patchI].size())
|
||||||
{
|
{
|
||||||
FatalErrorIn(args.executable())
|
nCoarseFaces += max(finalAgglom[patchI] + 1);
|
||||||
<< "Patch " << pp.name() << " not found in dictionary: "
|
}
|
||||||
<< agglomDict.name() << exit(FatalError);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -144,6 +144,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (writeAgglom)
|
if (writeAgglom)
|
||||||
{
|
{
|
||||||
|
globalIndex index(nCoarseFaces);
|
||||||
volScalarField facesAgglomeration
|
volScalarField facesAgglomeration
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
@ -158,14 +159,26 @@ int main(int argc, char *argv[])
|
|||||||
dimensionedScalar("facesAgglomeration", dimless, 0)
|
dimensionedScalar("facesAgglomeration", dimless, 0)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
label coarsePatchIndex = 0;
|
||||||
forAll(boundary, patchId)
|
forAll(boundary, patchId)
|
||||||
{
|
{
|
||||||
fvPatchScalarField& bFacesAgglomeration =
|
const polyPatch& pp = boundary[patchId];
|
||||||
facesAgglomeration.boundaryField()[patchId];
|
if (pp.size() > 0)
|
||||||
|
|
||||||
forAll(bFacesAgglomeration, j)
|
|
||||||
{
|
{
|
||||||
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -17,6 +17,12 @@ FoamFile
|
|||||||
// Write agglomeration as a volScalarField with calculated boundary values
|
// Write agglomeration as a volScalarField with calculated boundary values
|
||||||
writeFacesAgglomeration true;
|
writeFacesAgglomeration true;
|
||||||
|
|
||||||
|
//Debug option
|
||||||
|
debug 0;
|
||||||
|
|
||||||
|
//Dump connectivity rays
|
||||||
|
dumpRays false;
|
||||||
|
|
||||||
// Per patch (wildcard possible) the coarsening level
|
// Per patch (wildcard possible) the coarsening level
|
||||||
bottomAir_to_heater
|
bottomAir_to_heater
|
||||||
{
|
{
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
mapLagrangian.C
|
||||||
|
mapFields.C
|
||||||
|
|
||||||
|
EXE = $(FOAM_APPBIN)/mapFieldsNew
|
||||||
@ -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
|
||||||
@ -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
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
131
applications/utilities/preProcessing/mapFieldsNew/MapMeshes.H
Normal file
131
applications/utilities/preProcessing/mapFieldsNew/MapMeshes.H
Normal 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
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
104
applications/utilities/preProcessing/mapFieldsNew/MapVolFields.H
Normal file
104
applications/utilities/preProcessing/mapFieldsNew/MapVolFields.H
Normal 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
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
57
applications/utilities/preProcessing/mapFieldsNew/UnMapped.H
Normal file
57
applications/utilities/preProcessing/mapFieldsNew/UnMapped.H
Normal 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
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -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);
|
||||||
343
applications/utilities/preProcessing/mapFieldsNew/mapFields.C
Normal file
343
applications/utilities/preProcessing/mapFieldsNew/mapFields.C
Normal 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -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
|
||||||
|
);
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -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
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -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
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -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;
|
||||||
|
}
|
||||||
@ -32,6 +32,19 @@ forAll(patches, patchI)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
labelList triSurfaceToAgglom(5*nFineFaces);
|
||||||
|
|
||||||
|
const triSurface localSurface = triangulate
|
||||||
|
(
|
||||||
|
patches,
|
||||||
|
includePatches,
|
||||||
|
finalAgglom,
|
||||||
|
triSurfaceToAgglom,
|
||||||
|
globalNumbering,
|
||||||
|
coarsePatches
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
distributedTriSurfaceMesh surfacesMesh
|
distributedTriSurfaceMesh surfacesMesh
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
@ -43,12 +56,13 @@ distributedTriSurfaceMesh surfacesMesh
|
|||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
IOobject::NO_WRITE
|
IOobject::NO_WRITE
|
||||||
),
|
),
|
||||||
triSurfaceTools::triangulate
|
localSurface,
|
||||||
(
|
|
||||||
patches,
|
|
||||||
includePatches
|
|
||||||
),
|
|
||||||
dict
|
dict
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
triSurfaceToAgglom.resize(surfacesMesh.size());
|
||||||
|
|
||||||
//surfacesMesh.searchableSurface::write();
|
//surfacesMesh.searchableSurface::write();
|
||||||
|
|
||||||
|
surfacesMesh.setField(triSurfaceToAgglom);
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
// Pre-size by assuming a certain percentage is visible.
|
// Pre-size by assuming a certain percentage is visible.
|
||||||
|
|
||||||
// Maximum lenght for dynamicList
|
// Maximum lenght for dynamicList
|
||||||
const label maxDynListLength = 10000;
|
const label maxDynListLength = 100000;
|
||||||
|
|
||||||
for (label procI = 0; procI < Pstream::nProcs(); procI++)
|
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> startIndex(start.size());
|
||||||
DynamicList<label> endIndex(start.size());
|
DynamicList<label> endIndex(start.size());
|
||||||
|
|
||||||
|
DynamicList<label> startAgg(start.size());
|
||||||
|
DynamicList<label> endAgg(start.size());
|
||||||
|
|
||||||
|
|
||||||
const pointField& myFc = remoteCoarseCf[Pstream::myProcNo()];
|
const pointField& myFc = remoteCoarseCf[Pstream::myProcNo()];
|
||||||
const vectorField& myArea = remoteCoarseSf[Pstream::myProcNo()];
|
const vectorField& myArea = remoteCoarseSf[Pstream::myProcNo()];
|
||||||
|
const labelField& myAgg = remoteCoarseAgg[Pstream::myProcNo()];
|
||||||
|
|
||||||
const pointField& remoteArea = remoteCoarseSf[procI];
|
const pointField& remoteArea = remoteCoarseSf[procI];
|
||||||
const pointField& remoteFc = remoteCoarseCf[procI];
|
const pointField& remoteFc = remoteCoarseCf[procI];
|
||||||
|
const labelField& remoteAgg = remoteCoarseAgg[procI];
|
||||||
|
|
||||||
label i = 0;
|
label i = 0;
|
||||||
label j = 0;
|
label j = 0;
|
||||||
@ -29,6 +34,7 @@ for (label procI = 0; procI < Pstream::nProcs(); procI++)
|
|||||||
{
|
{
|
||||||
const point& fc = myFc[i];
|
const point& fc = myFc[i];
|
||||||
const vector& fA = myArea[i];
|
const vector& fA = myArea[i];
|
||||||
|
const label& fAgg = myAgg[i];
|
||||||
|
|
||||||
for (; j < remoteFc.size(); j++)//
|
for (; j < remoteFc.size(); j++)//
|
||||||
{
|
{
|
||||||
@ -36,26 +42,32 @@ for (label procI = 0; procI < Pstream::nProcs(); procI++)
|
|||||||
{
|
{
|
||||||
const point& remFc = remoteFc[j];
|
const point& remFc = remoteFc[j];
|
||||||
const vector& remA = remoteArea[j];
|
const vector& remA = remoteArea[j];
|
||||||
|
const label& remAgg = remoteAgg[j];
|
||||||
|
|
||||||
const vector& d = remFc - fc;
|
const vector& d = remFc - fc;
|
||||||
|
|
||||||
if (((d & fA) < 0.) && ((d & remA) > 0))
|
if (((d & fA) < 0.) && ((d & remA) > 0))
|
||||||
{
|
{
|
||||||
start.append(fc + 0.0001*d);
|
start.append(fc + 0.001*d);
|
||||||
startIndex.append(i);
|
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);
|
label globalI = globalNumbering.toGlobal(procI, j);
|
||||||
endIndex.append(globalI);
|
endIndex.append(globalI);
|
||||||
|
endAgg.append(globalNumbering.toGlobal(procI, remAgg));
|
||||||
if (startIndex.size() > maxDynListLength)
|
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())
|
if (j == remoteFc.size())
|
||||||
{
|
{
|
||||||
@ -63,23 +75,102 @@ for (label procI = 0; procI < Pstream::nProcs(); procI++)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
List<pointIndexHit> hitInfo(startIndex.size());
|
}while (returnReduce(i < myFc.size(), orOp<bool>()));
|
||||||
surfacesMesh.findLine(start, end, hitInfo);
|
|
||||||
|
|
||||||
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]);
|
hitIndex = rayIs[rayI];
|
||||||
rayEndFace.append(endIndex[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();
|
hitInfo.clear();
|
||||||
startIndex.clear();
|
hitInfo.resize(dRayIs.size());
|
||||||
end.clear();
|
|
||||||
endIndex.clear();
|
|
||||||
|
|
||||||
}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();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -68,6 +68,101 @@ Description
|
|||||||
|
|
||||||
using namespace Foam;
|
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
|
void writeRays
|
||||||
(
|
(
|
||||||
const fileName& fName,
|
const fileName& fName,
|
||||||
@ -213,7 +308,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info << "\nCreating single cell mesh..." << endl;
|
Pout << "\nCreating single cell mesh..." << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
singleCellFvMesh coarseMesh
|
singleCellFvMesh coarseMesh
|
||||||
@ -230,6 +325,11 @@ int main(int argc, char *argv[])
|
|||||||
finalAgglom
|
finalAgglom
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Pout << "\nCreated single cell mesh..." << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Calculate total number of fine and coarse faces
|
// Calculate total number of fine and coarse faces
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
@ -283,6 +383,8 @@ int main(int argc, char *argv[])
|
|||||||
DynamicList<point> localCoarseCf(nCoarseFaces);
|
DynamicList<point> localCoarseCf(nCoarseFaces);
|
||||||
DynamicList<point> localCoarseSf(nCoarseFaces);
|
DynamicList<point> localCoarseSf(nCoarseFaces);
|
||||||
|
|
||||||
|
DynamicList<label> localAgg(nCoarseFaces);
|
||||||
|
|
||||||
forAll (viewFactorsPatches, i)
|
forAll (viewFactorsPatches, i)
|
||||||
{
|
{
|
||||||
const label patchID = 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& coarseCf = coarseMesh.Cf().boundaryField()[patchID];
|
||||||
const pointField& coarseSf = coarseMesh.Sf().boundaryField()[patchID];
|
const pointField& coarseSf = coarseMesh.Sf().boundaryField()[patchID];
|
||||||
|
|
||||||
|
labelHashSet includePatches;
|
||||||
|
includePatches.insert(patchID);
|
||||||
|
|
||||||
forAll(coarseCf, faceI)
|
forAll(coarseCf, faceI)
|
||||||
{
|
{
|
||||||
point cf = coarseCf[faceI];
|
point cf = coarseCf[faceI];
|
||||||
|
|
||||||
const label coarseFaceI = coarsePatchFace[faceI];
|
const label coarseFaceI = coarsePatchFace[faceI];
|
||||||
const labelList& fineFaces = coarseToFine[coarseFaceI];
|
const labelList& fineFaces = coarseToFine[coarseFaceI];
|
||||||
|
const label agglomI =
|
||||||
|
agglom[fineFaces[0]] + coarsePatches[patchID].start();
|
||||||
|
|
||||||
// Construct single face
|
// Construct single face
|
||||||
uindirectPrimitivePatch upp
|
uindirectPrimitivePatch upp
|
||||||
(
|
(
|
||||||
@ -308,6 +417,7 @@ int main(int argc, char *argv[])
|
|||||||
pp.points()
|
pp.points()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
List<point> availablePoints
|
List<point> availablePoints
|
||||||
(
|
(
|
||||||
upp.faceCentres().size()
|
upp.faceCentres().size()
|
||||||
@ -342,6 +452,7 @@ int main(int argc, char *argv[])
|
|||||||
point sf = coarseSf[faceI];
|
point sf = coarseSf[faceI];
|
||||||
localCoarseCf.append(cf);
|
localCoarseCf.append(cf);
|
||||||
localCoarseSf.append(sf);
|
localCoarseSf.append(sf);
|
||||||
|
localAgg.append(agglomI);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -350,9 +461,12 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
List<pointField> remoteCoarseCf(Pstream::nProcs());
|
List<pointField> remoteCoarseCf(Pstream::nProcs());
|
||||||
List<pointField> remoteCoarseSf(Pstream::nProcs());
|
List<pointField> remoteCoarseSf(Pstream::nProcs());
|
||||||
|
List<labelField> remoteCoarseAgg(Pstream::nProcs());
|
||||||
|
|
||||||
remoteCoarseCf[Pstream::myProcNo()] = localCoarseCf;
|
remoteCoarseCf[Pstream::myProcNo()] = localCoarseCf;
|
||||||
remoteCoarseSf[Pstream::myProcNo()] = localCoarseSf;
|
remoteCoarseSf[Pstream::myProcNo()] = localCoarseSf;
|
||||||
|
remoteCoarseAgg[Pstream::myProcNo()] = localAgg;
|
||||||
|
|
||||||
|
|
||||||
// Collect remote Cf and Sf on fine mesh
|
// Collect remote Cf and Sf on fine mesh
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
@ -370,8 +484,12 @@ int main(int argc, char *argv[])
|
|||||||
Pstream::scatterList(remoteCoarseCf);
|
Pstream::scatterList(remoteCoarseCf);
|
||||||
Pstream::gatherList(remoteCoarseSf);
|
Pstream::gatherList(remoteCoarseSf);
|
||||||
Pstream::scatterList(remoteCoarseSf);
|
Pstream::scatterList(remoteCoarseSf);
|
||||||
|
Pstream::gatherList(remoteCoarseAgg);
|
||||||
|
Pstream::scatterList(remoteCoarseAgg);
|
||||||
|
|
||||||
|
|
||||||
|
globalIndex globalNumbering(nCoarseFaces);
|
||||||
|
|
||||||
// Set up searching engine for obstacles
|
// Set up searching engine for obstacles
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
#include "searchingEngine.H"
|
#include "searchingEngine.H"
|
||||||
@ -383,8 +501,6 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
DynamicList<label> rayEndFace(rayStartFace.size());
|
DynamicList<label> rayEndFace(rayStartFace.size());
|
||||||
|
|
||||||
globalIndex globalNumbering(nCoarseFaces);
|
|
||||||
|
|
||||||
|
|
||||||
// Return rayStartFace in local index andrayEndFace in global index
|
// Return rayStartFace in local index andrayEndFace in global index
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|||||||
@ -435,7 +435,7 @@ int main(int argc, char *argv[])
|
|||||||
scalar smallDim = 1e-6 * bb.mag();
|
scalar smallDim = 1e-6 * bb.mag();
|
||||||
|
|
||||||
Info<< "Checking for points less than 1e-6 of bounding box ("
|
Info<< "Checking for points less than 1e-6 of bounding box ("
|
||||||
<< bb.span() << " meter) apart."
|
<< bb.span() << " metre) apart."
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
// Sort points
|
// Sort points
|
||||||
|
|||||||
@ -54,7 +54,7 @@ int main(int argc, char *argv[])
|
|||||||
const fileName outFileName = args[3];
|
const fileName outFileName = args[3];
|
||||||
|
|
||||||
Info<< "Reading surface from " << surfFileName << " ..." << endl;
|
Info<< "Reading surface from " << surfFileName << " ..." << endl;
|
||||||
Info<< "Merging points within " << mergeTol << " meter." << endl;
|
Info<< "Merging points within " << mergeTol << " metre." << endl;
|
||||||
|
|
||||||
triSurface surf1(surfFileName);
|
triSurface surf1(surfFileName);
|
||||||
|
|
||||||
|
|||||||
@ -224,6 +224,13 @@ case ThirdParty:
|
|||||||
set mpfr_version=mpfr-3.1.0
|
set mpfr_version=mpfr-3.1.0
|
||||||
set mpc_version=mpc-0.9
|
set mpc_version=mpc-0.9
|
||||||
breaksw
|
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:
|
||||||
case Gcc47++0x:
|
case Gcc47++0x:
|
||||||
set gcc_version=gcc-4.7.2
|
set gcc_version=gcc-4.7.2
|
||||||
@ -242,8 +249,7 @@ case ThirdParty:
|
|||||||
# using clang - not gcc
|
# using clang - not gcc
|
||||||
setenv WM_CC 'clang'
|
setenv WM_CC 'clang'
|
||||||
setenv WM_CXX 'clang++'
|
setenv WM_CXX 'clang++'
|
||||||
set clang_version=llvm-3.1
|
set clang_version=llvm-3.2
|
||||||
#set clang_version=llvm-svn
|
|
||||||
breaksw
|
breaksw
|
||||||
default:
|
default:
|
||||||
echo
|
echo
|
||||||
|
|||||||
@ -246,6 +246,12 @@ OpenFOAM | ThirdParty)
|
|||||||
mpfr_version=mpfr-3.1.0
|
mpfr_version=mpfr-3.1.0
|
||||||
mpc_version=mpc-0.9
|
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)
|
Gcc47 | Gcc47++0x)
|
||||||
gcc_version=gcc-4.7.2
|
gcc_version=gcc-4.7.2
|
||||||
gmp_version=gmp-5.0.4
|
gmp_version=gmp-5.0.4
|
||||||
@ -262,8 +268,7 @@ OpenFOAM | ThirdParty)
|
|||||||
# using clang - not gcc
|
# using clang - not gcc
|
||||||
export WM_CC='clang'
|
export WM_CC='clang'
|
||||||
export WM_CXX='clang++'
|
export WM_CXX='clang++'
|
||||||
clang_version=llvm-3.1
|
clang_version=llvm-3.2
|
||||||
#clang_version=llvm-svn
|
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|||||||
@ -105,6 +105,7 @@ void Foam::IOdictionary::readFile(const bool masterOnly)
|
|||||||
myComm.above(),
|
myComm.above(),
|
||||||
0,
|
0,
|
||||||
Pstream::msgType(),
|
Pstream::msgType(),
|
||||||
|
Pstream::worldComm,
|
||||||
IOstream::ASCII
|
IOstream::ASCII
|
||||||
);
|
);
|
||||||
IOdictionary::readData(fromAbove);
|
IOdictionary::readData(fromAbove);
|
||||||
@ -124,6 +125,7 @@ void Foam::IOdictionary::readFile(const bool masterOnly)
|
|||||||
myComm.below()[belowI],
|
myComm.below()[belowI],
|
||||||
0,
|
0,
|
||||||
Pstream::msgType(),
|
Pstream::msgType(),
|
||||||
|
Pstream::worldComm,
|
||||||
IOstream::ASCII
|
IOstream::ASCII
|
||||||
);
|
);
|
||||||
IOdictionary::writeData(toBelow);
|
IOdictionary::writeData(toBelow);
|
||||||
|
|||||||
@ -243,6 +243,7 @@ bool Foam::regIOobject::read()
|
|||||||
myComm.above(),
|
myComm.above(),
|
||||||
0,
|
0,
|
||||||
Pstream::msgType(),
|
Pstream::msgType(),
|
||||||
|
Pstream::worldComm,
|
||||||
IOstream::ASCII
|
IOstream::ASCII
|
||||||
);
|
);
|
||||||
ok = readData(fromAbove);
|
ok = readData(fromAbove);
|
||||||
@ -257,6 +258,7 @@ bool Foam::regIOobject::read()
|
|||||||
myComm.below()[belowI],
|
myComm.below()[belowI],
|
||||||
0,
|
0,
|
||||||
Pstream::msgType(),
|
Pstream::msgType(),
|
||||||
|
Pstream::worldComm,
|
||||||
IOstream::ASCII
|
IOstream::ASCII
|
||||||
);
|
);
|
||||||
writeData(toBelow);
|
writeData(toBelow);
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -677,7 +677,6 @@ template<class Type>
|
|||||||
template<class Form, class Cmpt, int nCmpt>
|
template<class Form, class Cmpt, int nCmpt>
|
||||||
void Foam::Field<Type>::operator=(const VectorSpace<Form,Cmpt,nCmpt>& vs)
|
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)
|
TFOR_ALL_F_OP_S(Type, *this, =, VSType, vs)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -122,7 +122,8 @@ void Foam::processorCyclicPointPatchField<Type>::initSwapAddSeparated
|
|||||||
procPatch_.neighbProcNo(),
|
procPatch_.neighbProcNo(),
|
||||||
reinterpret_cast<char*>(receiveBuf_.begin()),
|
reinterpret_cast<char*>(receiveBuf_.begin()),
|
||||||
receiveBuf_.byteSize(),
|
receiveBuf_.byteSize(),
|
||||||
procPatch_.tag()
|
procPatch_.tag(),
|
||||||
|
procPatch_.comm()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
OPstream::write
|
OPstream::write
|
||||||
@ -131,7 +132,8 @@ void Foam::processorCyclicPointPatchField<Type>::initSwapAddSeparated
|
|||||||
procPatch_.neighbProcNo(),
|
procPatch_.neighbProcNo(),
|
||||||
reinterpret_cast<const char*>(pf.begin()),
|
reinterpret_cast<const char*>(pf.begin()),
|
||||||
pf.byteSize(),
|
pf.byteSize(),
|
||||||
procPatch_.tag()
|
procPatch_.tag(),
|
||||||
|
procPatch_.comm()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -156,7 +158,8 @@ void Foam::processorCyclicPointPatchField<Type>::swapAddSeparated
|
|||||||
procPatch_.neighbProcNo(),
|
procPatch_.neighbProcNo(),
|
||||||
reinterpret_cast<char*>(receiveBuf_.begin()),
|
reinterpret_cast<char*>(receiveBuf_.begin()),
|
||||||
receiveBuf_.byteSize(),
|
receiveBuf_.byteSize(),
|
||||||
procPatch_.tag()
|
procPatch_.tag(),
|
||||||
|
procPatch_.comm()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -373,7 +373,8 @@ Foam::argList::argList
|
|||||||
int& argc,
|
int& argc,
|
||||||
char**& argv,
|
char**& argv,
|
||||||
bool checkArgs,
|
bool checkArgs,
|
||||||
bool checkOpts
|
bool checkOpts,
|
||||||
|
const bool initialise
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
args_(argc),
|
args_(argc),
|
||||||
@ -405,12 +406,12 @@ Foam::argList::argList
|
|||||||
|
|
||||||
// Check arguments and options, we already have argv[0]
|
// Check arguments and options, we already have argv[0]
|
||||||
int nArgs = 1;
|
int nArgs = 1;
|
||||||
string argListString = args_[0];
|
argListStr_ = args_[0];
|
||||||
|
|
||||||
for (int argI = 1; argI < args_.size(); ++argI)
|
for (int argI = 1; argI < args_.size(); ++argI)
|
||||||
{
|
{
|
||||||
argListString += ' ';
|
argListStr_ += ' ';
|
||||||
argListString += args_[argI];
|
argListStr_ += args_[argI];
|
||||||
|
|
||||||
if (args_[argI][0] == '-')
|
if (args_[argI][0] == '-')
|
||||||
{
|
{
|
||||||
@ -438,8 +439,8 @@ Foam::argList::argList
|
|||||||
FatalError.exit();
|
FatalError.exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
argListString += ' ';
|
argListStr_ += ' ';
|
||||||
argListString += args_[argI];
|
argListStr_ += args_[argI];
|
||||||
options_.insert(optionName, args_[argI]);
|
options_.insert(optionName, args_[argI]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -459,6 +460,39 @@ Foam::argList::argList
|
|||||||
|
|
||||||
args_.setSize(nArgs);
|
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/documentation options:
|
||||||
// -help print the usage
|
// -help print the usage
|
||||||
// -doc display application documentation in browser
|
// -doc display application documentation in browser
|
||||||
@ -495,42 +529,44 @@ Foam::argList::argList
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
string dateString = clock::date();
|
if (initialise)
|
||||||
string timeString = clock::clockTime();
|
|
||||||
|
|
||||||
// Print the banner once only for parallel runs
|
|
||||||
if (Pstream::master() && bannerEnabled)
|
|
||||||
{
|
{
|
||||||
IOobject::writeBanner(Info, true)
|
string dateString = clock::date();
|
||||||
<< "Build : " << Foam::FOAMbuild << nl
|
string timeString = clock::clockTime();
|
||||||
<< "Exec : " << argListString.c_str() << nl
|
|
||||||
<< "Date : " << dateString.c_str() << nl
|
|
||||||
<< "Time : " << timeString.c_str() << nl
|
|
||||||
<< "Host : " << hostName() << nl
|
|
||||||
<< "PID : " << pid() << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
jobInfo.add("startDate", dateString);
|
// Print the banner once only for parallel runs
|
||||||
jobInfo.add("startTime", timeString);
|
if (Pstream::master() && bannerEnabled)
|
||||||
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)
|
|
||||||
{
|
{
|
||||||
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
|
// Case is a single processor run unless it is running parallel
|
||||||
int nProcs = 1;
|
int nProcs = 1;
|
||||||
@ -781,51 +817,55 @@ Foam::argList::argList
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
jobInfo.add("root", rootPath_);
|
if (initialise)
|
||||||
jobInfo.add("case", globalCase_);
|
|
||||||
jobInfo.add("nProcs", nProcs);
|
|
||||||
if (slaveProcs.size())
|
|
||||||
{
|
{
|
||||||
jobInfo.add("slaves", slaveProcs);
|
jobInfo.add("root", rootPath_);
|
||||||
}
|
jobInfo.add("case", globalCase_);
|
||||||
if (roots.size())
|
jobInfo.add("nProcs", nProcs);
|
||||||
{
|
if (slaveProcs.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)
|
|
||||||
{
|
{
|
||||||
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)
|
// Switch on signal trapping. We have to wait until after Pstream::init
|
||||||
{
|
// since this sets up its own ones.
|
||||||
Info<< endl;
|
sigFpe_.set(bannerEnabled);
|
||||||
IOobject::writeDivider(Info);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -41,7 +41,7 @@ Description
|
|||||||
|
|
||||||
\par Default command-line options
|
\par Default command-line options
|
||||||
\param -case \<dir\> \n
|
\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
|
\param -parallel \n
|
||||||
specify case as a parallel job
|
specify case as a parallel job
|
||||||
\param -doc \n
|
\param -doc \n
|
||||||
@ -69,6 +69,7 @@ Note
|
|||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
argList.C
|
argList.C
|
||||||
|
argListI.H
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
@ -111,6 +112,7 @@ class argList
|
|||||||
fileName rootPath_;
|
fileName rootPath_;
|
||||||
fileName globalCase_;
|
fileName globalCase_;
|
||||||
fileName case_;
|
fileName case_;
|
||||||
|
string argListStr_;
|
||||||
|
|
||||||
ParRunControl parRunControl_;
|
ParRunControl parRunControl_;
|
||||||
|
|
||||||
@ -186,17 +188,37 @@ public:
|
|||||||
(
|
(
|
||||||
int& argc,
|
int& argc,
|
||||||
char**& argv,
|
char**& argv,
|
||||||
bool checkArgs=true,
|
bool checkArgs = true,
|
||||||
bool checkOpts=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
|
//- Destructor
|
||||||
virtual ~argList();
|
virtual ~argList();
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member functions
|
||||||
|
|
||||||
|
//- Parse
|
||||||
|
void parse
|
||||||
|
(
|
||||||
|
bool checkArgs,
|
||||||
|
bool checkOpts,
|
||||||
|
bool initialise
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
|
||||||
//- Name of executable without the path
|
//- Name of executable without the path
|
||||||
@ -211,12 +233,18 @@ public:
|
|||||||
//- Return case name
|
//- Return case name
|
||||||
inline const fileName& globalCaseName() const;
|
inline const fileName& globalCaseName() const;
|
||||||
|
|
||||||
|
//- Return parRunControl
|
||||||
|
inline const ParRunControl& parRunControl() const;
|
||||||
|
|
||||||
//- Return the path to the caseName
|
//- Return the path to the caseName
|
||||||
inline fileName path() const;
|
inline fileName path() const;
|
||||||
|
|
||||||
//- Return arguments
|
//- Return arguments
|
||||||
inline const stringList& args() const;
|
inline const stringList& args() const;
|
||||||
|
|
||||||
|
//- Return non-const access to arguments
|
||||||
|
inline stringList& args();
|
||||||
|
|
||||||
//- Return the argument corresponding to index.
|
//- Return the argument corresponding to index.
|
||||||
inline const string& arg(const label index) const;
|
inline const string& arg(const label index) const;
|
||||||
|
|
||||||
@ -240,6 +268,9 @@ public:
|
|||||||
//- Return options
|
//- Return options
|
||||||
inline const Foam::HashTable<string>& options() const;
|
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
|
//- Return the argument string associated with the named option
|
||||||
inline const string& option(const word& opt) const;
|
inline const string& option(const word& opt) const;
|
||||||
|
|
||||||
@ -295,6 +326,7 @@ public:
|
|||||||
// \sa option()
|
// \sa option()
|
||||||
inline const string& operator[](const word& opt) const;
|
inline const string& operator[](const word& opt) const;
|
||||||
|
|
||||||
|
|
||||||
// Edit
|
// Edit
|
||||||
|
|
||||||
//- Add to a bool option to validOptions with usage information
|
//- Add to a bool option to validOptions with usage information
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
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
|
inline Foam::fileName Foam::argList::path() const
|
||||||
{
|
{
|
||||||
return rootPath()/caseName();
|
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
|
inline const Foam::string& Foam::argList::arg(const label index) const
|
||||||
{
|
{
|
||||||
return args_[index];
|
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
|
inline const Foam::string& Foam::argList::option(const word& opt) const
|
||||||
{
|
{
|
||||||
return options_[opt];
|
return options_[opt];
|
||||||
|
|||||||
@ -122,7 +122,7 @@ void Foam::lduPrimitiveMesh::checkUpperTriangular
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::label Foam::lduPrimitiveMesh::size
|
Foam::label Foam::lduPrimitiveMesh::totalSize
|
||||||
(
|
(
|
||||||
const PtrList<lduPrimitiveMesh>& meshes
|
const PtrList<lduPrimitiveMesh>& meshes
|
||||||
)
|
)
|
||||||
@ -294,7 +294,7 @@ Foam::lduPrimitiveMesh::lduPrimitiveMesh
|
|||||||
labelListListList& boundaryFaceMap
|
labelListListList& boundaryFaceMap
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
lduAddressing(myMesh.lduAddr().size() + size(otherMeshes)),
|
lduAddressing(myMesh.lduAddr().size() + totalSize(otherMeshes)),
|
||||||
lowerAddr_(0),
|
lowerAddr_(0),
|
||||||
upperAddr_(0),
|
upperAddr_(0),
|
||||||
interfaces_(0),
|
interfaces_(0),
|
||||||
|
|||||||
@ -76,7 +76,7 @@ class lduPrimitiveMesh
|
|||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
//- Get size of all meshes
|
//- Get size of all meshes
|
||||||
static label size(const PtrList<lduPrimitiveMesh>&);
|
static label totalSize(const PtrList<lduPrimitiveMesh>&);
|
||||||
|
|
||||||
static labelList upperTriOrder
|
static labelList upperTriOrder
|
||||||
(
|
(
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -134,6 +134,12 @@ public:
|
|||||||
return procPolyPatch_.tag();
|
return procPolyPatch_.tag();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- Return communicator used for communication
|
||||||
|
virtual label comm() const
|
||||||
|
{
|
||||||
|
return procPolyPatch_.comm();
|
||||||
|
}
|
||||||
|
|
||||||
//- Return the constraint type this pointPatch implements.
|
//- Return the constraint type this pointPatch implements.
|
||||||
virtual const word& constraintType() const
|
virtual const word& constraintType() const
|
||||||
{
|
{
|
||||||
|
|||||||
@ -246,14 +246,6 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//- Return communicator used for communication
|
|
||||||
label comm() const
|
|
||||||
{
|
|
||||||
//return comm_;
|
|
||||||
return boundaryMesh().mesh().comm();
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Return processor number
|
//- Return processor number
|
||||||
int myProcNo() const
|
int myProcNo() const
|
||||||
{
|
{
|
||||||
@ -266,30 +258,6 @@ public:
|
|||||||
return neighbProcNo_;
|
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 ?
|
//- Does the processor own the patch ?
|
||||||
virtual bool owner() const
|
virtual bool owner() const
|
||||||
{
|
{
|
||||||
@ -332,6 +300,12 @@ public:
|
|||||||
return Pstream::msgType();
|
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
|
//- Transform a patch-based position from other side to this side
|
||||||
virtual void transformPosition(pointField& l) const
|
virtual void transformPosition(pointField& l) const
|
||||||
{}
|
{}
|
||||||
|
|||||||
@ -1542,7 +1542,7 @@ void Foam::faceCoupleInfo::perfectPointMatch
|
|||||||
) << "Did not match all of the master faces to the slave faces"
|
) << "Did not match all of the master faces to the slave faces"
|
||||||
<< endl
|
<< endl
|
||||||
<< "This usually means that the slave patch and master patch"
|
<< "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);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -485,7 +485,7 @@ Foam::polyMeshFilter::polyMeshFilter(const fvMesh& mesh)
|
|||||||
faceFilterFactor_()
|
faceFilterFactor_()
|
||||||
{
|
{
|
||||||
Info<< "Merging:" << nl
|
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 "
|
<< " edges split by a point with edges in line to within "
|
||||||
<< radToDeg(::acos(maxCos_)) << " degrees" << nl
|
<< radToDeg(::acos(maxCos_)) << " degrees" << nl
|
||||||
<< " Minimum edge length reduction factor = "
|
<< " Minimum edge length reduction factor = "
|
||||||
|
|||||||
@ -181,6 +181,7 @@ $(derivedFvPatchFields)/translatingWallVelocity/translatingWallVelocityFvPatchVe
|
|||||||
$(derivedFvPatchFields)/turbulentInlet/turbulentInletFvPatchFields.C
|
$(derivedFvPatchFields)/turbulentInlet/turbulentInletFvPatchFields.C
|
||||||
$(derivedFvPatchFields)/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.C
|
$(derivedFvPatchFields)/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.C
|
||||||
$(derivedFvPatchFields)/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.C
|
$(derivedFvPatchFields)/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.C
|
||||||
|
$(derivedFvPatchFields)/uniformFixedGradient/uniformFixedGradientFvPatchFields.C
|
||||||
$(derivedFvPatchFields)/uniformFixedValue/uniformFixedValueFvPatchFields.C
|
$(derivedFvPatchFields)/uniformFixedValue/uniformFixedValueFvPatchFields.C
|
||||||
$(derivedFvPatchFields)/uniformJump/uniformJumpFvPatchFields.C
|
$(derivedFvPatchFields)/uniformJump/uniformJumpFvPatchFields.C
|
||||||
$(derivedFvPatchFields)/uniformJumpAMI/uniformJumpAMIFvPatchFields.C
|
$(derivedFvPatchFields)/uniformJumpAMI/uniformJumpAMIFvPatchFields.C
|
||||||
@ -321,8 +322,6 @@ $(ddtSchemes)/CoEulerDdtScheme/CoEulerDdtSchemes.C
|
|||||||
$(ddtSchemes)/SLTSDdtScheme/SLTSDdtSchemes.C
|
$(ddtSchemes)/SLTSDdtScheme/SLTSDdtSchemes.C
|
||||||
$(ddtSchemes)/localEulerDdtScheme/localEulerDdtSchemes.C
|
$(ddtSchemes)/localEulerDdtScheme/localEulerDdtSchemes.C
|
||||||
$(ddtSchemes)/backwardDdtScheme/backwardDdtSchemes.C
|
$(ddtSchemes)/backwardDdtScheme/backwardDdtSchemes.C
|
||||||
$(ddtSchemes)/boundedBackwardDdtScheme/boundedBackwardDdtScheme.C
|
|
||||||
$(ddtSchemes)/boundedBackwardDdtScheme/boundedBackwardDdtSchemes.C
|
|
||||||
$(ddtSchemes)/CrankNicolsonDdtScheme/CrankNicolsonDdtSchemes.C
|
$(ddtSchemes)/CrankNicolsonDdtScheme/CrankNicolsonDdtSchemes.C
|
||||||
$(ddtSchemes)/boundedDdtScheme/boundedDdtSchemes.C
|
$(ddtSchemes)/boundedDdtScheme/boundedDdtSchemes.C
|
||||||
|
|
||||||
@ -404,5 +403,4 @@ $(SRF)/SRFModel/rpm/rpm.C
|
|||||||
$(SRF)/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.C
|
$(SRF)/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.C
|
||||||
$(SRF)/derivedFvPatchFields/SRFFreestreamVelocityFvPatchVectorField/SRFFreestreamVelocityFvPatchVectorField.C
|
$(SRF)/derivedFvPatchFields/SRFFreestreamVelocityFvPatchVectorField/SRFFreestreamVelocityFvPatchVectorField.C
|
||||||
|
|
||||||
|
|
||||||
LIB = $(FOAM_LIBBIN)/libfiniteVolume
|
LIB = $(FOAM_LIBBIN)/libfiniteVolume
|
||||||
|
|||||||
12
src/finiteVolume/cfdTools/general/include/alphaControls.H
Normal file
12
src/finiteVolume/cfdTools/general/include/alphaControls.H
Normal 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);
|
||||||
|
}
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -95,8 +95,6 @@ mappedFixedPushedInternalValueFvPatchField
|
|||||||
template<class Type>
|
template<class Type>
|
||||||
void Foam::mappedFixedPushedInternalValueFvPatchField<Type>::updateCoeffs()
|
void Foam::mappedFixedPushedInternalValueFvPatchField<Type>::updateCoeffs()
|
||||||
{
|
{
|
||||||
typedef GeometricField<Type, fvPatchField, volMesh> FieldType;
|
|
||||||
|
|
||||||
if (this->updated())
|
if (this->updated())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -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
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -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
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -23,22 +23,21 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "boundedBackwardDdtScheme.H"
|
#include "uniformFixedGradientFvPatchFields.H"
|
||||||
#include "fvMesh.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
#include "volFields.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
namespace fv
|
|
||||||
{
|
|
||||||
|
|
||||||
defineTypeNameAndDebug(boundedBackwardDdtScheme, 0);
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
ddtScheme<scalar>::addIstreamConstructorToTable<boundedBackwardDdtScheme>
|
makePatchFields(uniformFixedGradient);
|
||||||
addboundedBackwardDdtSchemeIstreamConstructorToTable_;
|
|
||||||
|
|
||||||
}
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
}
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
@ -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
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -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
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -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
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -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
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -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)
|
void Foam::MULES::limitSum(UPtrList<scalarField>& phiPsiCorrs)
|
||||||
{
|
{
|
||||||
forAll(phiPsiCorrs[0], facei)
|
forAll(phiPsiCorrs[0], facei)
|
||||||
|
|||||||
@ -92,6 +92,38 @@ void explicitSolve
|
|||||||
const scalar psiMin
|
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>
|
template<class RhoType, class SpType, class SuType>
|
||||||
void limiter
|
void limiter
|
||||||
(
|
(
|
||||||
@ -122,6 +154,35 @@ void limit
|
|||||||
const bool returnCorr
|
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);
|
void limitSum(UPtrList<scalarField>& phiPsiCorrs);
|
||||||
|
|
||||||
template<class SurfaceScalarFieldList>
|
template<class SurfaceScalarFieldList>
|
||||||
|
|||||||
@ -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>
|
template<class RhoType, class SpType, class SuType>
|
||||||
void Foam::MULES::limiter
|
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>
|
template<class SurfaceScalarFieldList>
|
||||||
void Foam::MULES::limitSum(SurfaceScalarFieldList& phiPsiCorrs)
|
void Foam::MULES::limitSum(SurfaceScalarFieldList& phiPsiCorrs)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -119,7 +119,8 @@ Foam::MGridGenGAMGAgglomeration::MGridGenGAMGAgglomeration
|
|||||||
new scalarField(meshLevels_[nCreatedLevels].size())
|
new scalarField(meshLevels_[nCreatedLevels].size())
|
||||||
);
|
);
|
||||||
|
|
||||||
restrictField(*aggVPtr, *VPtr, nCreatedLevels);
|
// Restrict but no parallel agglomeration (not supported)
|
||||||
|
restrictField(*aggVPtr, *VPtr, nCreatedLevels, false);
|
||||||
|
|
||||||
if (nCreatedLevels)
|
if (nCreatedLevels)
|
||||||
{
|
{
|
||||||
@ -157,7 +158,8 @@ Foam::MGridGenGAMGAgglomeration::MGridGenGAMGAgglomeration
|
|||||||
new scalarField(meshLevels_[nCreatedLevels].size())
|
new scalarField(meshLevels_[nCreatedLevels].size())
|
||||||
);
|
);
|
||||||
|
|
||||||
restrictField(*aggSbPtr, *SbPtr, nCreatedLevels);
|
// Restrict but no parallel agglomeration (not supported)
|
||||||
|
restrictField(*aggSbPtr, *SbPtr, nCreatedLevels, false);
|
||||||
|
|
||||||
delete SbPtr;
|
delete SbPtr;
|
||||||
SbPtr = aggSbPtr;
|
SbPtr = aggSbPtr;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -43,8 +43,10 @@ bool Foam::pairPatchAgglomeration::continueAgglomerating
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Check the need for further agglomeration on all processors
|
// Check the need for further agglomeration on all processors
|
||||||
bool contAgg = nCoarseFaces >= nFacesInCoarsestLevel_;
|
label localnCoarseFaces = nCoarseFaces;
|
||||||
reduce(contAgg, andOp<bool>());
|
// reduce(localnCoarseFaces, sumOp<label>());
|
||||||
|
bool contAgg = localnCoarseFaces >= nFacesInCoarsestLevel_;
|
||||||
|
//reduce(contAgg, andOp<bool>());
|
||||||
return contAgg;
|
return contAgg;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -263,6 +265,11 @@ bool Foam::pairPatchAgglomeration::agglomeratePatch
|
|||||||
) << "min(fineToCoarse) == -1" << exit(FatalError);
|
) << "min(fineToCoarse) == -1" << exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fineToCoarse.size() == 0)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (fineToCoarse.size() != patch.size())
|
if (fineToCoarse.size() != patch.size())
|
||||||
{
|
{
|
||||||
FatalErrorIn
|
FatalErrorIn
|
||||||
@ -282,6 +289,7 @@ bool Foam::pairPatchAgglomeration::agglomeratePatch
|
|||||||
const label nCoarseI = max(fineToCoarse)+1;
|
const label nCoarseI = max(fineToCoarse)+1;
|
||||||
List<face> patchFaces(nCoarseI);
|
List<face> patchFaces(nCoarseI);
|
||||||
|
|
||||||
|
|
||||||
// Patch faces per agglomeration
|
// Patch faces per agglomeration
|
||||||
labelListList coarseToFine(invertOneToMany(nCoarseI, fineToCoarse));
|
labelListList coarseToFine(invertOneToMany(nCoarseI, fineToCoarse));
|
||||||
|
|
||||||
@ -335,6 +343,7 @@ bool Foam::pairPatchAgglomeration::agglomeratePatch
|
|||||||
patch.points()
|
patch.points()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -343,59 +352,73 @@ void Foam::pairPatchAgglomeration:: agglomerate()
|
|||||||
{
|
{
|
||||||
label nPairLevels = 0;
|
label nPairLevels = 0;
|
||||||
label nCreatedLevels = 1; //0 level is the base patch
|
label nCreatedLevels = 1; //0 level is the base patch
|
||||||
|
label nCoarseFaces = 0;
|
||||||
|
label nCoarseFacesOld = 0;
|
||||||
|
|
||||||
while (nCreatedLevels < maxLevels_)
|
while (nCreatedLevels < maxLevels_)
|
||||||
{
|
{
|
||||||
label nCoarseCells = -1;
|
|
||||||
|
|
||||||
const bPatch& patch = patchLevels_[nCreatedLevels - 1];
|
const bPatch& patch = patchLevels_[nCreatedLevels - 1];
|
||||||
tmp<labelField> finalAgglomPtr(new labelField(patch.size()));
|
tmp<labelField> finalAgglomPtr(new labelField(patch.size()));
|
||||||
|
|
||||||
bool agglomOK = false;
|
bool agglomOK = false;
|
||||||
while (!agglomOK && patch.size())
|
while (!agglomOK)
|
||||||
{
|
{
|
||||||
finalAgglomPtr = agglomerateOneLevel
|
finalAgglomPtr = agglomerateOneLevel
|
||||||
(
|
(
|
||||||
nCoarseCells,
|
nCoarseFaces,
|
||||||
patch
|
patch
|
||||||
);
|
);
|
||||||
|
|
||||||
agglomOK = agglomeratePatch
|
if (nCoarseFaces > 0)
|
||||||
(
|
{
|
||||||
patch,
|
agglomOK = agglomeratePatch
|
||||||
finalAgglomPtr,
|
(
|
||||||
nCreatedLevels
|
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;
|
nFaces_[nCreatedLevels] = nCoarseFaces;
|
||||||
restrictAddressing_.set(nCreatedLevels, finalAgglomPtr);
|
|
||||||
mapBaseToTopAgglom(nCreatedLevels);
|
|
||||||
|
|
||||||
if (!continueAgglomerating(nCoarseCells))
|
if
|
||||||
|
(
|
||||||
|
!continueAgglomerating(nCoarseFaces)
|
||||||
|
|| (nCoarseFacesOld == nCoarseFaces)
|
||||||
|
)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
setEdgeWeights(nCreatedLevels);
|
nCoarseFacesOld = nCoarseFaces;
|
||||||
|
|
||||||
if (nPairLevels % mergeLevels_)
|
|
||||||
{
|
|
||||||
combineLevels(nCreatedLevels);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
nCreatedLevels++;
|
|
||||||
}
|
|
||||||
|
|
||||||
nPairLevels++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::labelField> Foam::pairPatchAgglomeration::agglomerateOneLevel
|
Foam::tmp<Foam::labelField> Foam::pairPatchAgglomeration::agglomerateOneLevel
|
||||||
(
|
(
|
||||||
label& nCoarseCells,
|
label& nCoarseFaces,
|
||||||
const bPatch& patch
|
const bPatch& patch
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -406,7 +429,7 @@ Foam::tmp<Foam::labelField> Foam::pairPatchAgglomeration::agglomerateOneLevel
|
|||||||
|
|
||||||
const labelListList& faceFaces = patch.faceFaces();
|
const labelListList& faceFaces = patch.faceFaces();
|
||||||
|
|
||||||
nCoarseCells = 0;
|
nCoarseFaces = 0;
|
||||||
|
|
||||||
forAll(faceFaces, facei)
|
forAll(faceFaces, facei)
|
||||||
{
|
{
|
||||||
@ -440,9 +463,9 @@ Foam::tmp<Foam::labelField> Foam::pairPatchAgglomeration::agglomerateOneLevel
|
|||||||
if (matchFaceNo >= 0)
|
if (matchFaceNo >= 0)
|
||||||
{
|
{
|
||||||
// Make a new group
|
// Make a new group
|
||||||
coarseCellMap[matchFaceNo] = nCoarseCells;
|
coarseCellMap[matchFaceNo] = nCoarseFaces;
|
||||||
coarseCellMap[matchFaceNeibNo] = nCoarseCells;
|
coarseCellMap[matchFaceNeibNo] = nCoarseFaces;
|
||||||
nCoarseCells++;
|
nCoarseFaces++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -475,8 +498,8 @@ Foam::tmp<Foam::labelField> Foam::pairPatchAgglomeration::agglomerateOneLevel
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// if not create single-cell "clusters" for each
|
// if not create single-cell "clusters" for each
|
||||||
coarseCellMap[facei] = nCoarseCells;
|
coarseCellMap[facei] = nCoarseFaces;
|
||||||
nCoarseCells ++;
|
nCoarseFaces ++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -47,8 +47,7 @@ Foam::distributionModels::uniform::uniform
|
|||||||
:
|
:
|
||||||
distributionModel(typeName, dict, rndGen),
|
distributionModel(typeName, dict, rndGen),
|
||||||
minValue_(readScalar(distributionModelDict_.lookup("minValue"))),
|
minValue_(readScalar(distributionModelDict_.lookup("minValue"))),
|
||||||
maxValue_(readScalar(distributionModelDict_.lookup("maxValue"))),
|
maxValue_(readScalar(distributionModelDict_.lookup("maxValue")))
|
||||||
range_(maxValue_ - minValue_)
|
|
||||||
{
|
{
|
||||||
check();
|
check();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -60,9 +60,6 @@ class uniform
|
|||||||
//- Distribution maximum
|
//- Distribution maximum
|
||||||
scalar maxValue_;
|
scalar maxValue_;
|
||||||
|
|
||||||
//- Distribution range
|
|
||||||
scalar range_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|||||||
@ -25,7 +25,7 @@ $(KINEMATICCOLLIDINGPARCEL)/makeBasicKinematicCollidingParcelSubmodels.C
|
|||||||
|
|
||||||
|
|
||||||
/* thermo parcel sub-models */
|
/* thermo parcel sub-models */
|
||||||
THERMOPARCEL=$(DERIVEDPARCELS)/fluidThermoParcel
|
THERMOPARCEL=$(DERIVEDPARCELS)/basicThermoParcel
|
||||||
$(THERMOPARCEL)/defineBasicThermoParcel.C
|
$(THERMOPARCEL)/defineBasicThermoParcel.C
|
||||||
$(THERMOPARCEL)/makeBasicThermoParcelSubmodels.C
|
$(THERMOPARCEL)/makeBasicThermoParcelSubmodels.C
|
||||||
|
|
||||||
|
|||||||
@ -31,6 +31,7 @@ License
|
|||||||
#include "InjectionModelList.H"
|
#include "InjectionModelList.H"
|
||||||
#include "DispersionModel.H"
|
#include "DispersionModel.H"
|
||||||
#include "PatchInteractionModel.H"
|
#include "PatchInteractionModel.H"
|
||||||
|
#include "StochasticCollisionModel.H"
|
||||||
#include "SurfaceFilmModel.H"
|
#include "SurfaceFilmModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
|
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
|
||||||
@ -56,6 +57,15 @@ void Foam::KinematicCloud<CloudType>::setModels()
|
|||||||
).ptr()
|
).ptr()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
stochasticCollisionModel_.reset
|
||||||
|
(
|
||||||
|
StochasticCollisionModel<KinematicCloud<CloudType> >::New
|
||||||
|
(
|
||||||
|
subModelProperties_,
|
||||||
|
*this
|
||||||
|
).ptr()
|
||||||
|
);
|
||||||
|
|
||||||
surfaceFilmModel_.reset
|
surfaceFilmModel_.reset
|
||||||
(
|
(
|
||||||
SurfaceFilmModel<KinematicCloud<CloudType> >::New
|
SurfaceFilmModel<KinematicCloud<CloudType> >::New
|
||||||
@ -181,7 +191,6 @@ void Foam::KinematicCloud<CloudType>::evolveCloud(TrackData& td)
|
|||||||
if (preInjectionSize != this->size())
|
if (preInjectionSize != this->size())
|
||||||
{
|
{
|
||||||
updateCellOccupancy();
|
updateCellOccupancy();
|
||||||
|
|
||||||
preInjectionSize = this->size();
|
preInjectionSize = this->size();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -191,6 +200,8 @@ void Foam::KinematicCloud<CloudType>::evolveCloud(TrackData& td)
|
|||||||
// Assume that motion will update the cellOccupancy as necessary
|
// Assume that motion will update the cellOccupancy as necessary
|
||||||
// before it is required.
|
// before it is required.
|
||||||
td.cloud().motion(td);
|
td.cloud().motion(td);
|
||||||
|
|
||||||
|
stochasticCollision().update(solution_.trackTime());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -249,6 +260,7 @@ void Foam::KinematicCloud<CloudType>::cloudReset(KinematicCloud<CloudType>& c)
|
|||||||
|
|
||||||
dispersionModel_.reset(c.dispersionModel_.ptr());
|
dispersionModel_.reset(c.dispersionModel_.ptr());
|
||||||
patchInteractionModel_.reset(c.patchInteractionModel_.ptr());
|
patchInteractionModel_.reset(c.patchInteractionModel_.ptr());
|
||||||
|
stochasticCollisionModel_.reset(c.stochasticCollisionModel_.ptr());
|
||||||
surfaceFilmModel_.reset(c.surfaceFilmModel_.ptr());
|
surfaceFilmModel_.reset(c.surfaceFilmModel_.ptr());
|
||||||
|
|
||||||
UIntegrator_.reset(c.UIntegrator_.ptr());
|
UIntegrator_.reset(c.UIntegrator_.ptr());
|
||||||
@ -338,6 +350,7 @@ Foam::KinematicCloud<CloudType>::KinematicCloud
|
|||||||
),
|
),
|
||||||
dispersionModel_(NULL),
|
dispersionModel_(NULL),
|
||||||
patchInteractionModel_(NULL),
|
patchInteractionModel_(NULL),
|
||||||
|
stochasticCollisionModel_(NULL),
|
||||||
surfaceFilmModel_(NULL),
|
surfaceFilmModel_(NULL),
|
||||||
UIntegrator_(NULL),
|
UIntegrator_(NULL),
|
||||||
UTrans_
|
UTrans_
|
||||||
@ -418,6 +431,7 @@ Foam::KinematicCloud<CloudType>::KinematicCloud
|
|||||||
injectors_(c.injectors_),
|
injectors_(c.injectors_),
|
||||||
dispersionModel_(c.dispersionModel_->clone()),
|
dispersionModel_(c.dispersionModel_->clone()),
|
||||||
patchInteractionModel_(c.patchInteractionModel_->clone()),
|
patchInteractionModel_(c.patchInteractionModel_->clone()),
|
||||||
|
stochasticCollisionModel_(c.stochasticCollisionModel_->clone()),
|
||||||
surfaceFilmModel_(c.surfaceFilmModel_->clone()),
|
surfaceFilmModel_(c.surfaceFilmModel_->clone()),
|
||||||
UIntegrator_(c.UIntegrator_->clone()),
|
UIntegrator_(c.UIntegrator_->clone()),
|
||||||
UTrans_
|
UTrans_
|
||||||
@ -507,6 +521,7 @@ Foam::KinematicCloud<CloudType>::KinematicCloud
|
|||||||
injectors_(*this),
|
injectors_(*this),
|
||||||
dispersionModel_(NULL),
|
dispersionModel_(NULL),
|
||||||
patchInteractionModel_(NULL),
|
patchInteractionModel_(NULL),
|
||||||
|
stochasticCollisionModel_(NULL),
|
||||||
surfaceFilmModel_(NULL),
|
surfaceFilmModel_(NULL),
|
||||||
UIntegrator_(NULL),
|
UIntegrator_(NULL),
|
||||||
UTrans_(NULL),
|
UTrans_(NULL),
|
||||||
|
|||||||
@ -39,6 +39,7 @@ Description
|
|||||||
- dispersion model
|
- dispersion model
|
||||||
- injection model
|
- injection model
|
||||||
- patch interaction model
|
- patch interaction model
|
||||||
|
- stochastic collision model
|
||||||
- surface film model
|
- surface film model
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
@ -84,6 +85,9 @@ class PatchInteractionModel;
|
|||||||
template<class CloudType>
|
template<class CloudType>
|
||||||
class SurfaceFilmModel;
|
class SurfaceFilmModel;
|
||||||
|
|
||||||
|
template<class CloudType>
|
||||||
|
class StochasticCollisionModel;
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class KinematicCloud Declaration
|
Class KinematicCloud Declaration
|
||||||
@ -203,6 +207,10 @@ protected:
|
|||||||
autoPtr<PatchInteractionModel<KinematicCloud<CloudType> > >
|
autoPtr<PatchInteractionModel<KinematicCloud<CloudType> > >
|
||||||
patchInteractionModel_;
|
patchInteractionModel_;
|
||||||
|
|
||||||
|
//- Stochastic collision model
|
||||||
|
autoPtr<StochasticCollisionModel<KinematicCloud<CloudType> > >
|
||||||
|
stochasticCollisionModel_;
|
||||||
|
|
||||||
//- Surface film model
|
//- Surface film model
|
||||||
autoPtr<SurfaceFilmModel<KinematicCloud<CloudType> > >
|
autoPtr<SurfaceFilmModel<KinematicCloud<CloudType> > >
|
||||||
surfaceFilmModel_;
|
surfaceFilmModel_;
|
||||||
@ -416,6 +424,15 @@ public:
|
|||||||
inline PatchInteractionModel<KinematicCloud<CloudType> >&
|
inline PatchInteractionModel<KinematicCloud<CloudType> >&
|
||||||
patchInteraction();
|
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
|
//- Return const-access to the surface film model
|
||||||
inline const SurfaceFilmModel<KinematicCloud<CloudType> >&
|
inline const SurfaceFilmModel<KinematicCloud<CloudType> >&
|
||||||
surfaceFilm() const;
|
surfaceFilm() const;
|
||||||
@ -482,6 +499,9 @@ public:
|
|||||||
|
|
||||||
// Fields
|
// Fields
|
||||||
|
|
||||||
|
//- Volume swept rate of parcels per cell
|
||||||
|
inline const tmp<volScalarField> vDotSweep() const;
|
||||||
|
|
||||||
//- Return the particle volume fraction field
|
//- Return the particle volume fraction field
|
||||||
// Note: for particles belonging to this cloud only
|
// Note: for particles belonging to this cloud only
|
||||||
inline const tmp<volScalarField> theta() const;
|
inline const tmp<volScalarField> theta() const;
|
||||||
|
|||||||
@ -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>
|
template<class CloudType>
|
||||||
inline const Foam::SurfaceFilmModel<Foam::KinematicCloud<CloudType> >&
|
inline const Foam::SurfaceFilmModel<Foam::KinematicCloud<CloudType> >&
|
||||||
Foam::KinematicCloud<CloudType>::surfaceFilm() const
|
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>
|
template<class CloudType>
|
||||||
inline const Foam::tmp<Foam::volScalarField>
|
inline const Foam::tmp<Foam::volScalarField>
|
||||||
Foam::KinematicCloud<CloudType>::theta() const
|
Foam::KinematicCloud<CloudType>::theta() const
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -100,6 +100,9 @@ public:
|
|||||||
|
|
||||||
// Fields
|
// Fields
|
||||||
|
|
||||||
|
//- Volume swept rate of parcels per cell
|
||||||
|
virtual const tmp<volScalarField> vDotSweep() const = 0;
|
||||||
|
|
||||||
//- Return the particle volume fraction field
|
//- Return the particle volume fraction field
|
||||||
// Note: for particles belonging to this cloud only
|
// Note: for particles belonging to this cloud only
|
||||||
virtual const tmp<volScalarField> theta() const = 0;
|
virtual const tmp<volScalarField> theta() const = 0;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -22,18 +22,18 @@ License
|
|||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Class
|
Class
|
||||||
Foam::fluidThermoCloud
|
Foam::basicThermoCloud
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Cloud class to introduce thermodynamic parcels
|
Cloud class to introduce thermodynamic parcels
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef fluidThermoCloud_H
|
#ifndef basicThermoCloud_H
|
||||||
#define fluidThermoCloud_H
|
#define basicThermoCloud_H
|
||||||
|
|
||||||
#include "ThermoCloud.H"
|
#include "ThermoCloud.H"
|
||||||
#include "fluidThermoParcel.H"
|
#include "basicThermoParcel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -45,10 +45,10 @@ namespace Foam
|
|||||||
<
|
<
|
||||||
Cloud
|
Cloud
|
||||||
<
|
<
|
||||||
fluidThermoParcel
|
basicThermoParcel
|
||||||
>
|
>
|
||||||
>
|
>
|
||||||
> fluidThermoCloud;
|
> basicThermoCloud;
|
||||||
}
|
}
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -138,6 +138,8 @@ bool Foam::CollidingParcel<ParcelType>::move
|
|||||||
}
|
}
|
||||||
|
|
||||||
p.age() += dt;
|
p.age() += dt;
|
||||||
|
|
||||||
|
td.cloud().functions().postMove(p, cellI, dt, td.keepParticle);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -520,8 +520,7 @@ public:
|
|||||||
|
|
||||||
// Helper functions
|
// Helper functions
|
||||||
|
|
||||||
//- Return the index of the face to be used in the interpolation
|
//- Return the index of the face used in the interpolation routine
|
||||||
// routine
|
|
||||||
inline label faceInterpolation() const;
|
inline label faceInterpolation() const;
|
||||||
|
|
||||||
//- Cell owner mass
|
//- Cell owner mass
|
||||||
|
|||||||
@ -498,7 +498,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calcDevolatilisation
|
|||||||
const scalarField& YGasEff,
|
const scalarField& YGasEff,
|
||||||
const scalarField& YLiquidEff,
|
const scalarField& YLiquidEff,
|
||||||
const scalarField& YSolidEff,
|
const scalarField& YSolidEff,
|
||||||
bool& canCombust,
|
label& canCombust,
|
||||||
scalarField& dMassDV,
|
scalarField& dMassDV,
|
||||||
scalar& Sh,
|
scalar& Sh,
|
||||||
scalar& N,
|
scalar& N,
|
||||||
@ -512,6 +512,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calcDevolatilisation
|
|||||||
(
|
(
|
||||||
!td.cloud().devolatilisation().active()
|
!td.cloud().devolatilisation().active()
|
||||||
|| T < td.cloud().constProps().Tvap()
|
|| T < td.cloud().constProps().Tvap()
|
||||||
|
|| canCombust == -1
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@ -588,7 +589,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calcSurfaceReactions
|
|||||||
const scalar d,
|
const scalar d,
|
||||||
const scalar T,
|
const scalar T,
|
||||||
const scalar mass,
|
const scalar mass,
|
||||||
const bool canCombust,
|
const label canCombust,
|
||||||
const scalar N,
|
const scalar N,
|
||||||
const scalarField& YMix,
|
const scalarField& YMix,
|
||||||
const scalarField& YGas,
|
const scalarField& YGas,
|
||||||
@ -603,7 +604,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calcSurfaceReactions
|
|||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
// Check that model is active
|
// Check that model is active
|
||||||
if (!td.cloud().surfaceReaction().active() || !canCombust)
|
if (!td.cloud().surfaceReaction().active() || (canCombust != 1))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -183,9 +183,13 @@ protected:
|
|||||||
//- Mass fractions of solids []
|
//- Mass fractions of solids []
|
||||||
scalarField YSolid_;
|
scalarField YSolid_;
|
||||||
|
|
||||||
//- Flag to say that the particle is allowed to combust
|
//- Flag to identify if the particle can devolatilise and combust
|
||||||
// Only true after volatile content falls below threshold value
|
// Combustion possible only after volatile content falls below
|
||||||
bool canCombust_;
|
// 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
|
// Protected Member Functions
|
||||||
@ -205,7 +209,7 @@ protected:
|
|||||||
const scalarField& YGasEff,// gas component mass fractions
|
const scalarField& YGasEff,// gas component mass fractions
|
||||||
const scalarField& YLiquidEff,// liquid component mass fractions
|
const scalarField& YLiquidEff,// liquid component mass fractions
|
||||||
const scalarField& YSolidEff,// solid 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
|
scalarField& dMassDV, // mass transfer - local to particle
|
||||||
scalar& Sh, // explicit particle enthalpy source
|
scalar& Sh, // explicit particle enthalpy source
|
||||||
scalar& N, // flux of species emitted from particle
|
scalar& N, // flux of species emitted from particle
|
||||||
@ -223,7 +227,7 @@ protected:
|
|||||||
const scalar d, // diameter
|
const scalar d, // diameter
|
||||||
const scalar T, // temperature
|
const scalar T, // temperature
|
||||||
const scalar mass, // mass
|
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 scalar N, // flux of species emitted from particle
|
||||||
const scalarField& YMix, // mixture mass fractions
|
const scalarField& YMix, // mixture mass fractions
|
||||||
const scalarField& YGas, // gas-phase mass fractions
|
const scalarField& YGas, // gas-phase mass fractions
|
||||||
@ -362,7 +366,7 @@ public:
|
|||||||
inline const scalarField& YSolid() const;
|
inline const scalarField& YSolid() const;
|
||||||
|
|
||||||
//- Return const access to the canCombust flag
|
//- Return const access to the canCombust flag
|
||||||
inline bool canCombust() const;
|
inline label canCombust() const;
|
||||||
|
|
||||||
|
|
||||||
// Edit
|
// Edit
|
||||||
@ -377,7 +381,7 @@ public:
|
|||||||
inline scalarField& YSolid();
|
inline scalarField& YSolid();
|
||||||
|
|
||||||
//- Return access to the canCombust flag
|
//- Return access to the canCombust flag
|
||||||
inline bool& canCombust();
|
inline label& canCombust();
|
||||||
|
|
||||||
|
|
||||||
// Main calculation loop
|
// Main calculation loop
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -94,7 +94,7 @@ inline Foam::ReactingMultiphaseParcel<ParcelType>::ReactingMultiphaseParcel
|
|||||||
YGas_(0),
|
YGas_(0),
|
||||||
YLiquid_(0),
|
YLiquid_(0),
|
||||||
YSolid_(0),
|
YSolid_(0),
|
||||||
canCombust_(false)
|
canCombust_(0)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -142,7 +142,7 @@ inline Foam::ReactingMultiphaseParcel<ParcelType>::ReactingMultiphaseParcel
|
|||||||
YGas_(YGas0),
|
YGas_(YGas0),
|
||||||
YLiquid_(YLiquid0),
|
YLiquid_(YLiquid0),
|
||||||
YSolid_(YSolid0),
|
YSolid_(YSolid0),
|
||||||
canCombust_(false)
|
canCombust_(0)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -192,7 +192,8 @@ YSolid() const
|
|||||||
|
|
||||||
|
|
||||||
template<class ParcelType>
|
template<class ParcelType>
|
||||||
inline bool Foam::ReactingMultiphaseParcel<ParcelType>::canCombust() const
|
inline Foam::label
|
||||||
|
Foam::ReactingMultiphaseParcel<ParcelType>::canCombust() const
|
||||||
{
|
{
|
||||||
return canCombust_;
|
return canCombust_;
|
||||||
}
|
}
|
||||||
@ -220,7 +221,7 @@ inline Foam::scalarField& Foam::ReactingMultiphaseParcel<ParcelType>::YSolid()
|
|||||||
|
|
||||||
|
|
||||||
template<class ParcelType>
|
template<class ParcelType>
|
||||||
inline bool& Foam::ReactingMultiphaseParcel<ParcelType>::canCombust()
|
inline Foam::label& Foam::ReactingMultiphaseParcel<ParcelType>::canCombust()
|
||||||
{
|
{
|
||||||
return canCombust_;
|
return canCombust_;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -47,7 +47,7 @@ Foam::ReactingMultiphaseParcel<ParcelType>::ReactingMultiphaseParcel
|
|||||||
YGas_(0),
|
YGas_(0),
|
||||||
YLiquid_(0),
|
YLiquid_(0),
|
||||||
YSolid_(0),
|
YSolid_(0),
|
||||||
canCombust_(false)
|
canCombust_(0)
|
||||||
{
|
{
|
||||||
if (readFields)
|
if (readFields)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -32,6 +32,169 @@ using namespace Foam::constant::mathematical;
|
|||||||
|
|
||||||
// * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * //
|
// * * * * * * * * * * * 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 ParcelType>
|
||||||
template<class TrackData>
|
template<class TrackData>
|
||||||
void Foam::ReactingParcel<ParcelType>::setCellValues
|
void Foam::ReactingParcel<ParcelType>::setCellValues
|
||||||
@ -165,7 +328,7 @@ void Foam::ReactingParcel<ParcelType>::correctSurfaceValues
|
|||||||
const SLGThermo& thermo = td.cloud().thermo();
|
const SLGThermo& thermo = td.cloud().thermo();
|
||||||
|
|
||||||
// Far field carrier molar fractions
|
// Far field carrier molar fractions
|
||||||
scalarField Xinf(td.cloud().thermo().carrier().species().size());
|
scalarField Xinf(thermo.carrier().species().size());
|
||||||
|
|
||||||
forAll(Xinf, i)
|
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 ParcelType>
|
||||||
template<class TrackData>
|
template<class TrackData>
|
||||||
void Foam::ReactingParcel<ParcelType>::calc
|
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 * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
|
||||||
|
|
||||||
#include "ReactingParcelIO.C"
|
#include "ReactingParcelIO.C"
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -33,6 +33,7 @@ License
|
|||||||
#include "makeParcelInjectionModels.H"
|
#include "makeParcelInjectionModels.H"
|
||||||
#include "makeParcelCollisionModels.H"
|
#include "makeParcelCollisionModels.H"
|
||||||
#include "makeParcelPatchInteractionModels.H"
|
#include "makeParcelPatchInteractionModels.H"
|
||||||
|
#include "makeParcelStochasticCollisionModels.H"
|
||||||
#include "makeParcelSurfaceFilmModels.H"
|
#include "makeParcelSurfaceFilmModels.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -47,6 +48,7 @@ namespace Foam
|
|||||||
makeParcelInjectionModels(basicKinematicCollidingCloud);
|
makeParcelInjectionModels(basicKinematicCollidingCloud);
|
||||||
makeParcelCollisionModels(basicKinematicCollidingCloud);
|
makeParcelCollisionModels(basicKinematicCollidingCloud);
|
||||||
makeParcelPatchInteractionModels(basicKinematicCollidingCloud);
|
makeParcelPatchInteractionModels(basicKinematicCollidingCloud);
|
||||||
|
makeParcelStochasticCollisionModels(basicKinematicCollidingCloud);
|
||||||
makeParcelSurfaceFilmModels(basicKinematicCollidingCloud);
|
makeParcelSurfaceFilmModels(basicKinematicCollidingCloud);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -32,6 +32,7 @@ License
|
|||||||
#include "makeParcelDispersionModels.H"
|
#include "makeParcelDispersionModels.H"
|
||||||
#include "makeParcelInjectionModels.H"
|
#include "makeParcelInjectionModels.H"
|
||||||
#include "makeParcelPatchInteractionModels.H"
|
#include "makeParcelPatchInteractionModels.H"
|
||||||
|
#include "makeParcelStochasticCollisionModels.H"
|
||||||
#include "makeParcelSurfaceFilmModels.H"
|
#include "makeParcelSurfaceFilmModels.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -45,6 +46,7 @@ namespace Foam
|
|||||||
makeParcelDispersionModels(basicKinematicCloud);
|
makeParcelDispersionModels(basicKinematicCloud);
|
||||||
makeParcelInjectionModels(basicKinematicCloud);
|
makeParcelInjectionModels(basicKinematicCloud);
|
||||||
makeParcelPatchInteractionModels(basicKinematicCloud);
|
makeParcelPatchInteractionModels(basicKinematicCloud);
|
||||||
|
makeParcelStochasticCollisionModels(basicKinematicCloud);
|
||||||
makeParcelSurfaceFilmModels(basicKinematicCloud);
|
makeParcelSurfaceFilmModels(basicKinematicCloud);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -32,6 +32,8 @@ License
|
|||||||
#include "makeParcelDispersionModels.H"
|
#include "makeParcelDispersionModels.H"
|
||||||
#include "makeReactingMultiphaseParcelInjectionModels.H" // MP variant
|
#include "makeReactingMultiphaseParcelInjectionModels.H" // MP variant
|
||||||
#include "makeParcelPatchInteractionModels.H"
|
#include "makeParcelPatchInteractionModels.H"
|
||||||
|
#include "makeReactingMultiphaseParcelStochasticCollisionModels.H" // MP variant
|
||||||
|
#include "makeReactingParcelSurfaceFilmModels.H" // Reacting variant
|
||||||
|
|
||||||
// Thermodynamic
|
// Thermodynamic
|
||||||
#include "makeParcelHeatTransferModels.H"
|
#include "makeParcelHeatTransferModels.H"
|
||||||
@ -39,7 +41,6 @@ License
|
|||||||
// Reacting
|
// Reacting
|
||||||
#include "makeReactingMultiphaseParcelCompositionModels.H" // MP Variant
|
#include "makeReactingMultiphaseParcelCompositionModels.H" // MP Variant
|
||||||
#include "makeReactingParcelPhaseChangeModels.H"
|
#include "makeReactingParcelPhaseChangeModels.H"
|
||||||
#include "makeReactingParcelSurfaceFilmModels.H"
|
|
||||||
|
|
||||||
// Reacting multiphase
|
// Reacting multiphase
|
||||||
#include "makeReactingMultiphaseParcelDevolatilisationModels.H"
|
#include "makeReactingMultiphaseParcelDevolatilisationModels.H"
|
||||||
@ -56,6 +57,11 @@ namespace Foam
|
|||||||
makeParcelDispersionModels(basicReactingMultiphaseCloud);
|
makeParcelDispersionModels(basicReactingMultiphaseCloud);
|
||||||
makeReactingMultiphaseParcelInjectionModels(basicReactingMultiphaseCloud);
|
makeReactingMultiphaseParcelInjectionModels(basicReactingMultiphaseCloud);
|
||||||
makeParcelPatchInteractionModels(basicReactingMultiphaseCloud);
|
makeParcelPatchInteractionModels(basicReactingMultiphaseCloud);
|
||||||
|
makeReactingMultiphaseParcelStochasticCollisionModels
|
||||||
|
(
|
||||||
|
basicReactingMultiphaseCloud
|
||||||
|
);
|
||||||
|
makeReactingParcelSurfaceFilmModels(basicReactingMultiphaseCloud);
|
||||||
|
|
||||||
// Thermo sub-models
|
// Thermo sub-models
|
||||||
makeParcelHeatTransferModels(basicReactingMultiphaseCloud);
|
makeParcelHeatTransferModels(basicReactingMultiphaseCloud);
|
||||||
@ -72,10 +78,6 @@ namespace Foam
|
|||||||
(
|
(
|
||||||
basicReactingMultiphaseCloud
|
basicReactingMultiphaseCloud
|
||||||
);
|
);
|
||||||
makeReactingParcelSurfaceFilmModels
|
|
||||||
(
|
|
||||||
basicReactingMultiphaseCloud
|
|
||||||
);
|
|
||||||
makeReactingMultiphaseParcelSurfaceReactionModels
|
makeReactingMultiphaseParcelSurfaceReactionModels
|
||||||
(
|
(
|
||||||
basicReactingMultiphaseCloud
|
basicReactingMultiphaseCloud
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user