mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge remote branch 'OpenCFD/master' into olesenm
This commit is contained in:
@ -135,8 +135,8 @@ void PDRkEpsilon::correct()
|
||||
|
||||
volScalarField GR(drag.Gk());
|
||||
|
||||
volScalarField LI =
|
||||
C4_*(Lobs + dimensionedScalar("minLength", dimLength, VSMALL));
|
||||
volScalarField LI
|
||||
(C4_*(Lobs + dimensionedScalar("minLength", dimLength, VSMALL)));
|
||||
|
||||
// Dissipation equation
|
||||
tmp<fvScalarMatrix> epsEqn
|
||||
|
||||
@ -50,8 +50,7 @@ Foam::XiEqModels::Gulder::Gulder
|
||||
:
|
||||
XiEqModel(XiEqProperties, thermo, turbulence, Su),
|
||||
XiEqCoef_(readScalar(XiEqModelCoeffs_.lookup("XiEqCoef"))),
|
||||
SuMin_(0.01*Su.average()),
|
||||
uPrimeCoef_(readScalar(XiEqModelCoeffs_.lookup("uPrimeCoef")))
|
||||
SuMin_(0.01*Su.average())
|
||||
{}
|
||||
|
||||
|
||||
@ -67,86 +66,18 @@ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::Gulder::XiEq() const
|
||||
{
|
||||
volScalarField up(sqrt((2.0/3.0)*turbulence_.k()));
|
||||
const volScalarField& epsilon = turbulence_.epsilon();
|
||||
const fvMesh& mesh = Su_.mesh();
|
||||
|
||||
const volVectorField& U = mesh.lookupObject<volVectorField>("U");
|
||||
|
||||
const volSymmTensorField& CT = mesh.lookupObject<volSymmTensorField>("CT");
|
||||
const volScalarField& Nv = mesh.lookupObject<volScalarField>("Nv");
|
||||
const volSymmTensorField& nsv =
|
||||
mesh.lookupObject<volSymmTensorField>("nsv");
|
||||
|
||||
tmp<volScalarField> tN
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"tN",
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("zero", Nv.dimensions(), 0.0),
|
||||
zeroGradientFvPatchVectorField::typeName
|
||||
)
|
||||
);
|
||||
|
||||
volScalarField& N = tN();
|
||||
|
||||
N.internalField() = Nv.internalField()*pow(mesh.V(), 2.0/3.0);
|
||||
|
||||
tmp<volSymmTensorField> tns
|
||||
(
|
||||
new volSymmTensorField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"tns",
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedSymmTensor
|
||||
(
|
||||
"zero",
|
||||
nsv.dimensions(),
|
||||
pTraits<symmTensor>::zero
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
volSymmTensorField& ns = tns();
|
||||
|
||||
ns.internalField() = nsv.internalField()*pow(mesh.V(), 2.0/3.0);
|
||||
|
||||
const volVectorField Uhat
|
||||
(
|
||||
U/(mag(U) + dimensionedScalar("Usmall", U.dimensions(), 1e-4))
|
||||
);
|
||||
|
||||
const volScalarField nr(sqrt(max(N - (Uhat & ns & Uhat), scalar(1e-4))));
|
||||
|
||||
const scalarField cellWidth(pow(mesh.V(), 1.0/3.0));
|
||||
|
||||
const scalarField upLocal(uPrimeCoef_*sqrt((U & CT & U)*cellWidth));
|
||||
|
||||
const scalarField deltaUp(upLocal*(max(scalar(1.0), pow(nr, 0.5)) - 1.0));
|
||||
|
||||
up.internalField() += deltaUp;
|
||||
if (subGridSchelkin())
|
||||
{
|
||||
up.internalField() += calculateSchelkinEffect();
|
||||
}
|
||||
|
||||
volScalarField tauEta(sqrt(mag(thermo_.muu()/(thermo_.rhou()*epsilon))));
|
||||
|
||||
volScalarField Reta =
|
||||
volScalarField Reta
|
||||
(
|
||||
up
|
||||
/
|
||||
(
|
||||
/ (
|
||||
sqrt(epsilon*tauEta)
|
||||
+ dimensionedScalar("1e-8", up.dimensions(), 1e-8)
|
||||
)
|
||||
@ -162,6 +93,7 @@ bool Foam::XiEqModels::Gulder::read(const dictionary& XiEqProperties)
|
||||
|
||||
XiEqModelCoeffs_.lookup("XiEqCoef") >> XiEqCoef_;
|
||||
XiEqModelCoeffs_.lookup("uPrimeCoef") >> uPrimeCoef_;
|
||||
XiEqModelCoeffs_.lookup("subGridSchelkin") >> subGridSchelkin_;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -61,9 +61,6 @@ class Gulder
|
||||
//- Minimum laminar burning velocity
|
||||
const dimensionedScalar SuMin_;
|
||||
|
||||
//- Model constant
|
||||
scalar uPrimeCoef_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
|
||||
@ -84,6 +84,11 @@ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::SCOPEXiEq::XiEq() const
|
||||
const volScalarField& epsilon = turbulence_.epsilon();
|
||||
|
||||
volScalarField up(sqrt((2.0/3.0)*k));
|
||||
if (subGridSchelkin())
|
||||
{
|
||||
up.internalField() += calculateSchelkinEffect();
|
||||
}
|
||||
|
||||
volScalarField l(lCoef_*sqrt(3.0/2.0)*up*k/epsilon);
|
||||
volScalarField Rl(up*l*thermo_.rhou()/thermo_.muu());
|
||||
|
||||
|
||||
@ -58,9 +58,16 @@ class SCOPEXiEq
|
||||
{
|
||||
// Private data
|
||||
|
||||
// Model constant
|
||||
scalar XiEqCoef_;
|
||||
|
||||
// Model constant
|
||||
scalar XiEqExp_;
|
||||
|
||||
// Model constant
|
||||
scalar lCoef_;
|
||||
|
||||
//- Minimum Su
|
||||
dimensionedScalar SuMin_;
|
||||
|
||||
//- The SCOPE laminar flame speed model used to obtain the
|
||||
|
||||
@ -77,6 +77,11 @@ Foam::XiEqModel::XiEqModel
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
Su.mesh()
|
||||
),
|
||||
uPrimeCoef_(XiEqModelCoeffs_.lookupOrDefault<scalar>("uPrimeCoef", 0.0)),
|
||||
subGridSchelkin_
|
||||
(
|
||||
XiEqModelCoeffs_.lookupOrDefault<bool>("subGridSchelkin", false)
|
||||
)
|
||||
{}
|
||||
|
||||
@ -93,6 +98,10 @@ bool Foam::XiEqModel::read(const dictionary& XiEqProperties)
|
||||
{
|
||||
XiEqModelCoeffs_ = XiEqProperties.subDict(type() + "Coeffs");
|
||||
|
||||
uPrimeCoef_ = XiEqModelCoeffs_.lookupOrDefault<scalar>("uPrimeCoef", 0.0);
|
||||
subGridSchelkin_ =
|
||||
XiEqModelCoeffs_.lookupOrDefault<bool>("subGridSchelkin", false);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -109,4 +118,85 @@ void Foam::XiEqModel::writeFields() const
|
||||
}
|
||||
}
|
||||
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::XiEqModel::calculateSchelkinEffect() const
|
||||
{
|
||||
const fvMesh& mesh = Su_.mesh();
|
||||
|
||||
const volVectorField& U = mesh.lookupObject<volVectorField>("U");
|
||||
|
||||
const volSymmTensorField& CT = mesh.lookupObject<volSymmTensorField>("CT");
|
||||
const volScalarField& Nv = mesh.lookupObject<volScalarField>("Nv");
|
||||
const volSymmTensorField& nsv =
|
||||
mesh.lookupObject<volSymmTensorField>("nsv");
|
||||
|
||||
tmp<volScalarField> tN
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"tN",
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("zero", Nv.dimensions(), 0.0),
|
||||
zeroGradientFvPatchVectorField::typeName
|
||||
)
|
||||
);
|
||||
|
||||
volScalarField& N = tN();
|
||||
|
||||
N.internalField() = Nv.internalField()*pow(mesh.V(), 2.0/3.0);
|
||||
|
||||
tmp<volSymmTensorField> tns
|
||||
(
|
||||
new volSymmTensorField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"tns",
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedSymmTensor
|
||||
(
|
||||
"zero",
|
||||
nsv.dimensions(),
|
||||
pTraits<symmTensor>::zero
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
volSymmTensorField& ns = tns();
|
||||
|
||||
ns.internalField() = nsv.internalField()*pow(mesh.V(), 2.0/3.0);
|
||||
|
||||
const volVectorField Uhat
|
||||
(
|
||||
U/(mag(U) + dimensionedScalar("Usmall", U.dimensions(), 1e-4))
|
||||
);
|
||||
|
||||
const volScalarField nr(sqrt(max(N - (Uhat & ns & Uhat), scalar(1e-4))));
|
||||
|
||||
const scalarField cellWidth(pow(mesh.V(), 1.0/3.0));
|
||||
|
||||
const scalarField upLocal(uPrimeCoef_*sqrt((U & CT & U)*cellWidth));
|
||||
|
||||
const scalarField deltaUp(upLocal*(max(scalar(1.0), pow(nr, 0.5)) - 1.0));
|
||||
|
||||
//Re use tN
|
||||
N.internalField() = upLocal*(max(scalar(1.0), pow(nr, 0.5)) - 1.0);
|
||||
|
||||
return tN;
|
||||
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -62,14 +62,30 @@ protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Dictionary
|
||||
dictionary XiEqModelCoeffs_;
|
||||
|
||||
//- Thermo
|
||||
const hhuCombustionThermo& thermo_;
|
||||
|
||||
//- Turbulence
|
||||
const compressible::RASModel& turbulence_;
|
||||
|
||||
//- Laminar burning velocity
|
||||
const volScalarField& Su_;
|
||||
|
||||
//- Volumetric obstacles number
|
||||
volScalarField Nv_;
|
||||
|
||||
//
|
||||
volSymmTensorField nsv_;
|
||||
|
||||
//- Schelkin effect Model constant
|
||||
scalar uPrimeCoef_;
|
||||
|
||||
//- Use sub-grid Schelkin effect
|
||||
bool subGridSchelkin_;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
@ -146,6 +162,15 @@ public:
|
||||
return turbulence_.muEff();
|
||||
}
|
||||
|
||||
//- Return state of the sub-grid Schelkin effect
|
||||
bool subGridSchelkin() const
|
||||
{
|
||||
return subGridSchelkin_;
|
||||
}
|
||||
|
||||
//- Return the sub-grid Schelkin effect
|
||||
tmp<volScalarField> calculateSchelkinEffect() const;
|
||||
|
||||
//- Update properties from given dictionary
|
||||
virtual bool read(const dictionary& XiEqProperties) = 0;
|
||||
|
||||
|
||||
@ -64,7 +64,7 @@ Foam::XiEqModels::instability::~instability()
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::XiEqModels::instability::XiEq() const
|
||||
{
|
||||
volScalarField turbXiEq = XiEqModel_->XiEq();
|
||||
volScalarField turbXiEq(XiEqModel_->XiEq());
|
||||
return XiEqIn/turbXiEq + turbXiEq;
|
||||
}
|
||||
|
||||
|
||||
@ -73,9 +73,11 @@ class externalWallHeatFluxTemperatureFvPatchScalarField
|
||||
public mixedFvPatchScalarField,
|
||||
public temperatureCoupledBase
|
||||
{
|
||||
// Private data
|
||||
public:
|
||||
|
||||
//- how to operate the BC
|
||||
// Public data
|
||||
|
||||
//- Operation mode enumeration
|
||||
enum operationMode
|
||||
{
|
||||
fixedHeatFlux,
|
||||
@ -84,6 +86,11 @@ class externalWallHeatFluxTemperatureFvPatchScalarField
|
||||
};
|
||||
static const NamedEnum<operationMode, 3> operationModeNames;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Private data
|
||||
|
||||
//- Operation mode
|
||||
operationMode oldMode_;
|
||||
|
||||
|
||||
@ -159,7 +159,7 @@ void turbulentTemperatureRadCoupledMixedFvPatchScalarField::updateCoeffs()
|
||||
const fvPatch& nbrPatch =
|
||||
refCast<const fvMesh>(nbrMesh).boundary()[samplePatchI];
|
||||
|
||||
scalarField Tc = patchInternalField();
|
||||
scalarField Tc(patchInternalField());
|
||||
scalarField& Tp = *this;
|
||||
|
||||
const turbulentTemperatureRadCoupledMixedFvPatchScalarField&
|
||||
@ -170,16 +170,16 @@ void turbulentTemperatureRadCoupledMixedFvPatchScalarField::updateCoeffs()
|
||||
);
|
||||
|
||||
// Swap to obtain full local values of neighbour internal field
|
||||
scalarField TcNbr = nbrField.patchInternalField();
|
||||
scalarField TcNbr(nbrField.patchInternalField());
|
||||
|
||||
mpp.map().distribute(TcNbr);
|
||||
|
||||
// Swap to obtain full local values of neighbour K*delta
|
||||
scalarField KDeltaNbr = nbrField.K(TcNbr)*nbrPatch.deltaCoeffs();
|
||||
scalarField KDeltaNbr(nbrField.K(TcNbr)*nbrPatch.deltaCoeffs());
|
||||
|
||||
mpp.map().distribute(KDeltaNbr);
|
||||
|
||||
scalarField KDelta = K(*this)*patch().deltaCoeffs();
|
||||
scalarField KDelta(K(*this)*patch().deltaCoeffs());
|
||||
|
||||
scalarField Qr(Tp.size(), 0.0);
|
||||
if (QrName_ != "none")
|
||||
|
||||
@ -18,7 +18,8 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
|
||||
-I$(LIB_SRC)/ODE/lnInclude \
|
||||
-I$(LIB_SRC)/surfaceFilmModels/lnInclude
|
||||
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
|
||||
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
@ -40,4 +41,5 @@ EXE_LIBS = \
|
||||
-lchemistryModel \
|
||||
-lradiationModels \
|
||||
-lODE \
|
||||
-lregionModels \
|
||||
-lsurfaceFilmModels
|
||||
|
||||
@ -17,7 +17,8 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
|
||||
-I$(LIB_SRC)/surfaceFilmModels/lnInclude \
|
||||
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
|
||||
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
|
||||
-I$(LIB_SRC)/ODE/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
@ -40,5 +41,6 @@ EXE_LIBS = \
|
||||
-lSLGThermo \
|
||||
-lchemistryModel \
|
||||
-lradiationModels \
|
||||
-lregionModels \
|
||||
-lsurfaceFilmModels \
|
||||
-lODE
|
||||
|
||||
@ -11,7 +11,8 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/surfaceFilmModels/lnInclude \
|
||||
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
|
||||
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicFvMesh/lnInclude
|
||||
|
||||
@ -28,6 +29,7 @@ EXE_LIBS = \
|
||||
-lincompressibleTransportModels \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-lregionModels \
|
||||
-lsurfaceFilmModels \
|
||||
-ldynamicMesh \
|
||||
-ldynamicFvMesh \
|
||||
|
||||
@ -10,7 +10,8 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/surfaceFilmModels/lnInclude
|
||||
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
|
||||
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
|
||||
|
||||
EXE_LIBS = \
|
||||
-llagrangian \
|
||||
@ -24,4 +25,5 @@ EXE_LIBS = \
|
||||
-lincompressibleTransportModels \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-lregionModels \
|
||||
-lsurfaceFilmModels
|
||||
|
||||
@ -18,7 +18,8 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
|
||||
-I$(LIB_SRC)/ODE/lnInclude \
|
||||
-I$(LIB_SRC)/surfaceFilmModels/lnInclude
|
||||
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
|
||||
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
@ -40,4 +41,5 @@ EXE_LIBS = \
|
||||
-lchemistryModel \
|
||||
-lradiationModels \
|
||||
-lODE \
|
||||
-lregionModels \
|
||||
-lsurfaceFilmModels
|
||||
|
||||
@ -14,7 +14,8 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
|
||||
-I$(LIB_SRC)/surfaceFilmModels/lnInclude \
|
||||
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
|
||||
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
|
||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
|
||||
-I$(LIB_SRC)/ODE/lnInclude
|
||||
@ -32,6 +33,7 @@ EXE_LIBS = \
|
||||
-lreactionThermophysicalModels \
|
||||
-lSLGThermo \
|
||||
-lchemistryModel \
|
||||
-lregionModels \
|
||||
-lradiationModels \
|
||||
-lsurfaceFilmModels \
|
||||
-llagrangianIntermediate \
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
Info<< "\nConstructing surface film model" << endl;
|
||||
|
||||
autoPtr<surfaceFilmModels::surfaceFilmModel>
|
||||
tsurfaceFilm(surfaceFilmModels::surfaceFilmModel::New(mesh, g));
|
||||
surfaceFilmModels::surfaceFilmModel& surfaceFilm = tsurfaceFilm();
|
||||
typedef regionModels::surfaceFilmModels::surfaceFilmModel filmModelType;
|
||||
|
||||
autoPtr<filmModelType> tsurfaceFilm(filmModelType::New(mesh, g));
|
||||
filmModelType& surfaceFilm = tsurfaceFilm();
|
||||
|
||||
|
||||
@ -17,7 +17,8 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
|
||||
-I$(LIB_SRC)/ODE/lnInclude \
|
||||
-I$(LIB_SRC)/surfaceFilmModels/lnInclude
|
||||
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
|
||||
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
@ -39,4 +40,5 @@ EXE_LIBS = \
|
||||
-lchemistryModel \
|
||||
-lradiationModels \
|
||||
-lODE \
|
||||
-lregionModels \
|
||||
-lsurfaceFilmModels
|
||||
|
||||
@ -8,7 +8,8 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/surfaceFilmModels/lnInclude
|
||||
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
|
||||
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-llagrangian \
|
||||
@ -22,4 +23,5 @@ EXE_LIBS = \
|
||||
-lcompressibleLESModels \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-lregionModels \
|
||||
-lsurfaceFilmModels
|
||||
|
||||
@ -1,296 +0,0 @@
|
||||
# Wavefront OBJ file
|
||||
# Regions:
|
||||
# 0 movingWall
|
||||
# 1 fixedWalls
|
||||
# 2 frontAndBack
|
||||
#
|
||||
# points : 96
|
||||
# triangles : 188
|
||||
#
|
||||
v 0.1 0.1 0.5
|
||||
v 0.1 0.1 0.5625
|
||||
v 0.16 0.1 0.5625
|
||||
v 0.16 0.1 0.5
|
||||
v 0.1 0.1 0.625
|
||||
v 0.16 0.1 0.625
|
||||
v 0.1 0.1 0.6875
|
||||
v 0.16 0.1 0.6875
|
||||
v 0.1 0.1 0.75
|
||||
v 0.16 0.1 0.75
|
||||
v 0.22 0.1 0.5625
|
||||
v 0.22 0.1 0.5
|
||||
v 0.22 0.1 0.625
|
||||
v 0.22 0.1 0.6875
|
||||
v 0.22 0.1 0.75
|
||||
v 0.28 0.1 0.5625
|
||||
v 0.28 0.1 0.5
|
||||
v 0.28 0.1 0.625
|
||||
v 0.28 0.1 0.6875
|
||||
v 0.28 0.1 0.75
|
||||
v 0.34 0.1 0.5625
|
||||
v 0.34 0.1 0.5
|
||||
v 0.34 0.1 0.625
|
||||
v 0.34 0.1 0.6875
|
||||
v 0.34 0.1 0.75
|
||||
v 0.4 0.1 0.5625
|
||||
v 0.4 0.1 0.5
|
||||
v 0.4 0.1 0.625
|
||||
v 0.4 0.1 0.6875
|
||||
v 0.4 0.1 0.75
|
||||
v 0.1 -0.3 0.5
|
||||
v 0.1 -0.3 0.5625
|
||||
v 0.1 -0.166667 0.5625
|
||||
v 0.1 -0.166667 0.5
|
||||
v 0.1 -0.0333333 0.5625
|
||||
v 0.1 -0.0333333 0.5
|
||||
v 0.1 -0.3 0.625
|
||||
v 0.1 -0.166667 0.625
|
||||
v 0.1 -0.0333333 0.625
|
||||
v 0.1 -0.3 0.6875
|
||||
v 0.1 -0.166667 0.6875
|
||||
v 0.1 -0.0333333 0.6875
|
||||
v 0.1 -0.3 0.75
|
||||
v 0.1 -0.166667 0.75
|
||||
v 0.1 -0.0333333 0.75
|
||||
v 0.4 -0.3 0.5
|
||||
v 0.4 -0.166667 0.5
|
||||
v 0.4 -0.166667 0.5625
|
||||
v 0.4 -0.3 0.5625
|
||||
v 0.4 -0.0333333 0.5
|
||||
v 0.4 -0.0333333 0.5625
|
||||
v 0.4 -0.166667 0.625
|
||||
v 0.4 -0.3 0.625
|
||||
v 0.4 -0.0333333 0.625
|
||||
v 0.4 -0.166667 0.6875
|
||||
v 0.4 -0.3 0.6875
|
||||
v 0.4 -0.0333333 0.6875
|
||||
v 0.4 -0.166667 0.75
|
||||
v 0.4 -0.3 0.75
|
||||
v 0.4 -0.0333333 0.75
|
||||
v 0.16 -0.3 0.5
|
||||
v 0.16 -0.3 0.5625
|
||||
v 0.16 -0.3 0.625
|
||||
v 0.16 -0.3 0.6875
|
||||
v 0.16 -0.3 0.75
|
||||
v 0.22 -0.3 0.5
|
||||
v 0.22 -0.3 0.5625
|
||||
v 0.22 -0.3 0.625
|
||||
v 0.22 -0.3 0.6875
|
||||
v 0.22 -0.3 0.75
|
||||
v 0.28 -0.3 0.5
|
||||
v 0.28 -0.3 0.5625
|
||||
v 0.28 -0.3 0.625
|
||||
v 0.28 -0.3 0.6875
|
||||
v 0.28 -0.3 0.75
|
||||
v 0.34 -0.3 0.5
|
||||
v 0.34 -0.3 0.5625
|
||||
v 0.34 -0.3 0.625
|
||||
v 0.34 -0.3 0.6875
|
||||
v 0.34 -0.3 0.75
|
||||
v 0.16 -0.166667 0.5
|
||||
v 0.16 -0.0333333 0.5
|
||||
v 0.22 -0.166667 0.5
|
||||
v 0.22 -0.0333333 0.5
|
||||
v 0.28 -0.166667 0.5
|
||||
v 0.28 -0.0333333 0.5
|
||||
v 0.34 -0.166667 0.5
|
||||
v 0.34 -0.0333333 0.5
|
||||
v 0.16 -0.166667 0.75
|
||||
v 0.16 -0.0333333 0.75
|
||||
v 0.22 -0.166667 0.75
|
||||
v 0.22 -0.0333333 0.75
|
||||
v 0.28 -0.166667 0.75
|
||||
v 0.28 -0.0333333 0.75
|
||||
v 0.34 -0.166667 0.75
|
||||
v 0.34 -0.0333333 0.75
|
||||
g movingWall
|
||||
f 1 2 3
|
||||
f 3 4 1
|
||||
f 2 5 6
|
||||
f 6 3 2
|
||||
f 5 7 8
|
||||
f 8 6 5
|
||||
f 7 9 10
|
||||
f 10 8 7
|
||||
f 4 3 11
|
||||
f 11 12 4
|
||||
f 3 6 13
|
||||
f 13 11 3
|
||||
f 6 8 14
|
||||
f 14 13 6
|
||||
f 8 10 15
|
||||
f 15 14 8
|
||||
f 12 11 16
|
||||
f 16 17 12
|
||||
f 11 13 18
|
||||
f 18 16 11
|
||||
f 13 14 19
|
||||
f 19 18 13
|
||||
f 14 15 20
|
||||
f 20 19 14
|
||||
f 17 16 21
|
||||
f 21 22 17
|
||||
f 16 18 23
|
||||
f 23 21 16
|
||||
f 18 19 24
|
||||
f 24 23 18
|
||||
f 19 20 25
|
||||
f 25 24 19
|
||||
f 22 21 26
|
||||
f 26 27 22
|
||||
f 21 23 28
|
||||
f 28 26 21
|
||||
f 23 24 29
|
||||
f 29 28 23
|
||||
f 24 25 30
|
||||
f 30 29 24
|
||||
g fixedWalls
|
||||
f 31 32 33
|
||||
f 33 34 31
|
||||
f 34 33 35
|
||||
f 35 36 34
|
||||
f 36 35 2
|
||||
f 2 1 36
|
||||
f 32 37 38
|
||||
f 38 33 32
|
||||
f 33 38 39
|
||||
f 39 35 33
|
||||
f 35 39 5
|
||||
f 5 2 35
|
||||
f 37 40 41
|
||||
f 41 38 37
|
||||
f 38 41 42
|
||||
f 42 39 38
|
||||
f 39 42 7
|
||||
f 7 5 39
|
||||
f 40 43 44
|
||||
f 44 41 40
|
||||
f 41 44 45
|
||||
f 45 42 41
|
||||
f 42 45 9
|
||||
f 9 7 42
|
||||
f 46 47 48
|
||||
f 48 49 46
|
||||
f 47 50 51
|
||||
f 51 48 47
|
||||
f 50 27 26
|
||||
f 26 51 50
|
||||
f 49 48 52
|
||||
f 52 53 49
|
||||
f 48 51 54
|
||||
f 54 52 48
|
||||
f 51 26 28
|
||||
f 28 54 51
|
||||
f 53 52 55
|
||||
f 55 56 53
|
||||
f 52 54 57
|
||||
f 57 55 52
|
||||
f 54 28 29
|
||||
f 29 57 54
|
||||
f 56 55 58
|
||||
f 58 59 56
|
||||
f 55 57 60
|
||||
f 60 58 55
|
||||
f 57 29 30
|
||||
f 30 60 57
|
||||
f 31 61 62
|
||||
f 62 32 31
|
||||
f 32 62 63
|
||||
f 63 37 32
|
||||
f 37 63 64
|
||||
f 64 40 37
|
||||
f 40 64 65
|
||||
f 65 43 40
|
||||
f 61 66 67
|
||||
f 67 62 61
|
||||
f 62 67 68
|
||||
f 68 63 62
|
||||
f 63 68 69
|
||||
f 69 64 63
|
||||
f 64 69 70
|
||||
f 70 65 64
|
||||
f 66 71 72
|
||||
f 72 67 66
|
||||
f 67 72 73
|
||||
f 73 68 67
|
||||
f 68 73 74
|
||||
f 74 69 68
|
||||
f 69 74 75
|
||||
f 75 70 69
|
||||
f 71 76 77
|
||||
f 77 72 71
|
||||
f 72 77 78
|
||||
f 78 73 72
|
||||
f 73 78 79
|
||||
f 79 74 73
|
||||
f 74 79 80
|
||||
f 80 75 74
|
||||
f 76 46 49
|
||||
f 49 77 76
|
||||
f 77 49 53
|
||||
f 53 78 77
|
||||
f 78 53 56
|
||||
f 56 79 78
|
||||
f 79 56 59
|
||||
f 59 80 79
|
||||
g frontAndBack
|
||||
f 31 34 81
|
||||
f 81 61 31
|
||||
f 34 36 82
|
||||
f 82 81 34
|
||||
f 36 1 4
|
||||
f 4 82 36
|
||||
f 61 81 83
|
||||
f 83 66 61
|
||||
f 81 82 84
|
||||
f 84 83 81
|
||||
f 82 4 12
|
||||
f 12 84 82
|
||||
f 66 83 85
|
||||
f 85 71 66
|
||||
f 83 84 86
|
||||
f 86 85 83
|
||||
f 84 12 17
|
||||
f 17 86 84
|
||||
f 71 85 87
|
||||
f 87 76 71
|
||||
f 85 86 88
|
||||
f 88 87 85
|
||||
f 86 17 22
|
||||
f 22 88 86
|
||||
f 76 87 47
|
||||
f 47 46 76
|
||||
f 87 88 50
|
||||
f 50 47 87
|
||||
f 88 22 27
|
||||
f 27 50 88
|
||||
f 43 65 89
|
||||
f 89 44 43
|
||||
f 44 89 90
|
||||
f 90 45 44
|
||||
f 45 90 10
|
||||
f 10 9 45
|
||||
f 65 70 91
|
||||
f 91 89 65
|
||||
f 89 91 92
|
||||
f 92 90 89
|
||||
f 90 92 15
|
||||
f 15 10 90
|
||||
f 70 75 93
|
||||
f 93 91 70
|
||||
f 91 93 94
|
||||
f 94 92 91
|
||||
f 92 94 20
|
||||
f 20 15 92
|
||||
f 75 80 95
|
||||
f 95 93 75
|
||||
f 93 95 96
|
||||
f 96 94 93
|
||||
f 94 96 25
|
||||
f 25 20 94
|
||||
f 80 59 58
|
||||
f 58 95 80
|
||||
f 95 58 60
|
||||
f 60 96 95
|
||||
f 96 60 30
|
||||
f 30 25 96
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -327,10 +327,36 @@ int main(int argc, char *argv[])
|
||||
showTransform = false;
|
||||
}
|
||||
|
||||
// calculate the total surface area
|
||||
|
||||
scalar surfaceArea = 0;
|
||||
|
||||
forAll(surf, faceI)
|
||||
{
|
||||
const labelledTri& f = surf[faceI];
|
||||
|
||||
if (f[0] == f[1] || f[0] == f[2] || f[1] == f[2])
|
||||
{
|
||||
WarningIn(args.executable())
|
||||
<< "Illegal triangle " << faceI << " vertices " << f
|
||||
<< " coords " << f.points(surf.points()) << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
surfaceArea += triPointRef
|
||||
(
|
||||
surf.points()[f[0]],
|
||||
surf.points()[f[1]],
|
||||
surf.points()[f[2]]
|
||||
).mag();
|
||||
}
|
||||
}
|
||||
|
||||
Info<< nl << setprecision(12)
|
||||
<< "Density: " << density << nl
|
||||
<< "Mass: " << m << nl
|
||||
<< "Centre of mass: " << cM << nl
|
||||
<< "Surface area: " << surfaceArea << nl
|
||||
<< "Inertia tensor around centre of mass: " << nl << J << nl
|
||||
<< "eigenValues (principal moments): " << eVal << nl
|
||||
<< "eigenVectors (principal axes): " << nl
|
||||
|
||||
@ -172,7 +172,7 @@ do
|
||||
node=""
|
||||
esac
|
||||
|
||||
echo "#!/bin/sh" > $procCmdFile
|
||||
echo "#!/bin/bash" > $procCmdFile
|
||||
case "$method" in
|
||||
0)
|
||||
echo "$sourceFoam; cd $PWD; $exec $args | tee $procLog" >> $procCmdFile
|
||||
|
||||
@ -60,7 +60,7 @@ wmake $makeType randomProcesses
|
||||
thermophysicalModels/Allwmake $*
|
||||
transportModels/Allwmake $*
|
||||
turbulenceModels/Allwmake $*
|
||||
wmake $makeType surfaceFilmModels
|
||||
regionModels/Allwmake $*
|
||||
lagrangian/Allwmake $*
|
||||
postProcessing/Allwmake $*
|
||||
mesh/Allwmake $*
|
||||
|
||||
@ -1105,18 +1105,33 @@ int Foam::system(const std::string& command)
|
||||
|
||||
void* Foam::dlOpen(const fileName& lib)
|
||||
{
|
||||
if (POSIX::debug)
|
||||
{
|
||||
Info<< "dlOpen(const fileName&)"
|
||||
<< " : dlopen of " << lib << endl;
|
||||
}
|
||||
return ::dlopen(lib.c_str(), RTLD_LAZY|RTLD_GLOBAL);
|
||||
}
|
||||
|
||||
|
||||
bool Foam::dlClose(void* handle)
|
||||
{
|
||||
if (POSIX::debug)
|
||||
{
|
||||
Info<< "dlClose(void*)"
|
||||
<< " : dlclose" << endl;
|
||||
}
|
||||
return ::dlclose(handle) == 0;
|
||||
}
|
||||
|
||||
|
||||
void* Foam::dlSym(void* handle, const std::string& symbol)
|
||||
{
|
||||
if (POSIX::debug)
|
||||
{
|
||||
Info<< "dlSym(void*, const std::string&)"
|
||||
<< " : dlsym of " << symbol << endl;
|
||||
}
|
||||
// clear any old errors - see manpage dlopen
|
||||
(void) ::dlerror();
|
||||
|
||||
@ -1141,6 +1156,12 @@ bool Foam::dlSymFound(void* handle, const std::string& symbol)
|
||||
{
|
||||
if (handle && !symbol.empty())
|
||||
{
|
||||
if (POSIX::debug)
|
||||
{
|
||||
Info<< "dlSymFound(void*, const std::string&)"
|
||||
<< " : dlsym of " << symbol << endl;
|
||||
}
|
||||
|
||||
// clear any old errors - see manpage dlopen
|
||||
(void) ::dlerror();
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -449,9 +449,6 @@ public:
|
||||
|
||||
// Member operators
|
||||
|
||||
//- Conversion to a const_iterator
|
||||
inline operator const_iterator() const;
|
||||
|
||||
//- Return referenced hash value
|
||||
inline T& operator*();
|
||||
inline T& operator()();
|
||||
@ -501,6 +498,9 @@ public:
|
||||
//- Construct null (end iterator)
|
||||
inline const_iterator();
|
||||
|
||||
//- Construct from iterator
|
||||
inline const_iterator(const iterator&);
|
||||
|
||||
//- Construct end iterator
|
||||
inline const_iterator(const iteratorEnd& unused);
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -362,17 +362,6 @@ inline Foam::HashTable<T, Key, Hash>::iterator::iterator
|
||||
{}
|
||||
|
||||
|
||||
template<class T, class Key, class Hash>
|
||||
inline Foam::HashTable<T, Key, Hash>::iterator::operator
|
||||
typename Foam::HashTable<T, Key, Hash>::const_iterator() const
|
||||
{
|
||||
return *reinterpret_cast
|
||||
<
|
||||
const typename Foam::HashTable<T, Key, Hash>::const_iterator*
|
||||
>(this);
|
||||
}
|
||||
|
||||
|
||||
template<class T, class Key, class Hash>
|
||||
inline T&
|
||||
Foam::HashTable<T, Key, Hash>::iterator::operator*()
|
||||
@ -442,6 +431,16 @@ inline Foam::HashTable<T, Key, Hash>::const_iterator::const_iterator()
|
||||
{}
|
||||
|
||||
|
||||
template<class T, class Key, class Hash>
|
||||
inline Foam::HashTable<T, Key, Hash>::const_iterator::const_iterator
|
||||
(
|
||||
const HashTable<T, Key, Hash>::iterator& iter
|
||||
)
|
||||
:
|
||||
iteratorBase(iter)
|
||||
{}
|
||||
|
||||
|
||||
template<class T, class Key, class Hash>
|
||||
inline Foam::HashTable<T, Key, Hash>::const_iterator::const_iterator
|
||||
(
|
||||
|
||||
@ -309,6 +309,9 @@ Foam::polyMesh::polyMesh(const IOobject& io)
|
||||
WarningIn("polyMesh(const IOobject&)")
|
||||
<< "no cells in mesh" << endl;
|
||||
}
|
||||
|
||||
// Initialise demand-driven data
|
||||
calcDirections();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -42,6 +42,7 @@ SourceFiles
|
||||
#include "point.H"
|
||||
#include "primitiveFieldsFwd.H"
|
||||
#include "pointHit.H"
|
||||
#include "cachedRandom.H"
|
||||
#include "Random.H"
|
||||
#include "FixedList.H"
|
||||
#include "UList.H"
|
||||
@ -164,6 +165,10 @@ public:
|
||||
// uniform distribution
|
||||
inline Point randomPoint(Random& rndGen) const;
|
||||
|
||||
//- Return a random point in the tetrahedron from a
|
||||
// uniform distribution
|
||||
inline Point randomPoint(cachedRandom& rndGen) const;
|
||||
|
||||
//- Calculate the barycentric coordinates of the given
|
||||
// point, in the same order as a, b, c, d. Returns the
|
||||
// determinant of the solution.
|
||||
|
||||
@ -240,6 +240,42 @@ inline Point Foam::tetrahedron<Point, PointRef>::randomPoint
|
||||
}
|
||||
|
||||
|
||||
template<class Point, class PointRef>
|
||||
inline Point Foam::tetrahedron<Point, PointRef>::randomPoint
|
||||
(
|
||||
cachedRandom& rndGen
|
||||
) const
|
||||
{
|
||||
// Adapted from
|
||||
// http://vcg.isti.cnr.it/activities/geometryegraphics/pointintetraedro.html
|
||||
|
||||
scalar s = rndGen.sample01<scalar>();
|
||||
scalar t = rndGen.sample01<scalar>();
|
||||
scalar u = rndGen.sample01<scalar>();
|
||||
|
||||
if (s + t > 1.0)
|
||||
{
|
||||
s = 1.0 - s;
|
||||
t = 1.0 - t;
|
||||
}
|
||||
|
||||
if (t + u > 1.0)
|
||||
{
|
||||
scalar tmp = u;
|
||||
u = 1.0 - s - t;
|
||||
t = 1.0 - tmp;
|
||||
}
|
||||
else if (s + t + u > 1.0)
|
||||
{
|
||||
scalar tmp = u;
|
||||
u = s + t + u - 1.0;
|
||||
s = 1.0 - t - tmp;
|
||||
}
|
||||
|
||||
return (1 - s - t - u)*a_ + s*b_ + t*c_ + u*d_;
|
||||
}
|
||||
|
||||
|
||||
template<class Point, class PointRef>
|
||||
Foam::scalar Foam::tetrahedron<Point, PointRef>::barycentric
|
||||
(
|
||||
|
||||
@ -114,8 +114,10 @@ derivedFvPatchFields = $(fvPatchFields)/derived
|
||||
$(derivedFvPatchFields)/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C
|
||||
$(derivedFvPatchFields)/activePressureForceBaffleVelocity/activePressureForceBaffleVelocityFvPatchVectorField.C
|
||||
$(derivedFvPatchFields)/advective/advectiveFvPatchFields.C
|
||||
|
||||
$(derivedFvPatchFields)/codedFixedValue/codedFixedValueFvPatchScalarField.C
|
||||
$(derivedFvPatchFields)/directMappedField/directMappedFieldFvPatchFields.C
|
||||
$(derivedFvPatchFields)/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFields.C
|
||||
$(derivedFvPatchFields)/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFields.C
|
||||
$(derivedFvPatchFields)/directMappedFixedValue/directMappedFixedValueFvPatchFields.C
|
||||
$(derivedFvPatchFields)/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C
|
||||
$(derivedFvPatchFields)/fan/fanFvPatchFields.C
|
||||
@ -217,6 +219,7 @@ $(surfaceInterpolation)/surfaceInterpolationScheme/surfaceInterpolationSchemes.C
|
||||
|
||||
schemes = $(surfaceInterpolation)/schemes
|
||||
$(schemes)/linear/linear.C
|
||||
$(schemes)/pointLinear/pointLinear.C
|
||||
$(schemes)/midPoint/midPoint.C
|
||||
$(schemes)/downwind/downwind.C
|
||||
$(schemes)/weighted/weighted.C
|
||||
|
||||
@ -319,7 +319,7 @@ void Foam::activePressureForceBaffleVelocityFvPatchVectorField::updateCoeffs()
|
||||
Info<< "Pressure difference = " << valueDiff << endl;
|
||||
|
||||
vectorField::subField Sfw = patch().patch().faceAreas();
|
||||
vectorField newSfw = (1 - openFraction_)*initWallSf_;
|
||||
vectorField newSfw((1 - openFraction_)*initWallSf_);
|
||||
forAll(Sfw, facei)
|
||||
{
|
||||
Sfw[facei] = newSfw[facei];
|
||||
|
||||
@ -0,0 +1,313 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "directMappedFieldFvPatchField.H"
|
||||
|
||||
#include "volFields.H"
|
||||
#include "interpolationCell.H"
|
||||
#include "mapDistribute.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
directMappedFieldFvPatchField<Type>::directMappedFieldFvPatchField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<Type, volMesh>& iF
|
||||
)
|
||||
:
|
||||
directMappedPatchBase(p.patch()),
|
||||
fixedValueFvPatchField<Type>(p, iF),
|
||||
fieldName_(iF.name()),
|
||||
setAverage_(false),
|
||||
average_(pTraits<Type>::zero)
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
directMappedFieldFvPatchField<Type>::directMappedFieldFvPatchField
|
||||
(
|
||||
const directMappedFieldFvPatchField<Type>& ptf,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<Type, volMesh>& iF,
|
||||
const fvPatchFieldMapper& mapper
|
||||
)
|
||||
:
|
||||
directMappedPatchBase(p.patch(), ptf),
|
||||
fixedValueFvPatchField<Type>(ptf, p, iF, mapper),
|
||||
fieldName_(ptf.fieldName_),
|
||||
setAverage_(ptf.setAverage_),
|
||||
average_(ptf.average_)
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
directMappedFieldFvPatchField<Type>::directMappedFieldFvPatchField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<Type, volMesh>& iF,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
directMappedPatchBase(p.patch(), dict),
|
||||
fixedValueFvPatchField<Type>(p, iF, dict),
|
||||
fieldName_(dict.template lookupOrDefault<word>("fieldName", iF.name())),
|
||||
setAverage_(readBool(dict.lookup("setAverage"))),
|
||||
average_(pTraits<Type>(dict.lookup("average")))
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
directMappedFieldFvPatchField<Type>::directMappedFieldFvPatchField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<Type, volMesh>& iF,
|
||||
|
||||
// directMappedPatchBase
|
||||
const word& sampleRegion,
|
||||
const sampleMode sampleMode,
|
||||
const word& samplePatch,
|
||||
const scalar distance,
|
||||
|
||||
// My settings
|
||||
const word& fieldName,
|
||||
const bool setAverage,
|
||||
const Type average
|
||||
)
|
||||
:
|
||||
directMappedPatchBase
|
||||
(
|
||||
p.patch(),
|
||||
sampleRegion,
|
||||
sampleMode,
|
||||
samplePatch,
|
||||
distance
|
||||
),
|
||||
fixedValueFvPatchField<Type>(p, iF),
|
||||
fieldName_(fieldName),
|
||||
setAverage_(setAverage),
|
||||
average_(average)
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
directMappedFieldFvPatchField<Type>::directMappedFieldFvPatchField
|
||||
(
|
||||
const directMappedFieldFvPatchField<Type>& ptf
|
||||
)
|
||||
:
|
||||
directMappedPatchBase(ptf.patch().patch(), ptf),
|
||||
fixedValueFvPatchField<Type>(ptf),
|
||||
fieldName_(ptf.fieldName_),
|
||||
setAverage_(ptf.setAverage_),
|
||||
average_(ptf.average_)
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
directMappedFieldFvPatchField<Type>::directMappedFieldFvPatchField
|
||||
(
|
||||
const directMappedFieldFvPatchField<Type>& ptf,
|
||||
const DimensionedField<Type, volMesh>& iF
|
||||
)
|
||||
:
|
||||
directMappedPatchBase(ptf.patch().patch(), ptf),
|
||||
fixedValueFvPatchField<Type>(ptf, iF),
|
||||
fieldName_(ptf.fieldName_),
|
||||
setAverage_(ptf.setAverage_),
|
||||
average_(ptf.average_)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
const GeometricField<Type, fvPatchField, volMesh>&
|
||||
directMappedFieldFvPatchField<Type>::sampleField() const
|
||||
{
|
||||
typedef GeometricField<Type, fvPatchField, volMesh> fieldType;
|
||||
|
||||
const fvMesh& nbrMesh = refCast<const fvMesh>(sampleMesh());
|
||||
|
||||
if (sameRegion())
|
||||
{
|
||||
if (fieldName_ == this->dimensionedInternalField().name())
|
||||
{
|
||||
// Optimisation: bypass field lookup
|
||||
return
|
||||
dynamic_cast<const fieldType&>
|
||||
(
|
||||
this->dimensionedInternalField()
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
const fvMesh& thisMesh = this->patch().boundaryMesh().mesh();
|
||||
return thisMesh.template lookupObject<fieldType>(fieldName_);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return nbrMesh.template lookupObject<fieldType>(fieldName_);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void directMappedFieldFvPatchField<Type>::updateCoeffs()
|
||||
{
|
||||
if (this->updated())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
typedef GeometricField<Type, fvPatchField, volMesh> fieldType;
|
||||
|
||||
const fvMesh& nbrMesh = refCast<const fvMesh>(sampleMesh());
|
||||
const mapDistribute& distMap = directMappedPatchBase::map();
|
||||
|
||||
// Result of obtaining remote values
|
||||
Field<Type> newValues;
|
||||
|
||||
switch (mode())
|
||||
{
|
||||
case NEARESTCELL:
|
||||
{
|
||||
newValues = sampleField();
|
||||
|
||||
distMap.distribute(newValues);
|
||||
|
||||
break;
|
||||
}
|
||||
case NEARESTPATCHFACE:
|
||||
{
|
||||
const label nbrPatchID = nbrMesh.boundaryMesh().findPatchID
|
||||
(
|
||||
samplePatch()
|
||||
);
|
||||
if (nbrPatchID < 0)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"void directMappedFieldFvPatchField<Type>::updateCoeffs()"
|
||||
)<< "Unable to find sample patch " << samplePatch()
|
||||
<< " in region " << sampleRegion()
|
||||
<< " for patch " << this->patch().name() << nl
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
const fieldType& nbrField = sampleField();
|
||||
|
||||
newValues = nbrField.boundaryField()[nbrPatchID];
|
||||
distMap.distribute(newValues);
|
||||
|
||||
break;
|
||||
}
|
||||
case NEARESTFACE:
|
||||
{
|
||||
Field<Type> allValues(nbrMesh.nFaces(), pTraits<Type>::zero);
|
||||
|
||||
const fieldType& nbrField = sampleField();
|
||||
|
||||
forAll(nbrField.boundaryField(), patchI)
|
||||
{
|
||||
const fvPatchField<Type>& pf =
|
||||
nbrField.boundaryField()[patchI];
|
||||
label faceStart = pf.patch().patch().start();
|
||||
|
||||
forAll(pf, faceI)
|
||||
{
|
||||
allValues[faceStart++] = pf[faceI];
|
||||
}
|
||||
}
|
||||
|
||||
distMap.distribute(allValues);
|
||||
|
||||
newValues.transfer(allValues);
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
FatalErrorIn("directMappedFieldFvPatchField<Type>::updateCoeffs()")
|
||||
<< "Unknown sampling mode: " << mode()
|
||||
<< nl << abort(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
if (setAverage_)
|
||||
{
|
||||
Type averagePsi =
|
||||
gSum(this->patch().magSf()*newValues)
|
||||
/gSum(this->patch().magSf());
|
||||
|
||||
if (mag(averagePsi)/mag(average_) > 0.5)
|
||||
{
|
||||
newValues *= mag(average_)/mag(averagePsi);
|
||||
}
|
||||
else
|
||||
{
|
||||
newValues += (average_ - averagePsi);
|
||||
}
|
||||
}
|
||||
|
||||
this->operator==(newValues);
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "operating on field:" << this->dimensionedInternalField().name()
|
||||
<< " patch:" << this->patch().name()
|
||||
<< " avg:" << gAverage(*this)
|
||||
<< " min:" << gMin(*this)
|
||||
<< " max:" << gMax(*this)
|
||||
<< endl;
|
||||
}
|
||||
|
||||
fixedValueFvPatchField<Type>::updateCoeffs();
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void directMappedFieldFvPatchField<Type>::write(Ostream& os) const
|
||||
{
|
||||
fvPatchField<Type>::write(os);
|
||||
directMappedPatchBase::write(os);
|
||||
os.writeKeyword("fieldName") << fieldName_ << token::END_STATEMENT << nl;
|
||||
os.writeKeyword("setAverage") << setAverage_ << token::END_STATEMENT << nl;
|
||||
os.writeKeyword("average") << average_ << token::END_STATEMENT << nl;
|
||||
this->writeEntry("value", os);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,201 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::directMappedFieldFvPatchField
|
||||
|
||||
Description
|
||||
Self-contained version of directMapped. Does not use information on
|
||||
patch, instead holds it locally (and possibly duplicate) so use
|
||||
normal directMapped in preference and only use this if you cannot
|
||||
change the underlying patch type to directMapped.
|
||||
|
||||
SourceFiles
|
||||
directMappedFieldFvPatchField.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef directMappedFieldFvPatchField_H
|
||||
#define directMappedFieldFvPatchField_H
|
||||
|
||||
#include "directMappedPatchBase.H"
|
||||
#include "fixedValueFvPatchFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class directMappedFieldFvPatchField Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class Type>
|
||||
class directMappedFieldFvPatchField
|
||||
:
|
||||
public directMappedPatchBase,
|
||||
public fixedValueFvPatchField<Type>
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Name of field to sample - defaults to field associated with this
|
||||
// patchField if not specified
|
||||
word fieldName_;
|
||||
|
||||
//- If true adjust the mapped field to maintain average value average_
|
||||
const bool setAverage_;
|
||||
|
||||
//- Average value the mapped field is adjusted to maintain if
|
||||
// setAverage_ is set true
|
||||
const Type average_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Field to sample. Either on my or nbr mesh
|
||||
const GeometricField<Type, fvPatchField, volMesh>& sampleField() const;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("directMappedField");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from patch and internal field
|
||||
directMappedFieldFvPatchField
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<Type, volMesh>&
|
||||
);
|
||||
|
||||
//- Construct from patch, internal field and dictionary
|
||||
directMappedFieldFvPatchField
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<Type, volMesh>&,
|
||||
const dictionary&
|
||||
);
|
||||
|
||||
//- Construct from patch, internal field and distance for normal type
|
||||
// sampling
|
||||
directMappedFieldFvPatchField
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<Type, volMesh>&,
|
||||
|
||||
// directMappedPatchBase
|
||||
const word& sampleRegion,
|
||||
const sampleMode sampleMode,
|
||||
const word& samplePatch,
|
||||
const scalar distance,
|
||||
|
||||
// My settings
|
||||
const word& fieldName,
|
||||
const bool setAverage,
|
||||
const Type average
|
||||
);
|
||||
|
||||
//- Construct by mapping given
|
||||
// directMappedFieldFvPatchField
|
||||
// onto a new patch
|
||||
directMappedFieldFvPatchField
|
||||
(
|
||||
const directMappedFieldFvPatchField<Type>&,
|
||||
const fvPatch&,
|
||||
const DimensionedField<Type, volMesh>&,
|
||||
const fvPatchFieldMapper&
|
||||
);
|
||||
|
||||
//- Construct as copy
|
||||
directMappedFieldFvPatchField
|
||||
(
|
||||
const directMappedFieldFvPatchField<Type>&
|
||||
);
|
||||
|
||||
//- Construct and return a clone
|
||||
virtual tmp<fvPatchField<Type> > clone() const
|
||||
{
|
||||
return tmp<fvPatchField<Type> >
|
||||
(
|
||||
new directMappedFieldFvPatchField<Type>
|
||||
(
|
||||
*this
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
//- Construct as copy setting internal field reference
|
||||
directMappedFieldFvPatchField
|
||||
(
|
||||
const directMappedFieldFvPatchField<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 directMappedFieldFvPatchField<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 "directMappedFieldFvPatchField.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -23,22 +23,21 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "heatTransferModel.H"
|
||||
#include "directMappedFieldFvPatchFields.H"
|
||||
#include "volMesh.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
inline const Foam::surfaceFilmModels::surfaceFilmModel&
|
||||
Foam::surfaceFilmModels::heatTransferModel::owner() const
|
||||
namespace Foam
|
||||
{
|
||||
return owner_;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
inline const Foam::dictionary&
|
||||
Foam::surfaceFilmModels::heatTransferModel::coeffs() const
|
||||
{
|
||||
return coeffs_;
|
||||
}
|
||||
makePatchFields(directMappedField);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -23,29 +23,27 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "injectionModel.H"
|
||||
#ifndef directMappedFieldFvPatchFields_H
|
||||
#define directMappedFieldFvPatchFields_H
|
||||
|
||||
#include "directMappedFieldFvPatchField.H"
|
||||
#include "fieldTypes.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
inline const Foam::surfaceFilmModels::surfaceFilmModel&
|
||||
Foam::surfaceFilmModels::injectionModel::owner() const
|
||||
namespace Foam
|
||||
{
|
||||
return owner_;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
inline const Foam::dictionary&
|
||||
Foam::surfaceFilmModels::injectionModel::coeffs() const
|
||||
{
|
||||
return coeffs_;
|
||||
}
|
||||
makePatchTypeFieldTypedefs(directMappedField)
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
inline Foam::scalar Foam::surfaceFilmModels::injectionModel::injectedMass()
|
||||
const
|
||||
{
|
||||
return injectedMass_;
|
||||
}
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -23,29 +23,28 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "surfaceFilmModel.H"
|
||||
#ifndef directMappedFieldFvPatchFieldsFwd_H
|
||||
#define directMappedFieldFvPatchFieldsFwd_H
|
||||
|
||||
#include "fieldTypes.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
inline const Foam::Switch&
|
||||
Foam::surfaceFilmModels::surfaceFilmModel::active() const
|
||||
namespace Foam
|
||||
{
|
||||
return active_;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
inline const Foam::dictionary&
|
||||
Foam::surfaceFilmModels::surfaceFilmModel::coeffs() const
|
||||
{
|
||||
return coeffs_;
|
||||
}
|
||||
template<class Type> class directMappedFieldFvPatchField;
|
||||
|
||||
makePatchTypeFieldTypedefs(directMappedField)
|
||||
|
||||
inline const Foam::surfaceFilmModels::surfaceFilmModel::thermoModelType&
|
||||
Foam::surfaceFilmModels::surfaceFilmModel::thermoModel() const
|
||||
{
|
||||
return thermoModel_;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -2,16 +2,16 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
OpenFOAM is 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 2 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
|
||||
@ -19,22 +19,18 @@ 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/>.
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "directMappedFixedInternalValueFvPatchField.H"
|
||||
#include "UIndirectList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
directMappedFixedInternalValueFvPatchField<Type>::
|
||||
Foam::directMappedFixedInternalValueFvPatchField<Type>::
|
||||
directMappedFixedInternalValueFvPatchField
|
||||
(
|
||||
const fvPatch& p,
|
||||
@ -46,7 +42,7 @@ directMappedFixedInternalValueFvPatchField
|
||||
|
||||
|
||||
template<class Type>
|
||||
directMappedFixedInternalValueFvPatchField<Type>::
|
||||
Foam::directMappedFixedInternalValueFvPatchField<Type>::
|
||||
directMappedFixedInternalValueFvPatchField
|
||||
(
|
||||
const directMappedFixedInternalValueFvPatchField<Type>& ptf,
|
||||
@ -60,7 +56,7 @@ directMappedFixedInternalValueFvPatchField
|
||||
|
||||
|
||||
template<class Type>
|
||||
directMappedFixedInternalValueFvPatchField<Type>::
|
||||
Foam::directMappedFixedInternalValueFvPatchField<Type>::
|
||||
directMappedFixedInternalValueFvPatchField
|
||||
(
|
||||
const fvPatch& p,
|
||||
@ -73,7 +69,7 @@ directMappedFixedInternalValueFvPatchField
|
||||
|
||||
|
||||
template<class Type>
|
||||
directMappedFixedInternalValueFvPatchField<Type>::
|
||||
Foam::directMappedFixedInternalValueFvPatchField<Type>::
|
||||
directMappedFixedInternalValueFvPatchField
|
||||
(
|
||||
const directMappedFixedInternalValueFvPatchField<Type>& ptf
|
||||
@ -84,7 +80,7 @@ directMappedFixedInternalValueFvPatchField
|
||||
|
||||
|
||||
template<class Type>
|
||||
directMappedFixedInternalValueFvPatchField<Type>::
|
||||
Foam::directMappedFixedInternalValueFvPatchField<Type>::
|
||||
directMappedFixedInternalValueFvPatchField
|
||||
(
|
||||
const directMappedFixedInternalValueFvPatchField<Type>& ptf,
|
||||
@ -98,7 +94,7 @@ directMappedFixedInternalValueFvPatchField
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
void directMappedFixedInternalValueFvPatchField<Type>::updateCoeffs()
|
||||
void Foam::directMappedFixedInternalValueFvPatchField<Type>::updateCoeffs()
|
||||
{
|
||||
typedef GeometricField<Type, fvPatchField, volMesh> FieldType;
|
||||
|
||||
@ -113,26 +109,31 @@ void directMappedFixedInternalValueFvPatchField<Type>::updateCoeffs()
|
||||
// Get the coupling information from the directMappedPatchBase
|
||||
const directMappedPatchBase& mpp =
|
||||
refCast<const directMappedPatchBase>(this->patch().patch());
|
||||
const polyMesh& nbrMesh = mpp.sampleMesh();
|
||||
const fvPatch& nbrPatch =
|
||||
refCast<const fvMesh>
|
||||
(
|
||||
nbrMesh
|
||||
).boundary()[mpp.samplePolyPatch().index()];
|
||||
const fvMesh& nbrMesh = refCast<const fvMesh>(mpp.sampleMesh());
|
||||
const label samplePatchI = mpp.samplePolyPatch().index();
|
||||
const fvPatch& nbrPatch = nbrMesh.boundary()[samplePatchI];
|
||||
|
||||
// Force recalculation of mapping and schedule
|
||||
const mapDistribute& distMap = mpp.map();
|
||||
|
||||
// Retrieve the neighbour field
|
||||
const fvPatchField<Type>& nbrField =
|
||||
nbrPatch.lookupPatchField<FieldType, Type>
|
||||
nbrPatch.template lookupPatchField<FieldType, Type>
|
||||
(
|
||||
this->dimensionedInternalField().name()
|
||||
);
|
||||
|
||||
// Retrieve the neighbour patch internal field
|
||||
Field<Type> nbrIntFld(nbrField.patchInternalField());
|
||||
distMap.distribute(nbrIntFld);
|
||||
mapDistribute::distribute
|
||||
(
|
||||
Pstream::defaultCommsType,
|
||||
distMap.schedule(),
|
||||
distMap.constructSize(),
|
||||
distMap.subMap(), // what to send
|
||||
distMap.constructMap(), // what to receive
|
||||
nbrIntFld
|
||||
);
|
||||
|
||||
// Assign (this) patch internal field to its neighbour values
|
||||
Field<Type>& intFld = const_cast<Field<Type>&>(this->internalField());
|
||||
@ -141,14 +142,13 @@ void directMappedFixedInternalValueFvPatchField<Type>::updateCoeffs()
|
||||
|
||||
|
||||
template<class Type>
|
||||
void directMappedFixedInternalValueFvPatchField<Type>::write(Ostream& os) const
|
||||
void Foam::directMappedFixedInternalValueFvPatchField<Type>::write
|
||||
(
|
||||
Ostream& os
|
||||
) const
|
||||
{
|
||||
directMappedFixedValueFvPatchField<Type>::write(os);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -2,16 +2,16 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
OpenFOAM is 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 2 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
|
||||
@ -19,7 +19,8 @@ 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/>.
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::directMappedFixedInternalValueFvPatchField
|
||||
@ -2,16 +2,16 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
OpenFOAM is 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 2 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
|
||||
@ -19,7 +19,8 @@ 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/>.
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -2,16 +2,16 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
OpenFOAM is 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 2 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
|
||||
@ -19,7 +19,8 @@ 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/>.
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -36,7 +37,7 @@ namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
makePatchTypeFieldTypedefs(directMappedFixedInternalValue);
|
||||
makePatchTypeFieldTypedefs(directMappedFixedInternalValue)
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -2,16 +2,16 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
OpenFOAM is 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 2 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
|
||||
@ -19,7 +19,8 @@ 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/>.
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -37,7 +38,7 @@ namespace Foam
|
||||
|
||||
template<class Type> class directMappedFixedInternalValueFvPatchField;
|
||||
|
||||
makePatchTypeFieldTypedefs(directMappedFixedInternalValue);
|
||||
makePatchTypeFieldTypedefs(directMappedFixedInternalValue)
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -2,16 +2,16 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
OpenFOAM is 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 2 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
|
||||
@ -19,22 +19,18 @@ 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/>.
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "directMappedFixedPushedInternalValueFvPatchField.H"
|
||||
#include "UIndirectList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
directMappedFixedPushedInternalValueFvPatchField<Type>::
|
||||
Foam::directMappedFixedPushedInternalValueFvPatchField<Type>::
|
||||
directMappedFixedPushedInternalValueFvPatchField
|
||||
(
|
||||
const fvPatch& p,
|
||||
@ -46,7 +42,7 @@ directMappedFixedPushedInternalValueFvPatchField
|
||||
|
||||
|
||||
template<class Type>
|
||||
directMappedFixedPushedInternalValueFvPatchField<Type>::
|
||||
Foam::directMappedFixedPushedInternalValueFvPatchField<Type>::
|
||||
directMappedFixedPushedInternalValueFvPatchField
|
||||
(
|
||||
const directMappedFixedPushedInternalValueFvPatchField<Type>& ptf,
|
||||
@ -60,7 +56,7 @@ directMappedFixedPushedInternalValueFvPatchField
|
||||
|
||||
|
||||
template<class Type>
|
||||
directMappedFixedPushedInternalValueFvPatchField<Type>::
|
||||
Foam::directMappedFixedPushedInternalValueFvPatchField<Type>::
|
||||
directMappedFixedPushedInternalValueFvPatchField
|
||||
(
|
||||
const fvPatch& p,
|
||||
@ -73,7 +69,7 @@ directMappedFixedPushedInternalValueFvPatchField
|
||||
|
||||
|
||||
template<class Type>
|
||||
directMappedFixedPushedInternalValueFvPatchField<Type>::
|
||||
Foam::directMappedFixedPushedInternalValueFvPatchField<Type>::
|
||||
directMappedFixedPushedInternalValueFvPatchField
|
||||
(
|
||||
const directMappedFixedPushedInternalValueFvPatchField<Type>& ptf
|
||||
@ -84,7 +80,7 @@ directMappedFixedPushedInternalValueFvPatchField
|
||||
|
||||
|
||||
template<class Type>
|
||||
directMappedFixedPushedInternalValueFvPatchField<Type>::
|
||||
Foam::directMappedFixedPushedInternalValueFvPatchField<Type>::
|
||||
directMappedFixedPushedInternalValueFvPatchField
|
||||
(
|
||||
const directMappedFixedPushedInternalValueFvPatchField<Type>& ptf,
|
||||
@ -98,7 +94,8 @@ directMappedFixedPushedInternalValueFvPatchField
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
void directMappedFixedPushedInternalValueFvPatchField<Type>::updateCoeffs()
|
||||
void
|
||||
Foam::directMappedFixedPushedInternalValueFvPatchField<Type>::updateCoeffs()
|
||||
{
|
||||
typedef GeometricField<Type, fvPatchField, volMesh> FieldType;
|
||||
|
||||
@ -117,7 +114,7 @@ void directMappedFixedPushedInternalValueFvPatchField<Type>::updateCoeffs()
|
||||
|
||||
|
||||
template<class Type>
|
||||
void directMappedFixedPushedInternalValueFvPatchField<Type>::write
|
||||
void Foam::directMappedFixedPushedInternalValueFvPatchField<Type>::write
|
||||
(
|
||||
Ostream& os
|
||||
) const
|
||||
@ -126,8 +123,4 @@ void directMappedFixedPushedInternalValueFvPatchField<Type>::write
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -2,16 +2,16 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
OpenFOAM is 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 2 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
|
||||
@ -19,7 +19,8 @@ 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/>.
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::directMappedFixedPushedInternalValueFvPatchField
|
||||
@ -2,16 +2,16 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
OpenFOAM is 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 2 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
|
||||
@ -19,7 +19,8 @@ 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/>.
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -2,16 +2,16 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
OpenFOAM is 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 2 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
|
||||
@ -19,7 +19,8 @@ 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/>.
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -36,7 +37,7 @@ namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
makePatchTypeFieldTypedefs(directMappedFixedPushedInternalValue);
|
||||
makePatchTypeFieldTypedefs(directMappedFixedPushedInternalValue)
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -2,16 +2,16 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
OpenFOAM is 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 2 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
|
||||
@ -19,7 +19,8 @@ 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/>.
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -37,7 +38,7 @@ namespace Foam
|
||||
|
||||
template<class Type> class directMappedFixedPushedInternalValueFvPatchField;
|
||||
|
||||
makePatchTypeFieldTypedefs(directMappedFixedInternalValue);
|
||||
makePatchTypeFieldTypedefs(directMappedFixedInternalValue)
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -457,12 +457,20 @@ void Foam::MULES::limiter
|
||||
tmp<volScalarField::DimensionedInternalField> V0 = mesh.Vsc0();
|
||||
|
||||
psiMaxn =
|
||||
V*((rho.field()/deltaT - Sp.field())*psiMaxn - Su.field())
|
||||
V
|
||||
*(
|
||||
(rho.field()/deltaT - Sp.field())*psiMaxn
|
||||
- Su.field()
|
||||
)
|
||||
- (V0().field()/deltaT)*rho.oldTime().field()*psi0
|
||||
+ sumPhiBD;
|
||||
|
||||
psiMinn =
|
||||
V*(Su.field() - (rho.field()/deltaT - Sp.field())*psiMinn)
|
||||
V
|
||||
*(
|
||||
Su.field()
|
||||
- (rho.field()/deltaT - Sp.field())*psiMinn
|
||||
)
|
||||
+ (V0().field()/deltaT)*rho.oldTime().field()*psi0
|
||||
- sumPhiBD;
|
||||
}
|
||||
@ -472,16 +480,17 @@ void Foam::MULES::limiter
|
||||
V
|
||||
*(
|
||||
(rho.field()/deltaT - Sp.field())*psiMaxn
|
||||
- (rho.oldTime().field()/deltaT)*psi0
|
||||
- Su.field()
|
||||
- (rho.oldTime().field()/deltaT)*psi0
|
||||
)
|
||||
+ sumPhiBD;
|
||||
|
||||
psiMinn =
|
||||
V
|
||||
*(
|
||||
(rho.field()/deltaT)*psi0
|
||||
- (rho.oldTime().field()/deltaT - Sp.field())*psiMinn + Su.field()
|
||||
Su.field()
|
||||
- (rho.field()/deltaT - Sp.field())*psiMinn
|
||||
+ (rho.oldTime().field()/deltaT)*psi0
|
||||
)
|
||||
- sumPhiBD;
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -47,7 +47,7 @@ class fvMesh;
|
||||
class polyBoundaryMesh;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class fvBoundaryMesh Declaration
|
||||
Class fvBoundaryMesh Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class fvBoundaryMesh
|
||||
@ -86,17 +86,10 @@ public:
|
||||
// Constructors
|
||||
|
||||
//- Construct with zero size
|
||||
fvBoundaryMesh
|
||||
(
|
||||
const fvMesh&
|
||||
);
|
||||
fvBoundaryMesh(const fvMesh&);
|
||||
|
||||
//- Construct from polyBoundaryMesh
|
||||
fvBoundaryMesh
|
||||
(
|
||||
const fvMesh&,
|
||||
const polyBoundaryMesh&
|
||||
);
|
||||
fvBoundaryMesh(const fvMesh&, const polyBoundaryMesh&);
|
||||
|
||||
|
||||
// Member Functions
|
||||
@ -120,6 +113,7 @@ public:
|
||||
//- Correct patches after moving points
|
||||
void movePoints();
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
//- Return const and non-const reference to fvPatch by index.
|
||||
@ -130,7 +124,6 @@ public:
|
||||
|
||||
//- Return reference to fvPatch by name.
|
||||
fvPatch& operator[](const word&);
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,111 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "pointLinear.H"
|
||||
#include "fvMesh.H"
|
||||
#include "volPointInterpolation.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh> >
|
||||
Foam::pointLinear<Type>::
|
||||
correction
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vf
|
||||
) const
|
||||
{
|
||||
const fvMesh& mesh = this->mesh();
|
||||
|
||||
GeometricField<Type, pointPatchField, pointMesh> pvf =
|
||||
volPointInterpolation::New(mesh).interpolate(vf);
|
||||
|
||||
tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > tsfCorr =
|
||||
linearInterpolate(vf);
|
||||
|
||||
Field<Type>& sfCorr = tsfCorr().internalField();
|
||||
|
||||
const pointField& points = mesh.points();
|
||||
const pointField& C = mesh.C().internalField();
|
||||
const faceList& faces = mesh.faces();
|
||||
const scalarField& w = mesh.weights().internalField();
|
||||
const labelList& owner = mesh.owner();
|
||||
const labelList& neighbour = mesh.neighbour();
|
||||
|
||||
forAll(sfCorr, facei)
|
||||
{
|
||||
point pi =
|
||||
w[owner[facei]]*C[owner[facei]]
|
||||
+ (1.0 - w[owner[facei]])*C[neighbour[facei]];
|
||||
|
||||
scalar at = triangle<point, const point&>
|
||||
(
|
||||
pi,
|
||||
points[faces[facei][0]],
|
||||
points[faces[facei][faces[facei].size()-1]]
|
||||
).mag();
|
||||
|
||||
scalar sumAt = at;
|
||||
Type sumPsip = at*(1.0/3.0)*
|
||||
(
|
||||
sfCorr[facei]
|
||||
+ pvf[faces[facei][0]]
|
||||
+ pvf[faces[facei][faces[facei].size()-1]]
|
||||
);
|
||||
|
||||
for (label pointi=1; pointi<faces[facei].size(); pointi++)
|
||||
{
|
||||
at = triangle<point, const point&>
|
||||
(
|
||||
pi,
|
||||
points[faces[facei][pointi]],
|
||||
points[faces[facei][pointi-1]]
|
||||
).mag();
|
||||
|
||||
sumAt += at;
|
||||
sumPsip += at*(1.0/3.0)*
|
||||
(
|
||||
sfCorr[facei]
|
||||
+ pvf[faces[facei][pointi]]
|
||||
+ pvf[faces[facei][pointi-1]]
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
sfCorr[facei] = sumPsip/sumAt - sfCorr[facei];
|
||||
}
|
||||
|
||||
tsfCorr().boundaryField() = pTraits<Type>::zero;
|
||||
|
||||
return tsfCorr;
|
||||
}
|
||||
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
makeSurfaceInterpolationScheme(pointLinear);
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,129 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
pointLinear
|
||||
|
||||
Description
|
||||
Face-point interpolation scheme class derived from linear and
|
||||
returns linear weighting factors but also applies an explicit correction.
|
||||
|
||||
Uses volPointInterpolation to obtain the field values at the face-points.
|
||||
|
||||
SourceFiles
|
||||
pointLinear.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef pointLinear_H
|
||||
#define pointLinear_H
|
||||
|
||||
#include "linear.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class pointLinear Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class Type>
|
||||
class pointLinear
|
||||
:
|
||||
public linear<Type>
|
||||
{
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
pointLinear(const pointLinear&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const pointLinear&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("pointLinear");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from mesh
|
||||
pointLinear(const fvMesh& mesh)
|
||||
:
|
||||
linear<Type>(mesh)
|
||||
{}
|
||||
|
||||
|
||||
//- Construct from mesh and Istream
|
||||
pointLinear
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
Istream&
|
||||
)
|
||||
:
|
||||
linear<Type>(mesh)
|
||||
{}
|
||||
|
||||
|
||||
//- Construct from mesh, faceFlux and Istream
|
||||
pointLinear
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const surfaceScalarField&,
|
||||
Istream&
|
||||
)
|
||||
:
|
||||
linear<Type>(mesh)
|
||||
{}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return true if this scheme uses an explicit correction
|
||||
virtual bool corrected() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//- Return the explicit correction to the face-interpolate
|
||||
virtual tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
|
||||
correction
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vf
|
||||
) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -18,7 +18,8 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels/compressible/LES/lnInclude \
|
||||
-I$(LIB_SRC)/surfaceFilmModels/lnInclude
|
||||
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
|
||||
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude
|
||||
|
||||
LIB_LIBS = \
|
||||
-lfiniteVolume \
|
||||
@ -36,4 +37,5 @@ LIB_LIBS = \
|
||||
-lSLGThermo \
|
||||
-lcompressibleRASModels \
|
||||
-lcompressibleLESModels \
|
||||
-lregionModels \
|
||||
-lsurfaceFilmModels
|
||||
|
||||
@ -44,8 +44,7 @@ Foam::COxidationDiffusionLimitedRate<CloudType>::COxidationDiffusionLimitedRate
|
||||
O2GlobalId_(owner.composition().globalCarrierId("O2")),
|
||||
CO2GlobalId_(owner.composition().globalCarrierId("CO2")),
|
||||
WC_(0.0),
|
||||
WO2_(0.0),
|
||||
HcCO2_(0.0)
|
||||
WO2_(0.0)
|
||||
{
|
||||
// Determine Cs ids
|
||||
label idSolid = owner.composition().idSolid();
|
||||
@ -55,7 +54,6 @@ Foam::COxidationDiffusionLimitedRate<CloudType>::COxidationDiffusionLimitedRate
|
||||
WO2_ = owner.thermo().carrier().W(O2GlobalId_);
|
||||
const scalar WCO2 = owner.thermo().carrier().W(CO2GlobalId_);
|
||||
WC_ = WCO2 - WO2_;
|
||||
HcCO2_ = owner.thermo().carrier().Hc(CO2GlobalId_);
|
||||
|
||||
if (Sb_ < 0)
|
||||
{
|
||||
@ -89,8 +87,7 @@ Foam::COxidationDiffusionLimitedRate<CloudType>::COxidationDiffusionLimitedRate
|
||||
O2GlobalId_(srm.O2GlobalId_),
|
||||
CO2GlobalId_(srm.CO2GlobalId_),
|
||||
WC_(srm.WC_),
|
||||
WO2_(srm.WO2_),
|
||||
HcCO2_(srm.HcCO2_)
|
||||
WO2_(srm.WO2_)
|
||||
{}
|
||||
|
||||
|
||||
@ -160,12 +157,12 @@ Foam::scalar Foam::COxidationDiffusionLimitedRate<CloudType>::calculate
|
||||
dMassSRCarrier[O2GlobalId_] -= dmO2;
|
||||
dMassSRCarrier[CO2GlobalId_] += dmCO2;
|
||||
|
||||
const scalar HsC = thermo.solids().properties()[CsLocalId_].Hs(T);
|
||||
const scalar HC = thermo.solids().properties()[CsLocalId_].H(T);
|
||||
const scalar HCO2 = thermo.carrier().H(CO2GlobalId_, T);
|
||||
const scalar HO2 = thermo.carrier().H(O2GlobalId_, T);
|
||||
|
||||
// Heat of reaction [J]
|
||||
// Sensible enthalpy contributions due to O2 depletion and CO2 generation
|
||||
// handled by particle transfer terms
|
||||
return dmC*HsC - dmCO2*HcCO2_;
|
||||
return dmC*HC + dmO2*HO2 - dmCO2*HCO2;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -86,9 +86,6 @@ class COxidationDiffusionLimitedRate
|
||||
//- Molecular weight of O2 [kg/kmol]
|
||||
scalar WO2_;
|
||||
|
||||
//- Chemical enthalpy of CO2 [J/kg]
|
||||
scalar HcCO2_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@ -45,8 +45,7 @@ COxidationKineticDiffusionLimitedRate
|
||||
O2GlobalId_(owner.composition().globalCarrierId("O2")),
|
||||
CO2GlobalId_(owner.composition().globalCarrierId("CO2")),
|
||||
WC_(0.0),
|
||||
WO2_(0.0),
|
||||
HcCO2_(0.0)
|
||||
WO2_(0.0)
|
||||
{
|
||||
// Determine Cs ids
|
||||
label idSolid = owner.composition().idSolid();
|
||||
@ -56,7 +55,6 @@ COxidationKineticDiffusionLimitedRate
|
||||
WO2_ = owner.thermo().carrier().W(O2GlobalId_);
|
||||
const scalar WCO2 = owner.thermo().carrier().W(CO2GlobalId_);
|
||||
WC_ = WCO2 - WO2_;
|
||||
HcCO2_ = owner.thermo().carrier().Hc(CO2GlobalId_);
|
||||
|
||||
const scalar YCloc = owner.composition().Y0(idSolid)[CsLocalId_];
|
||||
const scalar YSolidTot = owner.composition().YMixture0()[idSolid];
|
||||
@ -80,8 +78,7 @@ COxidationKineticDiffusionLimitedRate
|
||||
O2GlobalId_(srm.O2GlobalId_),
|
||||
CO2GlobalId_(srm.CO2GlobalId_),
|
||||
WC_(srm.WC_),
|
||||
WO2_(srm.WO2_),
|
||||
HcCO2_(srm.HcCO2_)
|
||||
WO2_(srm.WO2_)
|
||||
{}
|
||||
|
||||
|
||||
@ -163,12 +160,12 @@ Foam::scalar Foam::COxidationKineticDiffusionLimitedRate<CloudType>::calculate
|
||||
dMassSRCarrier[O2GlobalId_] -= dmO2;
|
||||
dMassSRCarrier[CO2GlobalId_] += dmCO2;
|
||||
|
||||
const scalar HsC = thermo.solids().properties()[CsLocalId_].Hs(T);
|
||||
const scalar HC = thermo.solids().properties()[CsLocalId_].H(T);
|
||||
const scalar HCO2 = thermo.carrier().H(CO2GlobalId_, T);
|
||||
const scalar HO2 = thermo.carrier().H(O2GlobalId_, T);
|
||||
|
||||
// Heat of reaction [J]
|
||||
// Sensible enthalpy contributions due to O2 depletion and CO2 generation
|
||||
// handled by particle transfer terms
|
||||
return dmC*HsC - dmCO2*HcCO2_;
|
||||
return dmC*HC + dmO2*HO2 - dmCO2*HCO2;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -94,9 +94,6 @@ class COxidationKineticDiffusionLimitedRate
|
||||
//- Molecular weight of O2 [kg/kmol]
|
||||
scalar WO2_;
|
||||
|
||||
//- Chemical enthalpy of CO2 [J/kg]
|
||||
scalar HcCO2_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@ -57,8 +57,7 @@ Foam::COxidationMurphyShaddix<CloudType>::COxidationMurphyShaddix
|
||||
O2GlobalId_(owner.composition().globalCarrierId("O2")),
|
||||
CO2GlobalId_(owner.composition().globalCarrierId("CO2")),
|
||||
WC_(0.0),
|
||||
WO2_(0.0),
|
||||
HcCO2_(0.0)
|
||||
WO2_(0.0)
|
||||
{
|
||||
// Determine Cs ids
|
||||
label idSolid = owner.composition().idSolid();
|
||||
@ -68,7 +67,6 @@ Foam::COxidationMurphyShaddix<CloudType>::COxidationMurphyShaddix
|
||||
WO2_ = owner.thermo().carrier().W(O2GlobalId_);
|
||||
const scalar WCO2 = owner.thermo().carrier().W(CO2GlobalId_);
|
||||
WC_ = WCO2 - WO2_;
|
||||
HcCO2_ = owner.thermo().carrier().Hc(CO2GlobalId_);
|
||||
|
||||
const scalar YCloc = owner.composition().Y0(idSolid)[CsLocalId_];
|
||||
const scalar YSolidTot = owner.composition().YMixture0()[idSolid];
|
||||
@ -95,8 +93,7 @@ Foam::COxidationMurphyShaddix<CloudType>::COxidationMurphyShaddix
|
||||
O2GlobalId_(srm.O2GlobalId_),
|
||||
CO2GlobalId_(srm.CO2GlobalId_),
|
||||
WC_(srm.WC_),
|
||||
WO2_(srm.WO2_),
|
||||
HcCO2_(srm.HcCO2_)
|
||||
WO2_(srm.WO2_)
|
||||
{}
|
||||
|
||||
|
||||
@ -223,12 +220,12 @@ Foam::scalar Foam::COxidationMurphyShaddix<CloudType>::calculate
|
||||
// Add to particle mass transfer
|
||||
dMassSolid[CsLocalId_] += dOmega*WC_;
|
||||
|
||||
const scalar HsC = thermo.solids().properties()[CsLocalId_].Hs(T);
|
||||
const scalar HC = thermo.solids().properties()[CsLocalId_].H(T);
|
||||
const scalar HCO2 = thermo.carrier().H(CO2GlobalId_, T);
|
||||
const scalar HO2 = thermo.carrier().H(O2GlobalId_, T);
|
||||
|
||||
// Heat of reaction [J]
|
||||
// Sensible enthalpy contributions due to O2 depletion and CO2 generation
|
||||
// handled by particle transfer terms
|
||||
return dOmega*(WC_*HsC - (WC_ + WO2_)*HcCO2_);
|
||||
// Heat of reaction
|
||||
return dOmega*(WC_*HC + WO2_*HO2 - (WC_ + WO2_)*HCO2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -115,9 +115,6 @@ class COxidationMurphyShaddix
|
||||
//- Molecular weight of O2 [kg/kmol]
|
||||
scalar WO2_;
|
||||
|
||||
//- Chemical enthalpy of CO2 [J/kg]
|
||||
scalar HcCO2_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@ -281,7 +281,7 @@ bool Foam::parcel::move(trackingData& td, const scalar trackTime)
|
||||
sDB.shs()[cellI] += oTotMass*(oH + oPE) - m()*(nH + nPE);
|
||||
|
||||
// Remove evaporated mass from stripped mass
|
||||
ms() -= ms()*(oTotMass-m())/oTotMass;
|
||||
ms() -= ms()*(oTotMass - m())/oTotMass;
|
||||
|
||||
// remove parcel if it is 'small'
|
||||
if (m() < 1.0e-12)
|
||||
|
||||
@ -17,7 +17,8 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels/compressible/LES/lnInclude \
|
||||
-I$(LIB_SRC)/surfaceFilmModels/lnInclude \
|
||||
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
|
||||
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicFvMesh/lnInclude
|
||||
|
||||
LIB_LIBS = \
|
||||
|
||||
@ -66,9 +66,15 @@ public:
|
||||
|
||||
// Public typedefs
|
||||
|
||||
//- Redefine particle type as parcel type
|
||||
//- Type of cloud this cloud was instantiated for
|
||||
typedef CloudType cloudType;
|
||||
|
||||
//- Type of parcel the cloud was instantiated for
|
||||
typedef typename CloudType::particleType parcelType;
|
||||
|
||||
//- Convenience typedef for this cloud type
|
||||
typedef CollidingCloud<CloudType> collidingCloudType;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
@ -116,8 +122,6 @@ protected:
|
||||
|
||||
public:
|
||||
|
||||
typedef CloudType cloudType;
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct given carrier gas fields
|
||||
|
||||
@ -99,9 +99,15 @@ public:
|
||||
|
||||
// Public typedefs
|
||||
|
||||
//- Redefine particle type as parcel type
|
||||
//- Type of cloud this cloud was instantiated for
|
||||
typedef CloudType cloudType;
|
||||
|
||||
//- Type of parcel the cloud was instantiated for
|
||||
typedef typename CloudType::particleType parcelType;
|
||||
|
||||
//- Convenience typedef for this cloud type
|
||||
typedef KinematicCloud<CloudType> kinematicCloudType;
|
||||
|
||||
//- Force type
|
||||
typedef ParticleForceList<KinematicCloud<CloudType> > forceType;
|
||||
|
||||
@ -244,8 +250,6 @@ protected:
|
||||
|
||||
public:
|
||||
|
||||
typedef CloudType cloudType;
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct given carrier gas fields
|
||||
|
||||
@ -67,8 +67,16 @@ class ReactingCloud
|
||||
{
|
||||
public:
|
||||
|
||||
//- Type of parcel the cloud was instantiated for
|
||||
typedef typename CloudType::particleType parcelType;
|
||||
// Public typedefs
|
||||
|
||||
//- Type of cloud this cloud was instantiated for
|
||||
typedef CloudType cloudType;
|
||||
|
||||
//- Type of parcel the cloud was instantiated for
|
||||
typedef typename CloudType::particleType parcelType;
|
||||
|
||||
//- Convenience typedef for this cloud type
|
||||
typedef ReactingCloud<CloudType> reactingCloudType;
|
||||
|
||||
|
||||
private:
|
||||
@ -146,8 +154,6 @@ protected:
|
||||
|
||||
public:
|
||||
|
||||
typedef CloudType cloudType;
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct given carrier gas fields
|
||||
|
||||
@ -69,8 +69,16 @@ class ReactingMultiphaseCloud
|
||||
{
|
||||
public:
|
||||
|
||||
//- Type of parcel the cloud was instantiated for
|
||||
typedef typename CloudType::particleType parcelType;
|
||||
// Public typedefs
|
||||
|
||||
//- Type of cloud this cloud was instantiated for
|
||||
typedef CloudType cloudType;
|
||||
|
||||
//- Type of parcel the cloud was instantiated for
|
||||
typedef typename CloudType::particleType parcelType;
|
||||
|
||||
//- Convenience typedef for this cloud type
|
||||
typedef ReactingMultiphaseCloud<CloudType> reactingMultiphaseCloudType;
|
||||
|
||||
|
||||
private:
|
||||
@ -141,8 +149,6 @@ protected:
|
||||
|
||||
public:
|
||||
|
||||
typedef CloudType cloudType;
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct given carrier gas fields
|
||||
|
||||
@ -65,8 +65,17 @@ class ThermoCloud
|
||||
{
|
||||
public:
|
||||
|
||||
//- Type of parcel the cloud was instantiated for
|
||||
typedef typename CloudType::particleType parcelType;
|
||||
// Public typedefs
|
||||
|
||||
//- Type of cloud this cloud was instantiated for
|
||||
typedef CloudType cloudType;
|
||||
|
||||
//- Type of parcel the cloud was instantiated for
|
||||
typedef typename CloudType::particleType parcelType;
|
||||
|
||||
//- Convenience typedef for this cloud type
|
||||
typedef ThermoCloud<CloudType> thermoCloudType;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
@ -149,8 +158,6 @@ protected:
|
||||
|
||||
public:
|
||||
|
||||
typedef CloudType cloudType;
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct given carrier gas fields
|
||||
|
||||
@ -143,7 +143,7 @@ Foam::ThermoCloud<CloudType>::Sh(volScalarField& hs) const
|
||||
|
||||
return
|
||||
hsTrans()/Vdt
|
||||
- fvm::Sp(hsCoeff()/(Cp*Vdt), hs)
|
||||
- fvm::SuSp(hsCoeff()/(Cp*Vdt), hs)
|
||||
+ hsCoeff()/(Cp*Vdt)*hs;
|
||||
}
|
||||
else
|
||||
|
||||
@ -382,16 +382,11 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
|
||||
{
|
||||
label gid = td.cloud().composition().localToGlobalCarrierId(GAS, i);
|
||||
td.cloud().rhoTrans(gid)[cellI] += np0*dMassGas[i];
|
||||
td.cloud().hsTrans()[cellI] +=
|
||||
np0*dMassGas[i]*td.cloud().composition().carrier().Hs(gid, T0);
|
||||
}
|
||||
forAll(YLiquid_, i)
|
||||
{
|
||||
label gid = td.cloud().composition().localToGlobalCarrierId(LIQ, i);
|
||||
td.cloud().rhoTrans(gid)[cellI] += np0*dMassLiquid[i];
|
||||
td.cloud().hsTrans()[cellI] +=
|
||||
np0*dMassLiquid[i]
|
||||
*td.cloud().composition().carrier().Hs(gid, T0);
|
||||
}
|
||||
/*
|
||||
// No mapping between solid components and carrier phase
|
||||
@ -399,17 +394,11 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
|
||||
{
|
||||
label gid = td.cloud().composition().localToGlobalCarrierId(SLD, i);
|
||||
td.cloud().rhoTrans(gid)[cellI] += np0*dMassSolid[i];
|
||||
td.cloud().hsTrans()[cellI] +=
|
||||
np0*dMassSolid[i]
|
||||
*td.cloud().composition().carrier().Hs(gid, T0);
|
||||
}
|
||||
*/
|
||||
forAll(dMassSRCarrier, i)
|
||||
{
|
||||
td.cloud().rhoTrans(i)[cellI] += np0*dMassSRCarrier[i];
|
||||
td.cloud().hsTrans()[cellI] +=
|
||||
np0*dMassSRCarrier[i]
|
||||
*td.cloud().composition().carrier().Hs(i, T0);
|
||||
}
|
||||
|
||||
// Update momentum transfer
|
||||
|
||||
@ -391,8 +391,6 @@ void Foam::ReactingParcel<ParcelType>::calc
|
||||
{
|
||||
label gid = td.cloud().composition().localToGlobalCarrierId(0, i);
|
||||
td.cloud().rhoTrans(gid)[cellI] += np0*dMassPC[i];
|
||||
td.cloud().hsTrans()[cellI] +=
|
||||
np0*dMassPC[i]*td.cloud().composition().carrier().Hs(gid, T0);
|
||||
}
|
||||
|
||||
// Update momentum transfer
|
||||
|
||||
@ -28,6 +28,7 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "CellZoneInjection.H"
|
||||
#include "ConeInjection.H"
|
||||
#include "FieldActivatedInjection.H"
|
||||
#include "InflationInjection.H"
|
||||
@ -43,6 +44,7 @@ License
|
||||
\
|
||||
makeInjectionModel(CloudType); \
|
||||
\
|
||||
makeInjectionModelType(CellZoneInjection, CloudType); \
|
||||
makeInjectionModelType(ConeInjection, CloudType); \
|
||||
makeInjectionModelType(FieldActivatedInjection, CloudType); \
|
||||
makeInjectionModelType(InflationInjection, CloudType); \
|
||||
|
||||
@ -28,6 +28,7 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "CellZoneInjection.H"
|
||||
#include "ConeInjection.H"
|
||||
#include "FieldActivatedInjection.H"
|
||||
#include "ManualInjection.H"
|
||||
@ -40,6 +41,7 @@ License
|
||||
#define makeReactingMultiphaseParcelInjectionModels(CloudType) \
|
||||
\
|
||||
makeInjectionModel(CloudType); \
|
||||
makeInjectionModelType(CellZoneInjection, CloudType); \
|
||||
makeInjectionModelType(ConeInjection, CloudType); \
|
||||
makeInjectionModelType(FieldActivatedInjection, CloudType); \
|
||||
makeInjectionModelType(ManualInjection, CloudType); \
|
||||
|
||||
@ -28,6 +28,7 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "CellZoneInjection.H"
|
||||
#include "ConeInjection.H"
|
||||
#include "FieldActivatedInjection.H"
|
||||
#include "ManualInjection.H"
|
||||
@ -40,6 +41,7 @@ License
|
||||
#define makeReactingParcelInjectionModels(CloudType) \
|
||||
\
|
||||
makeInjectionModel(CloudType); \
|
||||
makeInjectionModelType(CellZoneInjection, CloudType); \
|
||||
makeInjectionModelType(ConeInjection, CloudType); \
|
||||
makeInjectionModelType(FieldActivatedInjection, CloudType); \
|
||||
makeInjectionModelType(ManualInjection, CloudType); \
|
||||
|
||||
@ -0,0 +1,369 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "CellZoneInjection.H"
|
||||
#include "mathematicalConstants.H"
|
||||
#include "polyMeshTetDecomposition.H"
|
||||
#include "globalIndex.H"
|
||||
#include "Pstream.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::CellZoneInjection<CloudType>::setPositions
|
||||
(
|
||||
const labelList& cellZoneCells
|
||||
)
|
||||
{
|
||||
const fvMesh& mesh = this->owner().mesh();
|
||||
const scalarField& V = mesh.V();
|
||||
const label nCells = cellZoneCells.size();
|
||||
cachedRandom& rnd = this->owner().rndGen();
|
||||
|
||||
DynamicList<vector> positions(nCells); // initial size only
|
||||
DynamicList<label> injectorCells(nCells); // initial size only
|
||||
DynamicList<label> injectorTetFaces(nCells); // initial size only
|
||||
DynamicList<label> injectorTetPts(nCells); // initial size only
|
||||
|
||||
scalar newParticlesTotal = 0.0;
|
||||
label addParticlesTotal = 0;
|
||||
|
||||
forAll(cellZoneCells, i)
|
||||
{
|
||||
const label cellI = cellZoneCells[i];
|
||||
|
||||
// Calc number of particles to add
|
||||
const scalar newParticles = V[cellI]*numberDensity_;
|
||||
newParticlesTotal += newParticles;
|
||||
label addParticles = floor(newParticles);
|
||||
addParticlesTotal += addParticles;
|
||||
|
||||
const scalar diff = newParticlesTotal - addParticlesTotal;
|
||||
if (diff > 1)
|
||||
{
|
||||
label corr = floor(diff);
|
||||
addParticles += corr;
|
||||
addParticlesTotal += corr;
|
||||
}
|
||||
|
||||
// Construct cell tet indices
|
||||
const List<tetIndices> cellTetIs =
|
||||
polyMeshTetDecomposition::cellTetIndices(mesh, cellI);
|
||||
|
||||
// Construct cell tet volume fractions
|
||||
scalarList cTetVFrac(cellTetIs.size(), 0.0);
|
||||
for (label tetI = 1; tetI < cellTetIs.size() - 1; tetI++)
|
||||
{
|
||||
cTetVFrac[tetI] =
|
||||
(cTetVFrac[tetI-1] + cellTetIs[tetI].tet(mesh).mag())/V[cellI];
|
||||
}
|
||||
cTetVFrac.last() = 1.0;
|
||||
|
||||
// Set new particle position and cellId
|
||||
for (label pI = 0; pI < addParticles; pI++)
|
||||
{
|
||||
const scalar volFrac = rnd.sample01<scalar>();
|
||||
label tetI = 0;
|
||||
forAll(cTetVFrac, vfI)
|
||||
{
|
||||
if (cTetVFrac[vfI] > volFrac)
|
||||
{
|
||||
tetI = vfI;
|
||||
break;
|
||||
}
|
||||
}
|
||||
positions.append(cellTetIs[tetI].tet(mesh).randomPoint(rnd));
|
||||
|
||||
injectorCells.append(cellI);
|
||||
injectorTetFaces.append(cellTetIs[tetI].face());
|
||||
injectorTetPts.append(cellTetIs[tetI].faceBasePt());
|
||||
}
|
||||
}
|
||||
|
||||
// Parallel operation manipulations
|
||||
globalIndex globalPositions(positions.size());
|
||||
List<vector> allPositions(globalPositions.size(), point::max);
|
||||
List<label> allInjectorCells(globalPositions.size(), -1);
|
||||
List<label> allInjectorTetFaces(globalPositions.size(), -1);
|
||||
List<label> allInjectorTetPts(globalPositions.size(), -1);
|
||||
|
||||
// Gather all positions on to all processors
|
||||
SubList<vector>
|
||||
(
|
||||
allPositions,
|
||||
globalPositions.localSize(Pstream::myProcNo()),
|
||||
globalPositions.offset(Pstream::myProcNo())
|
||||
).assign(positions);
|
||||
|
||||
Pstream::listCombineGather(allPositions, minEqOp<point>());
|
||||
Pstream::listCombineScatter(allPositions);
|
||||
|
||||
// Gather local cell tet and tet-point Ids, but leave non-local ids set -1
|
||||
SubList<label>
|
||||
(
|
||||
allInjectorCells,
|
||||
globalPositions.localSize(Pstream::myProcNo()),
|
||||
globalPositions.offset(Pstream::myProcNo())
|
||||
).assign(injectorCells);
|
||||
SubList<label>
|
||||
(
|
||||
allInjectorTetFaces,
|
||||
globalPositions.localSize(Pstream::myProcNo()),
|
||||
globalPositions.offset(Pstream::myProcNo())
|
||||
).assign(injectorTetFaces);
|
||||
SubList<label>
|
||||
(
|
||||
allInjectorTetPts,
|
||||
globalPositions.localSize(Pstream::myProcNo()),
|
||||
globalPositions.offset(Pstream::myProcNo())
|
||||
).assign(injectorTetPts);
|
||||
|
||||
// Transfer data
|
||||
positions_.transfer(allPositions);
|
||||
injectorCells_.transfer(allInjectorCells);
|
||||
injectorTetFaces_.transfer(allInjectorTetFaces);
|
||||
injectorTetPts_.transfer(allInjectorTetPts);
|
||||
|
||||
|
||||
if (debug)
|
||||
{
|
||||
OFstream points("points.obj");
|
||||
forAll(positions_, i)
|
||||
{
|
||||
meshTools::writeOBJ(points, positions_[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
Foam::label Foam::CellZoneInjection<CloudType>::parcelsToInject
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
)
|
||||
{
|
||||
if ((0.0 >= time0) && (0.0 < time1))
|
||||
{
|
||||
return positions_.size();
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
Foam::scalar Foam::CellZoneInjection<CloudType>::volumeToInject
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
)
|
||||
{
|
||||
// All parcels introduced at SOI
|
||||
if ((0.0 >= time0) && (0.0 < time1))
|
||||
{
|
||||
return this->volumeTotal_;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
Foam::CellZoneInjection<CloudType>::CellZoneInjection
|
||||
(
|
||||
const dictionary& dict,
|
||||
CloudType& owner
|
||||
)
|
||||
:
|
||||
InjectionModel<CloudType>(dict, owner, typeName),
|
||||
cellZoneName_(this->coeffDict().lookup("cellZone")),
|
||||
numberDensity_(readScalar(this->coeffDict().lookup("numberDensity"))),
|
||||
positions_(),
|
||||
injectorCells_(),
|
||||
injectorTetFaces_(),
|
||||
injectorTetPts_(),
|
||||
diameters_(),
|
||||
U0_(this->coeffDict().lookup("U0")),
|
||||
sizeDistribution_
|
||||
(
|
||||
distributionModels::distributionModel::New
|
||||
(
|
||||
this->coeffDict().subDict("sizeDistribution"), owner.rndGen()
|
||||
)
|
||||
)
|
||||
{
|
||||
const fvMesh& mesh = owner.mesh();
|
||||
const label zoneI = mesh.cellZones().findZoneID(cellZoneName_);
|
||||
|
||||
if (zoneI < 0)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"Foam::CellZoneInjection<CloudType>::CellZoneInjection"
|
||||
"("
|
||||
"const dictionary&, "
|
||||
"CloudType&"
|
||||
")"
|
||||
) << "Unknown cell zone name: " << cellZoneName_
|
||||
<< ". Valid cell zones are: " << mesh.cellZones().names()
|
||||
<< nl << exit(FatalError);
|
||||
}
|
||||
|
||||
const labelList& cellZoneCells = mesh.cellZones()[zoneI];
|
||||
const label nCells = cellZoneCells.size();
|
||||
const scalar nCellsTotal = returnReduce(nCells, sumOp<label>());
|
||||
const scalar VCells = sum(scalarField(mesh.V(), cellZoneCells));
|
||||
const scalar VCellsTotal = returnReduce(VCells, sumOp<scalar>());
|
||||
Info<< " cell zone size = " << nCellsTotal << endl;
|
||||
Info<< " cell zone volume = " << VCellsTotal << endl;
|
||||
|
||||
if ((nCells == 0) || (VCellsTotal*numberDensity_ < 1))
|
||||
{
|
||||
WarningIn
|
||||
(
|
||||
"Foam::CellZoneInjection<CloudType>::CellZoneInjection"
|
||||
"("
|
||||
"const dictionary&, "
|
||||
"CloudType&"
|
||||
")"
|
||||
) << "Number of particles to be added to cellZone " << cellZoneName_
|
||||
<< " is zero" << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
setPositions(cellZoneCells);
|
||||
|
||||
Info<< " number density = " << numberDensity_ << nl
|
||||
<< " number of particles = " << positions_.size() << endl;
|
||||
|
||||
// Construct parcel diameters
|
||||
diameters_.setSize(positions_.size());
|
||||
forAll(diameters_, i)
|
||||
{
|
||||
diameters_[i] = sizeDistribution_->sample();
|
||||
}
|
||||
}
|
||||
|
||||
// Determine volume of particles to inject
|
||||
this->volumeTotal_ = sum(pow3(diameters_))*constant::mathematical::pi/6.0;
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
Foam::CellZoneInjection<CloudType>::CellZoneInjection
|
||||
(
|
||||
const CellZoneInjection<CloudType>& im
|
||||
)
|
||||
:
|
||||
InjectionModel<CloudType>(im),
|
||||
cellZoneName_(im.cellZoneName_),
|
||||
numberDensity_(im.numberDensity_),
|
||||
positions_(im.positions_),
|
||||
injectorCells_(im.injectorCells_),
|
||||
injectorTetFaces_(im.injectorTetFaces_),
|
||||
injectorTetPts_(im.injectorTetPts_),
|
||||
diameters_(im.diameters_),
|
||||
U0_(im.U0_),
|
||||
sizeDistribution_(im.sizeDistribution_().clone().ptr())
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
Foam::CellZoneInjection<CloudType>::~CellZoneInjection()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
Foam::scalar Foam::CellZoneInjection<CloudType>::timeEnd() const
|
||||
{
|
||||
// Not used
|
||||
return this->SOI_;
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::CellZoneInjection<CloudType>::setPositionAndCell
|
||||
(
|
||||
const label parcelI,
|
||||
const label nParcels,
|
||||
const scalar time,
|
||||
vector& position,
|
||||
label& cellOwner,
|
||||
label& tetFaceI,
|
||||
label& tetPtI
|
||||
)
|
||||
{
|
||||
position = positions_[parcelI];
|
||||
cellOwner = injectorCells_[parcelI];
|
||||
tetFaceI = injectorTetFaces_[parcelI];
|
||||
tetPtI = injectorTetPts_[parcelI];
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::CellZoneInjection<CloudType>::setProperties
|
||||
(
|
||||
const label parcelI,
|
||||
const label,
|
||||
const scalar,
|
||||
typename CloudType::parcelType& parcel
|
||||
)
|
||||
{
|
||||
// set particle velocity
|
||||
parcel.U() = U0_;
|
||||
|
||||
// set particle diameter
|
||||
parcel.d() = diameters_[parcelI];
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
bool Foam::CellZoneInjection<CloudType>::fullyDescribed() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
bool Foam::CellZoneInjection<CloudType>::validInjection(const label)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,197 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::CellZoneInjection
|
||||
|
||||
Description
|
||||
Injection positions specified by a particle number density within a cell set
|
||||
|
||||
- User specifies
|
||||
- Number density of particles in cell set (effective)
|
||||
- Total mass to inject
|
||||
- Initial parcel velocity
|
||||
- Parcel diameters obtained by PDF model
|
||||
- All parcels introduced at SOI
|
||||
|
||||
SourceFiles
|
||||
CellZoneInjection.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef CellZoneInjection_H
|
||||
#define CellZoneInjection_H
|
||||
|
||||
#include "InjectionModel.H"
|
||||
#include "distributionModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class CellZoneInjection Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class CloudType>
|
||||
class CellZoneInjection
|
||||
:
|
||||
public InjectionModel<CloudType>
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Name of cell zone
|
||||
const word& cellZoneName_;
|
||||
|
||||
//- Number density
|
||||
const scalar numberDensity_;
|
||||
|
||||
//- Field of parcel positions
|
||||
List<vector> positions_;
|
||||
|
||||
//- List of cell labels corresponding to injector positions
|
||||
labelList injectorCells_;
|
||||
|
||||
//- List of tetFace labels corresponding to injector positions
|
||||
labelList injectorTetFaces_;
|
||||
|
||||
//- List of tetPt labels corresponding to injector positions
|
||||
labelList injectorTetPts_;
|
||||
|
||||
//- Field of parcel diameters
|
||||
scalarList diameters_;
|
||||
|
||||
//- Initial parcel velocity
|
||||
const vector U0_;
|
||||
|
||||
//- Parcel size distribution model
|
||||
const autoPtr<distributionModels::distributionModel> sizeDistribution_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Set the parcel injection positions
|
||||
void setPositions(const labelList& cellZoneCells);
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// Protected member functions
|
||||
|
||||
//- Number of parcels to introduce over the time step relative to SOI
|
||||
label parcelsToInject
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
);
|
||||
|
||||
//- Volume of parcels to introduce over the time step relative to SOI
|
||||
scalar volumeToInject
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("cellZoneInjection");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from dictionary
|
||||
CellZoneInjection(const dictionary& dict, CloudType& owner);
|
||||
|
||||
//- Construct copy
|
||||
CellZoneInjection(const CellZoneInjection<CloudType>& im);
|
||||
|
||||
//- Construct and return a clone
|
||||
virtual autoPtr<InjectionModel<CloudType> > clone() const
|
||||
{
|
||||
return autoPtr<InjectionModel<CloudType> >
|
||||
(
|
||||
new CellZoneInjection<CloudType>(*this)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~CellZoneInjection();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the end-of-injection time
|
||||
scalar timeEnd() const;
|
||||
|
||||
|
||||
// Injection geometry
|
||||
|
||||
//- Set the injection position and owner cell, tetFace and tetPt
|
||||
virtual void setPositionAndCell
|
||||
(
|
||||
const label parcelI,
|
||||
const label nParcels,
|
||||
const scalar time,
|
||||
vector& position,
|
||||
label& cellOwner,
|
||||
label& tetFaceI,
|
||||
label& tetPtI
|
||||
);
|
||||
|
||||
//- Set the parcel properties
|
||||
virtual void setProperties
|
||||
(
|
||||
const label parcelI,
|
||||
const label nParcels,
|
||||
const scalar time,
|
||||
typename CloudType::parcelType& parcel
|
||||
);
|
||||
|
||||
//- Flag to identify whether model fully describes the parcel
|
||||
virtual bool fullyDescribed() const;
|
||||
|
||||
//- Return flag to identify whether or not injection of parcelI is
|
||||
// permitted
|
||||
virtual bool validInjection(const label parcelI);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "CellZoneInjection.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -32,7 +32,7 @@ Description
|
||||
- number of parcels to inject per injector
|
||||
- parcel velocities
|
||||
- inner and outer cone angles
|
||||
- Parcel diameters obtained by distribution model model
|
||||
- Parcel diameters obtained by distribution model
|
||||
|
||||
SourceFiles
|
||||
ConeInjection.C
|
||||
@ -97,7 +97,7 @@ class ConeInjection
|
||||
//- Outer cone angle relative to SOI [deg]
|
||||
const autoPtr<DataEntry<scalar> > thetaOuter_;
|
||||
|
||||
//- Parcel size distribution model model
|
||||
//- Parcel size distribution model
|
||||
const autoPtr<distributionModels::distributionModel> sizeDistribution_;
|
||||
|
||||
//- Number of parcels per injector already injected
|
||||
|
||||
@ -110,7 +110,7 @@ class FieldActivatedInjection
|
||||
//- List of parcel diameters
|
||||
scalarList diameters_;
|
||||
|
||||
//- Parcel size distribution model model
|
||||
//- Parcel size distribution model
|
||||
const autoPtr<distributionModels::distributionModel>
|
||||
sizeDistribution_;
|
||||
|
||||
|
||||
@ -107,7 +107,7 @@ class InflationInjection
|
||||
//- Diameter with which to create new seed particles
|
||||
scalar dSeed_;
|
||||
|
||||
//- Parcel size distribution model model
|
||||
//- Parcel size distribution model
|
||||
const autoPtr<distributionModels::distributionModel> sizeDistribution_;
|
||||
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ Description
|
||||
- Total mass to inject
|
||||
- Parcel positions in file \c positionsFile
|
||||
- Initial parcel velocity
|
||||
- Parcel diameters obtained by distribution model model
|
||||
- Parcel diameters obtained by distribution model
|
||||
- All parcels introduced at SOI
|
||||
|
||||
SourceFiles
|
||||
@ -81,7 +81,7 @@ class ManualInjection
|
||||
//- Initial parcel velocity
|
||||
const vector U0_;
|
||||
|
||||
//- Parcel size distribution model model
|
||||
//- Parcel size distribution model
|
||||
const autoPtr<distributionModels::distributionModel> sizeDistribution_;
|
||||
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@ Description
|
||||
- Injection duration
|
||||
- Initial parcel velocity
|
||||
- Injection volume flow rate
|
||||
- Parcel diameters obtained by distribution model model
|
||||
- Parcel diameters obtained by distribution model
|
||||
- Parcels injected at cell centres adjacent to patch
|
||||
|
||||
SourceFiles
|
||||
@ -84,7 +84,7 @@ class PatchInjection
|
||||
//- Flow rate profile relative to SOI []
|
||||
const autoPtr<DataEntry<scalar> > flowRateProfile_;
|
||||
|
||||
//- Parcel size distribution model model
|
||||
//- Parcel size distribution model
|
||||
const autoPtr<distributionModels::distributionModel> sizeDistribution_;
|
||||
|
||||
//- List of cell labels corresponding to injector positions
|
||||
|
||||
@ -24,8 +24,8 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "SurfaceFilmModel.H"
|
||||
#include "mathematicalConstants.H"
|
||||
#include "surfaceFilmModel.H"
|
||||
#include "mathematicalConstants.H"
|
||||
#include "directMappedWallPolyPatch.H"
|
||||
|
||||
using namespace Foam::constant;
|
||||
@ -133,29 +133,34 @@ void Foam::SurfaceFilmModel<CloudType>::inject(TrackData& td)
|
||||
}
|
||||
|
||||
// Retrieve the film model from the owner database
|
||||
const surfaceFilmModels::surfaceFilmModel& filmModel =
|
||||
const regionModels::surfaceFilmModels::surfaceFilmModel& filmModel =
|
||||
this->owner().db().objectRegistry::template lookupObject
|
||||
<surfaceFilmModels::surfaceFilmModel>
|
||||
<regionModels::surfaceFilmModels::surfaceFilmModel>
|
||||
(
|
||||
"surfaceFilmProperties"
|
||||
);
|
||||
|
||||
const labelList& filmPatches = filmModel.filmBottomPatchIDs();
|
||||
if (!filmModel.active())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const labelList& filmPatches = filmModel.intCoupledPatchIDs();
|
||||
const labelList& primaryPatches = filmModel.primaryPatchIDs();
|
||||
|
||||
const polyBoundaryMesh& pbm = this->owner().mesh().boundaryMesh();
|
||||
|
||||
forAll(filmPatches, i)
|
||||
{
|
||||
const label primaryPatchI = primaryPatches[i];
|
||||
const directMappedWallPolyPatch& wpp =
|
||||
refCast<const directMappedWallPolyPatch>
|
||||
(
|
||||
this->owner().mesh().boundaryMesh()[primaryPatchI]
|
||||
);
|
||||
|
||||
const labelList& injectorCellsPatch = wpp.faceCells();
|
||||
|
||||
const label filmPatchI = filmPatches[i];
|
||||
const mapDistribute& distMap = wpp.map();
|
||||
const label primaryPatchI = primaryPatches[i];
|
||||
|
||||
const directMappedPatchBase& mapPatch =
|
||||
filmModel.mappedPatches()[filmPatchI];
|
||||
const mapDistribute& distMap = mapPatch.map();
|
||||
|
||||
const labelList& injectorCellsPatch = pbm[primaryPatchI].faceCells();
|
||||
|
||||
cacheFilmFields(filmPatchI, primaryPatchI, distMap, filmModel);
|
||||
|
||||
forAll(injectorCellsPatch, j)
|
||||
@ -209,7 +214,7 @@ void Foam::SurfaceFilmModel<CloudType>::cacheFilmFields
|
||||
const label filmPatchI,
|
||||
const label primaryPatchI,
|
||||
const mapDistribute& distMap,
|
||||
const surfaceFilmModels::surfaceFilmModel& filmModel
|
||||
const regionModels::surfaceFilmModels::surfaceFilmModel& filmModel
|
||||
)
|
||||
{
|
||||
massParcelPatch_ = filmModel.massForPrimary().boundaryField()[filmPatchI];
|
||||
|
||||
@ -47,9 +47,12 @@ namespace Foam
|
||||
{
|
||||
|
||||
// Forward declaration of classes
|
||||
namespace surfaceFilmModels
|
||||
namespace regionModels
|
||||
{
|
||||
class surfaceFilmModel;
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
class surfaceFilmModel;
|
||||
}
|
||||
}
|
||||
|
||||
class mapDistribute;
|
||||
@ -114,7 +117,7 @@ protected:
|
||||
const label filmPatchI,
|
||||
const label primaryPatchI,
|
||||
const mapDistribute& distMap,
|
||||
const surfaceFilmModels::surfaceFilmModel& filmModel
|
||||
const regionModels::surfaceFilmModels::surfaceFilmModel& filmModel
|
||||
);
|
||||
|
||||
//- Set the individual parcel properties
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -90,6 +90,9 @@ public:
|
||||
//- Destructor
|
||||
virtual ~SubModelBase();
|
||||
|
||||
//- Type of cloud this model was instantiated for
|
||||
typedef CloudType cloudType;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
|
||||
@ -141,7 +141,7 @@ Foam::vector Foam::ThermoSurfaceFilm<CloudType>::splashDirection
|
||||
template<class CloudType>
|
||||
void Foam::ThermoSurfaceFilm<CloudType>::absorbInteraction
|
||||
(
|
||||
surfaceFilmModels::surfaceFilmModel& filmModel,
|
||||
regionModels::surfaceFilmModels::surfaceFilmModel& filmModel,
|
||||
const parcelType& p,
|
||||
const polyPatch& pp,
|
||||
const label faceI,
|
||||
@ -218,7 +218,7 @@ void Foam::ThermoSurfaceFilm<CloudType>::bounceInteraction
|
||||
template<class CloudType>
|
||||
void Foam::ThermoSurfaceFilm<CloudType>::drySplashInteraction
|
||||
(
|
||||
surfaceFilmModels::surfaceFilmModel& filmModel,
|
||||
regionModels::surfaceFilmModels::surfaceFilmModel& filmModel,
|
||||
const parcelType& p,
|
||||
const polyPatch& pp,
|
||||
const label faceI,
|
||||
@ -274,7 +274,7 @@ void Foam::ThermoSurfaceFilm<CloudType>::drySplashInteraction
|
||||
template<class CloudType>
|
||||
void Foam::ThermoSurfaceFilm<CloudType>::wetSplashInteraction
|
||||
(
|
||||
surfaceFilmModels::surfaceFilmModel& filmModel,
|
||||
regionModels::surfaceFilmModels::surfaceFilmModel& filmModel,
|
||||
parcelType& p,
|
||||
const polyPatch& pp,
|
||||
const label faceI,
|
||||
@ -331,6 +331,7 @@ void Foam::ThermoSurfaceFilm<CloudType>::wetSplashInteraction
|
||||
U = -epsilon*(Un) + 5/7*(Ut);
|
||||
|
||||
keepParticle = true;
|
||||
return;
|
||||
}
|
||||
else if ((We >= 20) && (We < Wec)) // spread - assume absorb
|
||||
{
|
||||
@ -350,7 +351,7 @@ void Foam::ThermoSurfaceFilm<CloudType>::wetSplashInteraction
|
||||
template<class CloudType>
|
||||
void Foam::ThermoSurfaceFilm<CloudType>::splashInteraction
|
||||
(
|
||||
surfaceFilmModels::surfaceFilmModel& filmModel,
|
||||
regionModels::surfaceFilmModels::surfaceFilmModel& filmModel,
|
||||
const parcelType& p,
|
||||
const polyPatch& pp,
|
||||
const label faceI,
|
||||
@ -390,8 +391,8 @@ void Foam::ThermoSurfaceFilm<CloudType>::splashInteraction
|
||||
const scalar dBarSplash = 1/cbrt(6.0)*cbrt(mRatio/Ns)*d + ROOTVSMALL;
|
||||
|
||||
// cumulative diameter splash distribution
|
||||
const scalar dMin = 0.01*d;
|
||||
const scalar dMax = d;
|
||||
const scalar dMax = cbrt(mRatio)*d;
|
||||
const scalar dMin = 0.001*dMax;
|
||||
const scalar K = exp(-dMin/dBarSplash) - exp(-dMax/dBarSplash);
|
||||
|
||||
// surface energy of secondary parcels [J]
|
||||
@ -567,11 +568,11 @@ bool Foam::ThermoSurfaceFilm<CloudType>::transferParcel
|
||||
)
|
||||
{
|
||||
// Retrieve the film model from the owner database
|
||||
surfaceFilmModels::surfaceFilmModel& filmModel =
|
||||
const_cast<surfaceFilmModels::surfaceFilmModel&>
|
||||
regionModels::surfaceFilmModels::surfaceFilmModel& filmModel =
|
||||
const_cast<regionModels::surfaceFilmModels::surfaceFilmModel&>
|
||||
(
|
||||
this->owner().db().objectRegistry::template
|
||||
lookupObject<surfaceFilmModels::surfaceFilmModel>
|
||||
lookupObject<regionModels::surfaceFilmModels::surfaceFilmModel>
|
||||
(
|
||||
"surfaceFilmProperties"
|
||||
)
|
||||
@ -579,7 +580,7 @@ bool Foam::ThermoSurfaceFilm<CloudType>::transferParcel
|
||||
|
||||
const label patchI = pp.index();
|
||||
|
||||
if (filmModel.isFilmPatch(patchI))
|
||||
if (filmModel.isRegionPatch(patchI))
|
||||
{
|
||||
const label faceI = pp.whichFace(p.face());
|
||||
|
||||
@ -627,10 +628,11 @@ bool Foam::ThermoSurfaceFilm<CloudType>::transferParcel
|
||||
}
|
||||
}
|
||||
|
||||
// transfer parcel/parcel interactions complete
|
||||
return true;
|
||||
}
|
||||
|
||||
// do not transfer parcel
|
||||
// parcel not interacting with film
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -641,7 +643,7 @@ void Foam::ThermoSurfaceFilm<CloudType>::cacheFilmFields
|
||||
const label filmPatchI,
|
||||
const label primaryPatchI,
|
||||
const mapDistribute& distMap,
|
||||
const surfaceFilmModels::surfaceFilmModel& filmModel
|
||||
const regionModels::surfaceFilmModels::surfaceFilmModel& filmModel
|
||||
)
|
||||
{
|
||||
SurfaceFilmModel<CloudType>::cacheFilmFields
|
||||
|
||||
@ -104,7 +104,7 @@ protected:
|
||||
const SLGThermo& thermo_;
|
||||
|
||||
|
||||
// Cached injector fields per film patch
|
||||
// Cached injector fields per film patch
|
||||
|
||||
//- Film temperature / patch face
|
||||
scalarList TFilmPatch_;
|
||||
@ -168,7 +168,7 @@ protected:
|
||||
//- Absorb parcel into film
|
||||
void absorbInteraction
|
||||
(
|
||||
surfaceFilmModels::surfaceFilmModel& filmModel,
|
||||
regionModels::surfaceFilmModels::surfaceFilmModel& filmModel,
|
||||
const parcelType& p,
|
||||
const polyPatch& pp,
|
||||
const label faceI,
|
||||
@ -188,7 +188,7 @@ protected:
|
||||
//- Parcel interaction with dry surface
|
||||
void drySplashInteraction
|
||||
(
|
||||
surfaceFilmModels::surfaceFilmModel& filmModel,
|
||||
regionModels::surfaceFilmModels::surfaceFilmModel& filmModel,
|
||||
const parcelType& p,
|
||||
const polyPatch& pp,
|
||||
const label faceI,
|
||||
@ -198,7 +198,7 @@ protected:
|
||||
//- Parcel interaction with wetted surface
|
||||
void wetSplashInteraction
|
||||
(
|
||||
surfaceFilmModels::surfaceFilmModel& filmModel,
|
||||
regionModels::surfaceFilmModels::surfaceFilmModel& filmModel,
|
||||
parcelType& p,
|
||||
const polyPatch& pp,
|
||||
const label faceI,
|
||||
@ -208,7 +208,7 @@ protected:
|
||||
//- Bai parcel splash interaction model
|
||||
void splashInteraction
|
||||
(
|
||||
surfaceFilmModels::surfaceFilmModel& filmModel,
|
||||
regionModels::surfaceFilmModels::surfaceFilmModel& filmModel,
|
||||
const parcelType& p,
|
||||
const polyPatch& pp,
|
||||
const label faceI,
|
||||
@ -228,7 +228,8 @@ protected:
|
||||
const label filmPatchI,
|
||||
const label primaryPatchI,
|
||||
const mapDistribute& distMap,
|
||||
const surfaceFilmModels::surfaceFilmModel& filmModel
|
||||
const regionModels::surfaceFilmModels::surfaceFilmModel&
|
||||
filmModel
|
||||
);
|
||||
|
||||
//- Set the individual parcel properties
|
||||
@ -247,7 +248,7 @@ public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
//- Construct from components
|
||||
ThermoSurfaceFilm
|
||||
(
|
||||
const dictionary& dict,
|
||||
|
||||
11
src/regionModels/Allwmake
Executable file
11
src/regionModels/Allwmake
Executable file
@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # run from this directory
|
||||
set -x
|
||||
|
||||
wmake libso regionModel
|
||||
#wmake libso pyrolysisModels
|
||||
wmake libso surfaceFilmModels
|
||||
#wmake libso regionCoupling
|
||||
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
7
src/regionModels/regionModel/Make/files
Normal file
7
src/regionModels/regionModel/Make/files
Normal file
@ -0,0 +1,7 @@
|
||||
/* Region models */
|
||||
regionModel/regionModel.C
|
||||
singleLayerRegion/singleLayerRegion.C
|
||||
regionModel1D/regionModel1D.C
|
||||
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libregionModels
|
||||
7
src/regionModels/regionModel/Make/options
Normal file
7
src/regionModels/regionModel/Make/options
Normal file
@ -0,0 +1,7 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools
|
||||
283
src/regionModels/regionModel/regionModel/regionModel.C
Normal file
283
src/regionModels/regionModel/regionModel/regionModel.C
Normal file
@ -0,0 +1,283 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "regionModel.H"
|
||||
#include "fvMesh.H"
|
||||
#include "Time.H"
|
||||
#include "directMappedWallPolyPatch.H"
|
||||
#include "zeroGradientFvPatchFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace regionModels
|
||||
{
|
||||
defineTypeNameAndDebug(regionModel, 0);
|
||||
}
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
|
||||
|
||||
void Foam::regionModels::regionModel::constructMeshObjects()
|
||||
{
|
||||
// construct region mesh
|
||||
regionMeshPtr_.reset
|
||||
(
|
||||
new fvMesh
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
lookup("regionName"),
|
||||
time_.timeName(),
|
||||
time_,
|
||||
IOobject::MUST_READ
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
void Foam::regionModels::regionModel::initialise()
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Pout<< "regionModel::initialise()" << endl;
|
||||
}
|
||||
|
||||
label nBoundaryFaces = 0;
|
||||
DynamicList<label> primaryPatchIDs;
|
||||
DynamicList<label> intCoupledPatchIDs;
|
||||
const polyBoundaryMesh& rbm = regionMesh().boundaryMesh();
|
||||
const polyBoundaryMesh& pbm = primaryMesh().boundaryMesh();
|
||||
mappedPatches_.setSize(rbm.size());
|
||||
|
||||
forAll(rbm, patchI)
|
||||
{
|
||||
const polyPatch& regionPatch = rbm[patchI];
|
||||
if (isA<directMappedWallPolyPatch>(regionPatch))
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Pout<< "found " << directMappedWallPolyPatch::typeName
|
||||
<< " " << regionPatch.name() << endl;
|
||||
}
|
||||
|
||||
intCoupledPatchIDs.append(patchI);
|
||||
|
||||
nBoundaryFaces += regionPatch.faceCells().size();
|
||||
|
||||
const directMappedWallPolyPatch& dmp =
|
||||
refCast<const directMappedWallPolyPatch>(regionPatch);
|
||||
|
||||
const label primaryPatchI = dmp.samplePolyPatch().index();
|
||||
primaryPatchIDs.append(primaryPatchI);
|
||||
|
||||
mappedPatches_.set
|
||||
(
|
||||
patchI,
|
||||
new directMappedPatchBase
|
||||
(
|
||||
pbm[primaryPatchI],
|
||||
regionMesh().name(),
|
||||
directMappedPatchBase::NEARESTPATCHFACE,
|
||||
regionPatch.name(),
|
||||
vector::zero
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
primaryPatchIDs_.transfer(primaryPatchIDs);
|
||||
intCoupledPatchIDs_.transfer(intCoupledPatchIDs);
|
||||
// mappedPatches_.resize(nCoupledPatches);
|
||||
|
||||
if (nBoundaryFaces == 0)
|
||||
{
|
||||
WarningIn("regionModel::initialise()")
|
||||
<< "Region model being applied without direct mapped boundary "
|
||||
<< "conditions" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
|
||||
bool Foam::regionModels::regionModel::read()
|
||||
{
|
||||
if (regIOobject::read())
|
||||
{
|
||||
if (active_)
|
||||
{
|
||||
if (const dictionary* dictPtr = subDictPtr(modelName_ + "Coeffs"))
|
||||
{
|
||||
coeffs_ <<= *dictPtr;
|
||||
}
|
||||
|
||||
infoOutput_.readIfPresent("infoOutput", *this);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::regionModels::regionModel::regionModel(const fvMesh& mesh)
|
||||
:
|
||||
IOdictionary
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"regionModelProperties",
|
||||
mesh.time().constant(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
),
|
||||
primaryMesh_(mesh),
|
||||
time_(mesh.time()),
|
||||
active_(false),
|
||||
infoOutput_(false),
|
||||
modelName_("none"),
|
||||
regionMeshPtr_(NULL),
|
||||
coeffs_(dictionary::null),
|
||||
primaryPatchIDs_(),
|
||||
intCoupledPatchIDs_(),
|
||||
mappedPatches_()
|
||||
{}
|
||||
|
||||
|
||||
Foam::regionModels::regionModel::regionModel
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const word& regionType,
|
||||
const word& modelName,
|
||||
bool readFields
|
||||
)
|
||||
:
|
||||
IOdictionary
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
regionType + "Properties",
|
||||
mesh.time().constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
),
|
||||
primaryMesh_(mesh),
|
||||
time_(mesh.time()),
|
||||
active_(lookup("active")),
|
||||
infoOutput_(true),
|
||||
modelName_(modelName),
|
||||
regionMeshPtr_(NULL),
|
||||
coeffs_(subOrEmptyDict(modelName + "Coeffs")),
|
||||
primaryPatchIDs_(),
|
||||
intCoupledPatchIDs_(),
|
||||
mappedPatches_()
|
||||
{
|
||||
if (active_)
|
||||
{
|
||||
constructMeshObjects();
|
||||
initialise();
|
||||
|
||||
if (readFields)
|
||||
{
|
||||
read();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::regionModels::regionModel::~regionModel()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::regionModels::regionModel::preEvolveRegion()
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
|
||||
void Foam::regionModels::regionModel::evolveRegion()
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
|
||||
void Foam::regionModels::regionModel::evolve()
|
||||
{
|
||||
if (active_)
|
||||
{
|
||||
if (primaryMesh_.changing())
|
||||
{
|
||||
FatalErrorIn("regionModel::evolve()")
|
||||
<< "Currently not possible to apply " << modelName_
|
||||
<< " model to moving mesh cases" << nl << abort(FatalError);
|
||||
}
|
||||
|
||||
Info<< "\nEvolving " << modelName_ << " for region "
|
||||
<< regionMesh().name() << endl;
|
||||
|
||||
// Update any input information
|
||||
read();
|
||||
|
||||
// Pre-evolve
|
||||
preEvolveRegion();
|
||||
|
||||
// Increment the region equations up to the new time level
|
||||
evolveRegion();
|
||||
|
||||
// Provide some feedback
|
||||
if (infoOutput_)
|
||||
{
|
||||
Info<< incrIndent;
|
||||
info();
|
||||
Info<< endl << decrIndent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::regionModels::regionModel::info() const
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
236
src/regionModels/regionModel/regionModel/regionModel.H
Normal file
236
src/regionModels/regionModel/regionModel/regionModel.H
Normal file
@ -0,0 +1,236 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::regionModel
|
||||
|
||||
Description
|
||||
Base class for region models
|
||||
|
||||
SourceFiles
|
||||
regionModelI.H
|
||||
regionModel.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef regionModel_H
|
||||
#define regionModel_H
|
||||
|
||||
#include "IOdictionary.H"
|
||||
#include "Switch.H"
|
||||
#include "labelList.H"
|
||||
#include "volFields.H"
|
||||
#include "directMappedPatchBase.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward declaration of classes
|
||||
//class fvMesh;
|
||||
//class Time;
|
||||
|
||||
namespace regionModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class regionModel Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class regionModel
|
||||
:
|
||||
public IOdictionary
|
||||
{
|
||||
|
||||
private:
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
regionModel(const regionModel&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const regionModel&);
|
||||
|
||||
//- Construct region mesh and fields
|
||||
void constructMeshObjects();
|
||||
|
||||
//- Initialise the region
|
||||
void initialise();
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Reference to the primary mesh database
|
||||
const fvMesh& primaryMesh_;
|
||||
|
||||
//- Reference to the time database
|
||||
const Time& time_;
|
||||
|
||||
//- Active flag
|
||||
Switch active_;
|
||||
|
||||
//- Active information output
|
||||
Switch infoOutput_;
|
||||
|
||||
//- Model name
|
||||
const word modelName_;
|
||||
|
||||
//- Pointer to the region mesh database
|
||||
autoPtr<fvMesh> regionMeshPtr_;
|
||||
|
||||
//- Model coefficients dictionary
|
||||
dictionary coeffs_;
|
||||
|
||||
|
||||
// Addressing
|
||||
|
||||
//- List of patch IDs on the primary region coupled to this region
|
||||
labelList primaryPatchIDs_;
|
||||
|
||||
//- List of patch IDs internally coupled with the primary region
|
||||
labelList intCoupledPatchIDs_;
|
||||
|
||||
//- List of patch map info
|
||||
PtrList<directMappedPatchBase> mappedPatches_;
|
||||
|
||||
|
||||
// Protected member functions
|
||||
|
||||
//- Read control parameters from dictionary
|
||||
virtual bool read();
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("regionModel");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct null
|
||||
regionModel(const fvMesh& mesh);
|
||||
|
||||
//- Construct from mesh, region type and name
|
||||
regionModel
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const word& regionType,
|
||||
const word& modelName,
|
||||
bool readFields = true
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~regionModel();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access
|
||||
|
||||
//- Return the reference to the primary mesh database
|
||||
inline const fvMesh& primaryMesh() const;
|
||||
|
||||
//- Return the reference to the time database
|
||||
inline const Time& time() const;
|
||||
|
||||
//- Return the active flag
|
||||
inline const Switch& active() const;
|
||||
|
||||
//- Return the model name
|
||||
inline const word& modelName() const;
|
||||
|
||||
//- Return the region mesh database
|
||||
inline const fvMesh& regionMesh() const;
|
||||
|
||||
//- Return the region mesh database for manipulation
|
||||
inline fvMesh& regionMesh();
|
||||
|
||||
//- Return the model coefficients dictionary
|
||||
inline const dictionary& coeffs() const;
|
||||
|
||||
//- Return the solution dictionary
|
||||
inline const dictionary& solution() const;
|
||||
|
||||
|
||||
// Addressing
|
||||
|
||||
//- Return true if patchI on the primary region is a coupled
|
||||
// patch to the local region
|
||||
inline bool isRegionPatch(const label patchI) const;
|
||||
|
||||
//- Return the list of patch IDs on the primary region coupled
|
||||
// to this region
|
||||
inline const labelList& primaryPatchIDs() const;
|
||||
|
||||
//- Return the list of patch IDs internally coupled with the
|
||||
// primary region
|
||||
inline const labelList& intCoupledPatchIDs() const;
|
||||
|
||||
//- Return the list of patch map info
|
||||
inline const PtrList<directMappedPatchBase>&
|
||||
mappedPatches() const;
|
||||
|
||||
//- Return region ID corresponding to primaryPatchID
|
||||
inline label regionPatchID(const label primaryPatchID) const;
|
||||
|
||||
|
||||
// Evolution
|
||||
|
||||
//- Pre-evolve region
|
||||
virtual void preEvolveRegion();
|
||||
|
||||
//- Evolve the region
|
||||
virtual void evolveRegion();
|
||||
|
||||
//- Evolve the film
|
||||
virtual void evolve();
|
||||
|
||||
|
||||
// I-O
|
||||
|
||||
//- Provide some feedback
|
||||
virtual void info() const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace regionModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "regionModelI.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
154
src/regionModels/regionModel/regionModel/regionModelI.H
Normal file
154
src/regionModels/regionModel/regionModel/regionModelI.H
Normal file
@ -0,0 +1,154 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "regionModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
inline const Foam::fvMesh&
|
||||
Foam::regionModels::regionModel::primaryMesh() const
|
||||
{
|
||||
return primaryMesh_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::Time& Foam::regionModels::regionModel::time() const
|
||||
{
|
||||
return time_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::Switch& Foam::regionModels::regionModel::active() const
|
||||
{
|
||||
return active_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::word& Foam::regionModels::regionModel::modelName() const
|
||||
{
|
||||
return modelName_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::fvMesh& Foam::regionModels::regionModel::regionMesh() const
|
||||
{
|
||||
if (!regionMeshPtr_.valid())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"inline const Foam::fvMesh&"
|
||||
"Foam::regionModels::regionModel::regionMesh() const"
|
||||
)<< "Region mesh not available" << abort(FatalError);
|
||||
}
|
||||
|
||||
return regionMeshPtr_();
|
||||
}
|
||||
|
||||
|
||||
inline Foam::fvMesh& Foam::regionModels::regionModel::regionMesh()
|
||||
{
|
||||
if (!regionMeshPtr_.valid())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"inline Foam::fvMesh&"
|
||||
"Foam::regionModels::regionModel::regionMesh()"
|
||||
)<< "Region mesh not available" << abort(FatalError);
|
||||
}
|
||||
|
||||
return regionMeshPtr_();
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::dictionary& Foam::regionModels::regionModel::coeffs() const
|
||||
{
|
||||
return coeffs_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::dictionary&
|
||||
Foam::regionModels::regionModel::solution() const
|
||||
{
|
||||
return regionMesh().solutionDict();
|
||||
}
|
||||
|
||||
|
||||
inline bool Foam::regionModels::regionModel::isRegionPatch
|
||||
(
|
||||
const label patchI
|
||||
) const
|
||||
{
|
||||
forAll(primaryPatchIDs_, i)
|
||||
{
|
||||
if (primaryPatchIDs_[i] == patchI)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::labelList&
|
||||
Foam::regionModels::regionModel::primaryPatchIDs() const
|
||||
{
|
||||
return primaryPatchIDs_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::labelList&
|
||||
Foam::regionModels::regionModel::intCoupledPatchIDs() const
|
||||
{
|
||||
return intCoupledPatchIDs_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::PtrList<Foam::directMappedPatchBase>&
|
||||
Foam::regionModels::regionModel::mappedPatches() const
|
||||
{
|
||||
return mappedPatches_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::label Foam::regionModels::regionModel::regionPatchID
|
||||
(
|
||||
const label primaryPatchID
|
||||
) const
|
||||
{
|
||||
forAll(primaryPatchIDs_, i)
|
||||
{
|
||||
if (primaryPatchIDs_[i] == primaryPatchID)
|
||||
{
|
||||
return intCoupledPatchIDs_[i];
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
308
src/regionModels/regionModel/regionModel1D/regionModel1D.C
Normal file
308
src/regionModels/regionModel/regionModel1D/regionModel1D.C
Normal file
@ -0,0 +1,308 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "regionModel1D.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace regionModels
|
||||
{
|
||||
defineTypeNameAndDebug(regionModel1D, 0);
|
||||
}
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
|
||||
|
||||
void Foam::regionModels::regionModel1D::constructMeshObjects()
|
||||
{
|
||||
const fvMesh& regionMesh = regionMeshPtr_();
|
||||
|
||||
nMagSfPtr_.reset
|
||||
(
|
||||
new surfaceScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"nMagSf",
|
||||
time().timeName(),
|
||||
regionMesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
regionMesh,
|
||||
dimensionedScalar("zero", dimArea, 0.0)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
void Foam::regionModels::regionModel1D::initialise()
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Pout<< "regionModel1D::initialise()" << endl;
|
||||
}
|
||||
|
||||
// Calculate boundaryFaceFaces and boundaryFaceCells
|
||||
|
||||
DynamicList<label> faceIDs;
|
||||
DynamicList<label> cellIDs;
|
||||
|
||||
label localPyrolysisFaceI = 0;
|
||||
|
||||
const polyBoundaryMesh& rbm = regionMesh().boundaryMesh();
|
||||
|
||||
forAll(intCoupledPatchIDs_, i)
|
||||
{
|
||||
const label patchI = intCoupledPatchIDs_[i];
|
||||
const polyPatch& ppCoupled = rbm[patchI];
|
||||
forAll(ppCoupled, localFaceI)
|
||||
{
|
||||
label faceI = ppCoupled.start() + localFaceI;
|
||||
label cellI = -1;
|
||||
label nFaces = 0;
|
||||
label nCells = 0;
|
||||
do
|
||||
{
|
||||
label ownCellI = regionMesh().faceOwner()[faceI];
|
||||
if (ownCellI != cellI)
|
||||
{
|
||||
cellI = ownCellI;
|
||||
}
|
||||
else
|
||||
{
|
||||
cellI = regionMesh().faceNeighbour()[faceI];
|
||||
}
|
||||
nCells++;
|
||||
cellIDs.append(cellI);
|
||||
const cell& cFaces = regionMesh().cells()[cellI];
|
||||
faceI = cFaces.opposingFaceLabel(faceI, regionMesh().faces());
|
||||
faceIDs.append(faceI);
|
||||
nFaces++;
|
||||
} while (regionMesh().isInternalFace(faceI));
|
||||
|
||||
boundaryFaceOppositeFace_[localPyrolysisFaceI] = faceI;
|
||||
faceIDs.remove(); //remove boundary face.
|
||||
nFaces--;
|
||||
|
||||
boundaryFaceFaces_[localPyrolysisFaceI].transfer(faceIDs);
|
||||
boundaryFaceCells_[localPyrolysisFaceI].transfer(cellIDs);
|
||||
|
||||
localPyrolysisFaceI++;
|
||||
}
|
||||
}
|
||||
|
||||
boundaryFaceOppositeFace_.setSize(localPyrolysisFaceI);
|
||||
|
||||
surfaceScalarField& nMagSf = nMagSfPtr_();
|
||||
|
||||
forAll(intCoupledPatchIDs_, i)
|
||||
{
|
||||
const label patchI = intCoupledPatchIDs_[i];
|
||||
const polyPatch& ppCoupled = rbm[patchI];
|
||||
const vectorField& pNormals = ppCoupled.faceNormals();
|
||||
nMagSf.boundaryField()[patchI] =
|
||||
regionMesh().Sf().boundaryField()[patchI] & pNormals;
|
||||
forAll(pNormals, localFaceI)
|
||||
{
|
||||
const vector& n = pNormals[localFaceI];
|
||||
const labelList& faces = boundaryFaceFaces_[localFaceI];
|
||||
forAll (faces, faceI)
|
||||
{
|
||||
const label faceID = faces[faceI];
|
||||
nMagSf[faceID] = regionMesh().Sf()[faceID] & n;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
|
||||
bool Foam::regionModels::regionModel1D::read()
|
||||
{
|
||||
if (regionModel::read())
|
||||
{
|
||||
moveMesh_.readIfPresent("moveMesh", coeffs_);
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::labelField> Foam::regionModels::regionModel1D::moveMesh
|
||||
(
|
||||
const scalarList& deltaV,
|
||||
const scalar minDelta
|
||||
)
|
||||
{
|
||||
tmp<labelField> tcellMoveMap(new labelField(regionMesh().nCells(), 0));
|
||||
labelField& cellMoveMap = tcellMoveMap();
|
||||
|
||||
if (!moveMesh_)
|
||||
{
|
||||
return cellMoveMap;
|
||||
}
|
||||
|
||||
pointField oldPoints = regionMesh().points();
|
||||
pointField newPoints = oldPoints;
|
||||
|
||||
const polyBoundaryMesh& bm = regionMesh().boundaryMesh();
|
||||
|
||||
forAll(intCoupledPatchIDs_, localPatchI)
|
||||
{
|
||||
label patchI = intCoupledPatchIDs_[localPatchI];
|
||||
const polyPatch pp = bm[patchI];
|
||||
const vectorField& cf = regionMesh().Cf().boundaryField()[patchI];
|
||||
|
||||
forAll(pp, patchFaceI)
|
||||
{
|
||||
const labelList& faces = boundaryFaceFaces_[patchFaceI];
|
||||
const labelList& cells = boundaryFaceCells_[patchFaceI];
|
||||
const vector n = pp.faceNormals()[patchFaceI];
|
||||
const vector sf = pp.faceAreas()[patchFaceI];
|
||||
|
||||
List<point> oldCf(faces.size() + 1);
|
||||
oldCf[0] = cf[patchFaceI];
|
||||
forAll(faces, i)
|
||||
{
|
||||
oldCf[i + 1] = regionMesh().faceCentres()[faces[i]];
|
||||
}
|
||||
|
||||
vector newDelta = vector::zero;
|
||||
point nbrCf = oldCf[0];
|
||||
|
||||
forAll(faces, i)
|
||||
{
|
||||
const label faceI = faces[i];
|
||||
const label cellI = cells[i];
|
||||
|
||||
const face f = regionMesh().faces()[faceI];
|
||||
|
||||
newDelta += (deltaV[cellI]/mag(sf))*n;
|
||||
|
||||
vector localDelta = vector::zero;
|
||||
forAll(f, pti)
|
||||
{
|
||||
const label pointI = f[pti];
|
||||
|
||||
if
|
||||
(
|
||||
((nbrCf - (oldPoints[pointI] + newDelta)) & n)
|
||||
> minDelta
|
||||
)
|
||||
{
|
||||
newPoints[pointI] = oldPoints[pointI] + newDelta;
|
||||
localDelta = newDelta;
|
||||
cellMoveMap[cellI] = 1;
|
||||
}
|
||||
}
|
||||
nbrCf = oldCf[i + 1] + localDelta;
|
||||
}
|
||||
|
||||
// Modify boundary
|
||||
const label bFaceI = boundaryFaceOppositeFace_[patchFaceI];
|
||||
const face f = regionMesh().faces()[bFaceI];
|
||||
const label cellI = cells[cells.size() - 1];
|
||||
newDelta += (deltaV[cellI]/mag(sf))*n;
|
||||
forAll(f, pti)
|
||||
{
|
||||
const label pointI = f[pti];
|
||||
|
||||
if
|
||||
(
|
||||
((nbrCf - (oldPoints[pointI] + newDelta)) & n)
|
||||
> minDelta
|
||||
)
|
||||
{
|
||||
newPoints[pointI] = oldPoints[pointI] + newDelta;
|
||||
cellMoveMap[cellI] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Move points
|
||||
regionMesh().movePoints(newPoints);
|
||||
|
||||
return tcellMoveMap;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::regionModels::regionModel1D::regionModel1D(const fvMesh& mesh)
|
||||
:
|
||||
regionModel(mesh),
|
||||
boundaryFaceFaces_(),
|
||||
boundaryFaceCells_(),
|
||||
boundaryFaceOppositeFace_(),
|
||||
nMagSfPtr_(NULL),
|
||||
moveMesh_(false)
|
||||
{}
|
||||
|
||||
|
||||
Foam::regionModels::regionModel1D::regionModel1D
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const word& regionType,
|
||||
const word& modelName,
|
||||
bool readFields
|
||||
)
|
||||
:
|
||||
regionModel(mesh, regionType, modelName, false),
|
||||
boundaryFaceFaces_(regionMesh().nCells()),
|
||||
boundaryFaceCells_(regionMesh().nCells()),
|
||||
boundaryFaceOppositeFace_(regionMesh().nCells()),
|
||||
nMagSfPtr_(NULL),
|
||||
moveMesh_(true)
|
||||
{
|
||||
if (active_)
|
||||
{
|
||||
constructMeshObjects();
|
||||
initialise();
|
||||
|
||||
if (readFields)
|
||||
{
|
||||
read();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::regionModels::regionModel1D::~regionModel1D()
|
||||
{}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
176
src/regionModels/regionModel/regionModel1D/regionModel1D.H
Normal file
176
src/regionModels/regionModel/regionModel1D/regionModel1D.H
Normal file
@ -0,0 +1,176 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::regionModel1D
|
||||
|
||||
Description
|
||||
Base class for 1-D region models
|
||||
|
||||
SourceFiles
|
||||
regionModel1D.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef regionModel1D_H
|
||||
#define regionModel1D_H
|
||||
|
||||
#include "regionModel.H"
|
||||
#include "surfaceFields.H"
|
||||
#include "labelList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace regionModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class regionModel1D Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class regionModel1D
|
||||
:
|
||||
public regionModel
|
||||
{
|
||||
|
||||
private:
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
regionModel1D(const regionModel1D&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const regionModel1D&);
|
||||
|
||||
//- Construct region mesh and fields
|
||||
void constructMeshObjects();
|
||||
|
||||
//- Initialise the region
|
||||
void initialise();
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
// Region addressing - per internally coupled patch face walking out
|
||||
|
||||
//- Global face IDs
|
||||
labelListList boundaryFaceFaces_;
|
||||
|
||||
//- Global cell IDs
|
||||
labelListList boundaryFaceCells_;
|
||||
|
||||
//- Global boundary face IDs oppossite coupled patch
|
||||
labelList boundaryFaceOppositeFace_;
|
||||
|
||||
|
||||
// Geometry
|
||||
|
||||
//- Face area magnitude normal to patch
|
||||
autoPtr<surfaceScalarField> nMagSfPtr_;
|
||||
|
||||
//- Flag to allow mesh movement
|
||||
Switch moveMesh_;
|
||||
|
||||
|
||||
// Protected member functions
|
||||
|
||||
//- Read control parameters from dictionary
|
||||
virtual bool read();
|
||||
|
||||
//- Move mesh points according to change in cell volumes
|
||||
// Returns map ordered by cell where 1 = cell moved, 0 = cell unchanged
|
||||
tmp<labelField> moveMesh
|
||||
(
|
||||
const scalarList& deltaV,
|
||||
const scalar minDelta = 0.0
|
||||
);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("regionModel");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct null
|
||||
regionModel1D(const fvMesh& mesh);
|
||||
|
||||
//- Construct from mesh, region type and name
|
||||
regionModel1D
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const word& regionType,
|
||||
const word& modelName,
|
||||
bool readFields = true
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~regionModel1D();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access
|
||||
|
||||
// Addressing
|
||||
|
||||
//- Return the global face IDs
|
||||
inline const labelListList& boundaryFaceFaces() const;
|
||||
|
||||
//- Return the global cell IDs
|
||||
inline const labelListList& boundaryFaceCells() const;
|
||||
|
||||
//- Return the global boundary face IDs oppossite coupled patch
|
||||
inline const labelList& boundaryFaceOppositeFace() const;
|
||||
|
||||
|
||||
// Geometry
|
||||
|
||||
//- Return the face area magnitudes / [m2]
|
||||
inline const surfaceScalarField& nMagSf() const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace regionModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "regionModel1DI.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
68
src/regionModels/regionModel/regionModel1D/regionModel1DI.H
Normal file
68
src/regionModels/regionModel/regionModel1D/regionModel1DI.H
Normal file
@ -0,0 +1,68 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "regionModel1D.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
inline const Foam::labelListList&
|
||||
Foam::regionModels::regionModel1D::boundaryFaceFaces() const
|
||||
{
|
||||
return boundaryFaceFaces_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::labelListList&
|
||||
Foam::regionModels::regionModel1D::boundaryFaceCells() const
|
||||
{
|
||||
return boundaryFaceCells_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::labelList&
|
||||
Foam::regionModels::regionModel1D::boundaryFaceOppositeFace() const
|
||||
{
|
||||
return boundaryFaceOppositeFace_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::surfaceScalarField&
|
||||
Foam::regionModels::regionModel1D::nMagSf() const
|
||||
{
|
||||
if (!nMagSfPtr_.valid())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"inline const Foam::surfaceScalarField&"
|
||||
"Foam::regionModel1Ds::regionModel1D::nMagSf() const"
|
||||
)<< "Face normal areas not available" << abort(FatalError);
|
||||
}
|
||||
|
||||
return nMagSfPtr_();
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,238 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "singleLayerRegion.H"
|
||||
#include "fvMesh.H"
|
||||
#include "Time.H"
|
||||
#include "directMappedWallPolyPatch.H"
|
||||
#include "zeroGradientFvPatchFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace regionModels
|
||||
{
|
||||
defineTypeNameAndDebug(singleLayerRegion, 0);
|
||||
}
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
|
||||
|
||||
void Foam::regionModels::singleLayerRegion::constructMeshObjects()
|
||||
{
|
||||
// construct patch normal vectors
|
||||
nHatPtr_.reset
|
||||
(
|
||||
new volVectorField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"nHat",
|
||||
time_.timeName(),
|
||||
regionMesh(),
|
||||
IOobject::READ_IF_PRESENT,
|
||||
NO_WRITE
|
||||
),
|
||||
regionMesh(),
|
||||
dimensionedVector("zero", dimless, vector::zero),
|
||||
zeroGradientFvPatchField<vector>::typeName
|
||||
)
|
||||
);
|
||||
|
||||
// construct patch areas
|
||||
magSfPtr_.reset
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"magSf",
|
||||
time_.timeName(),
|
||||
regionMesh(),
|
||||
IOobject::READ_IF_PRESENT,
|
||||
NO_WRITE
|
||||
),
|
||||
regionMesh(),
|
||||
dimensionedScalar("zero", dimArea, 0.0),
|
||||
zeroGradientFvPatchField<scalar>::typeName
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
void Foam::regionModels::singleLayerRegion::initialise()
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Pout<< "singleLayerRegion::initialise()" << endl;
|
||||
}
|
||||
|
||||
label nBoundaryFaces = 0;
|
||||
const polyBoundaryMesh& rbm = regionMesh().boundaryMesh();
|
||||
volVectorField& nHat = nHatPtr_();
|
||||
volScalarField& magSf = magSfPtr_();
|
||||
forAll(intCoupledPatchIDs_, i)
|
||||
{
|
||||
const label patchI = intCoupledPatchIDs_[i];
|
||||
const polyPatch& pp = rbm[patchI];
|
||||
const labelList& fCells = pp.faceCells();
|
||||
|
||||
nBoundaryFaces += fCells.size();
|
||||
|
||||
UIndirectList<vector>(nHat, fCells) = pp.faceNormals();
|
||||
UIndirectList<scalar>(magSf, fCells) = mag(pp.faceAreas());
|
||||
}
|
||||
nHat.correctBoundaryConditions();
|
||||
magSf.correctBoundaryConditions();
|
||||
|
||||
if (nBoundaryFaces != regionMesh().nCells())
|
||||
{
|
||||
FatalErrorIn("singleLayerRegion::initialise()")
|
||||
<< "Number of primary region coupled boundary faces not equal to "
|
||||
<< "the number of cells in the local region" << nl << nl
|
||||
<< "Number of cells = " << regionMesh().nCells() << nl
|
||||
<< "Boundary faces = " << nBoundaryFaces << nl
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
scalarField passiveMagSf(magSf.size(), 0.0);
|
||||
passivePatchIDs_.setSize(intCoupledPatchIDs_.size(), -1);
|
||||
forAll(intCoupledPatchIDs_, i)
|
||||
{
|
||||
const label patchI = intCoupledPatchIDs_[i];
|
||||
const polyPatch& ppIntCoupled = rbm[patchI];
|
||||
if (ppIntCoupled.size() > 0)
|
||||
{
|
||||
label cellId = rbm[patchI].faceCells()[0];
|
||||
const cell& cFaces = regionMesh().cells()[cellId];
|
||||
|
||||
label faceI = ppIntCoupled.start();
|
||||
label faceO = cFaces.opposingFaceLabel(faceI, regionMesh().faces());
|
||||
|
||||
label passivePatchI = rbm.whichPatch(faceO);
|
||||
passivePatchIDs_[i] = passivePatchI;
|
||||
const polyPatch& ppPassive = rbm[passivePatchI];
|
||||
UIndirectList<scalar>(passiveMagSf, ppPassive.faceCells()) =
|
||||
mag(ppPassive.faceAreas());
|
||||
}
|
||||
}
|
||||
|
||||
Pstream::listCombineGather(passivePatchIDs_, maxEqOp<label>());
|
||||
Pstream::listCombineScatter(passivePatchIDs_);
|
||||
|
||||
magSf.field() = 0.5*(magSf + passiveMagSf);
|
||||
magSf.correctBoundaryConditions();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
|
||||
bool Foam::regionModels::singleLayerRegion::read()
|
||||
{
|
||||
return regionModel::read();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::regionModels::singleLayerRegion::singleLayerRegion(const fvMesh& mesh)
|
||||
:
|
||||
regionModel(mesh),
|
||||
nHatPtr_(NULL),
|
||||
magSfPtr_(NULL),
|
||||
passivePatchIDs_()
|
||||
{}
|
||||
|
||||
|
||||
Foam::regionModels::singleLayerRegion::singleLayerRegion
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const word& regionType,
|
||||
const word& modelName,
|
||||
bool readFields
|
||||
)
|
||||
:
|
||||
regionModel(mesh, regionType, modelName, false),
|
||||
nHatPtr_(NULL),
|
||||
magSfPtr_(NULL),
|
||||
passivePatchIDs_()
|
||||
{
|
||||
if (active_)
|
||||
{
|
||||
constructMeshObjects();
|
||||
initialise();
|
||||
|
||||
if (readFields)
|
||||
{
|
||||
read();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::regionModels::singleLayerRegion::~singleLayerRegion()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
const Foam::volVectorField& Foam::regionModels::singleLayerRegion::nHat() const
|
||||
{
|
||||
if (!nHatPtr_.valid())
|
||||
{
|
||||
FatalErrorIn("const fvMesh& singleLayerRegion::nHat() const")
|
||||
<< "Region patch normal vectors not available"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
return nHatPtr_();
|
||||
}
|
||||
|
||||
|
||||
const Foam::volScalarField& Foam::regionModels::singleLayerRegion::magSf() const
|
||||
{
|
||||
if (!magSfPtr_.valid())
|
||||
{
|
||||
FatalErrorIn("const fvMesh& singleLayerRegion::magSf() const")
|
||||
<< "Region patch areas not available"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
return magSfPtr_();
|
||||
}
|
||||
|
||||
|
||||
const Foam::labelList&
|
||||
Foam::regionModels::singleLayerRegion::passivePatchIDs() const
|
||||
{
|
||||
return passivePatchIDs_;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,174 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::singleLayerRegion
|
||||
|
||||
Description
|
||||
Base class for single layer region models
|
||||
|
||||
SourceFiles
|
||||
singleLayerRegion.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef singleLayerRegion_H
|
||||
#define singleLayerRegion_H
|
||||
|
||||
#include "regionModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace regionModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class singleLayerRegion Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class singleLayerRegion
|
||||
:
|
||||
public regionModel
|
||||
{
|
||||
|
||||
private:
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
singleLayerRegion(const singleLayerRegion&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const singleLayerRegion&);
|
||||
|
||||
//- Construct region mesh and fields
|
||||
void constructMeshObjects();
|
||||
|
||||
//- Initialise the region
|
||||
void initialise();
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
// Region addressing
|
||||
|
||||
//- Patch normal vectors
|
||||
autoPtr<volVectorField> nHatPtr_;
|
||||
|
||||
//- Face area magnitudes / [m2]
|
||||
autoPtr<volScalarField> magSfPtr_;
|
||||
|
||||
|
||||
// Addressing
|
||||
|
||||
//- List of patch IDs opposite to internally coupled patches
|
||||
labelList passivePatchIDs_;
|
||||
|
||||
|
||||
// Protected member functions
|
||||
|
||||
//- Read control parameters from dictionary
|
||||
virtual bool read();
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("regionModel");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct null
|
||||
singleLayerRegion(const fvMesh& mesh);
|
||||
|
||||
//- Construct from mesh, region type and name
|
||||
singleLayerRegion
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const word& regionType,
|
||||
const word& modelName,
|
||||
bool readFields = true
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~singleLayerRegion();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access
|
||||
|
||||
// Region geometry
|
||||
|
||||
//- Return the patch normal vectors
|
||||
virtual const volVectorField& nHat() const;
|
||||
|
||||
//- Return the face area magnitudes / [m2]
|
||||
virtual const volScalarField& magSf() const;
|
||||
|
||||
|
||||
// Addressing
|
||||
|
||||
//- Return the list of patch IDs opposite to internally
|
||||
// coupled patches
|
||||
virtual const labelList& passivePatchIDs() const;
|
||||
|
||||
|
||||
// Patch type information
|
||||
|
||||
//- Return boundary types for mapped field patches
|
||||
// Also maps internal field value
|
||||
// Mapping region prescribed by underlying mapped poly patch
|
||||
template<class Type>
|
||||
wordList mappedFieldAndInternalPatchTypes() const;
|
||||
|
||||
//- Return boundary types for pushed mapped field patches
|
||||
// Mapping region prescribed by underlying mapped poly patch
|
||||
template<class Type>
|
||||
wordList mappedPushedFieldPatchTypes() const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace regionModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
#include "singleLayerRegionTemplates.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,72 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "singleLayerRegion.H"
|
||||
#include "zeroGradientFvPatchFields.H"
|
||||
#include "directMappedFixedInternalValueFvPatchFields.H"
|
||||
#include "directMappedFixedPushedInternalValueFvPatchFields.H"
|
||||
|
||||
// * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::wordList
|
||||
Foam::regionModels::singleLayerRegion::mappedFieldAndInternalPatchTypes() const
|
||||
{
|
||||
wordList bTypes(regionMesh().boundaryMesh().size());
|
||||
|
||||
bTypes = zeroGradientFvPatchField<Type>::typeName;
|
||||
|
||||
forAll(intCoupledPatchIDs_, i)
|
||||
{
|
||||
const label patchI = intCoupledPatchIDs_[i];
|
||||
bTypes[patchI] =
|
||||
directMappedFixedInternalValueFvPatchField<Type>::typeName;
|
||||
}
|
||||
|
||||
return bTypes;
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::wordList
|
||||
Foam::regionModels::singleLayerRegion::mappedPushedFieldPatchTypes() const
|
||||
{
|
||||
wordList bTypes(regionMesh().boundaryMesh().size());
|
||||
|
||||
bTypes = zeroGradientFvPatchField<Type>::typeName;
|
||||
|
||||
forAll(intCoupledPatchIDs_, i)
|
||||
{
|
||||
const label patchI = intCoupledPatchIDs_[i];
|
||||
bTypes[patchI] =
|
||||
directMappedFixedPushedInternalValueFvPatchField<Type>::typeName;
|
||||
}
|
||||
|
||||
return bTypes;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
46
src/regionModels/surfaceFilmModels/Make/files
Normal file
46
src/regionModels/surfaceFilmModels/Make/files
Normal file
@ -0,0 +1,46 @@
|
||||
/* Surface film models */
|
||||
surfaceFilmModel/surfaceFilmModel.C
|
||||
surfaceFilmModel/surfaceFilmModelNew.C
|
||||
noFilm/noFilm.C
|
||||
kinematicSingleLayer/kinematicSingleLayer.C
|
||||
thermoSingleLayer/thermoSingleLayer.C
|
||||
|
||||
|
||||
/* Sub-models */
|
||||
submodels/subModelBase.C
|
||||
|
||||
KINEMATICMODELS=submodels/kinematic
|
||||
$(KINEMATICMODELS)/injectionModel/injectionModel/injectionModel.C
|
||||
$(KINEMATICMODELS)/injectionModel/injectionModel/injectionModelNew.C
|
||||
$(KINEMATICMODELS)/injectionModel/noInjection/noInjection.C
|
||||
$(KINEMATICMODELS)/injectionModel/cloudInjection/cloudInjection.C
|
||||
$(KINEMATICMODELS)/injectionModel/removeInjection/removeInjection.C
|
||||
|
||||
THERMOMODELS=submodels/thermo
|
||||
$(THERMOMODELS)/phaseChangeModel/phaseChangeModel/phaseChangeModel.C
|
||||
$(THERMOMODELS)/phaseChangeModel/phaseChangeModel/phaseChangeModelNew.C
|
||||
$(THERMOMODELS)/phaseChangeModel/noPhaseChange/noPhaseChange.C
|
||||
$(THERMOMODELS)/phaseChangeModel/standardPhaseChange/standardPhaseChange.C
|
||||
|
||||
$(THERMOMODELS)/heatTransferModel/heatTransferModel/heatTransferModel.C
|
||||
$(THERMOMODELS)/heatTransferModel/heatTransferModel/heatTransferModelNew.C
|
||||
$(THERMOMODELS)/heatTransferModel/constantHeatTransfer/constantHeatTransfer.C
|
||||
$(THERMOMODELS)/heatTransferModel/mappedConvectiveHeatTransfer/mappedConvectiveHeatTransfer.C
|
||||
|
||||
$(THERMOMODELS)/filmRadiationModel/filmRadiationModel/filmRadiationModel.C
|
||||
$(THERMOMODELS)/filmRadiationModel/filmRadiationModel/filmRadiationModelNew.C
|
||||
$(THERMOMODELS)/filmRadiationModel/noRadiation/noRadiation.C
|
||||
$(THERMOMODELS)/filmRadiationModel/standardRadiation/standardRadiation.C
|
||||
|
||||
|
||||
/* Boundary conditions */
|
||||
PATCHFIELDS=derivedFvPatchFields
|
||||
$(PATCHFIELDS)/filmHeightInletVelocity/filmHeightInletVelocityFvPatchVectorField.C
|
||||
|
||||
/* Wall functions for primary region */
|
||||
WALLFUNCS=$(PATCHFIELDS)/wallFunctions
|
||||
$(WALLFUNCS)/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.C
|
||||
$(WALLFUNCS)/mutkFilmWallFunction/mutkFilmWallFunctionFvPatchScalarField.C
|
||||
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libsurfaceFilmModels
|
||||
@ -12,10 +12,12 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels \
|
||||
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
|
||||
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude
|
||||
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \
|
||||
-I$(LIB_SRC)/regionModels/regionModel/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lSLGThermo \
|
||||
-lregionModels \
|
||||
-lSLGThermoNew \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-ldistributionModels \
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user