mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
MRG: Resolve conflict with latest foundation merge
This commit is contained in:
@ -46,7 +46,7 @@ Foam::scalar Foam::solidRegionDiffNo
|
||||
/ fvc::interpolate(Cprho)
|
||||
);
|
||||
|
||||
DiNum = gMax(kapparhoCpbyDelta.primitiveField())*runTime.deltaT().value();
|
||||
DiNum = max(kapparhoCpbyDelta).value()*runTime.deltaT().value();
|
||||
|
||||
meanDiNum = (average(kapparhoCpbyDelta)).value()*runTime.deltaT().value();
|
||||
|
||||
|
||||
@ -257,6 +257,73 @@ Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::massTransfer() const
|
||||
}
|
||||
|
||||
|
||||
template<class BasePhaseSystem>
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::iDmdt
|
||||
(
|
||||
const phasePairKey& key
|
||||
) const
|
||||
{
|
||||
const scalar dmdtSign(Pair<word>::compare(iDmdt_.find(key).key(), key));
|
||||
|
||||
return dmdtSign**iDmdt_[key];
|
||||
}
|
||||
|
||||
|
||||
template<class BasePhaseSystem>
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::iDmdt
|
||||
(
|
||||
const Foam::phaseModel& phase
|
||||
) const
|
||||
{
|
||||
tmp<volScalarField> tiDmdt
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject::groupName("iDmdt", phase.name()),
|
||||
this->mesh_.time().timeName(),
|
||||
this->mesh_
|
||||
),
|
||||
this->mesh_,
|
||||
dimensionedScalar("zero", dimDensity/dimTime, 0)
|
||||
)
|
||||
);
|
||||
|
||||
forAllConstIter
|
||||
(
|
||||
phaseSystem::phasePairTable,
|
||||
this->phasePairs_,
|
||||
phasePairIter
|
||||
)
|
||||
{
|
||||
const phasePair& pair(phasePairIter());
|
||||
|
||||
if (pair.ordered())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
const phaseModel* phase1 = &pair.phase1();
|
||||
const phaseModel* phase2 = &pair.phase2();
|
||||
|
||||
forAllConstIter(phasePair, pair, iter)
|
||||
{
|
||||
if (phase1 == &phase)
|
||||
{
|
||||
tiDmdt.ref() += this->iDmdt(pair);
|
||||
}
|
||||
|
||||
Swap(phase1, phase2);
|
||||
}
|
||||
}
|
||||
|
||||
return tiDmdt;
|
||||
}
|
||||
|
||||
|
||||
template<class BasePhaseSystem>
|
||||
void Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::correctThermo()
|
||||
{
|
||||
@ -265,8 +332,6 @@ void Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::correctThermo()
|
||||
|
||||
BasePhaseSystem::correctThermo();
|
||||
|
||||
|
||||
|
||||
forAllConstIter
|
||||
(
|
||||
phaseSystem::phasePairTable,
|
||||
|
||||
@ -101,6 +101,12 @@ public:
|
||||
//- Return the mass transfer matrices
|
||||
virtual autoPtr<phaseSystem::massTransferTable> massTransfer() const;
|
||||
|
||||
//- Return the interfacial mass flow rate
|
||||
virtual tmp<volScalarField> iDmdt(const phasePairKey& key) const;
|
||||
|
||||
//- Return the total interfacial mass transfer rate for phase
|
||||
virtual tmp<volScalarField> iDmdt(const phaseModel& phase) const;
|
||||
|
||||
//- Correct the thermodynamics
|
||||
virtual void correctThermo();
|
||||
|
||||
|
||||
@ -36,10 +36,33 @@ kineticTheoryModels/frictionalStressModel/JohnsonJacksonSchaeffer/JohnsonJackson
|
||||
kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C
|
||||
kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C
|
||||
|
||||
derivedFvPatchFields/wallBoilingSubModels/partitioningModels/partitioningModel/partitioningModel.C
|
||||
derivedFvPatchFields/wallBoilingSubModels/partitioningModels/partitioningModel/newPartitioningModel.C
|
||||
derivedFvPatchFields/wallBoilingSubModels/partitioningModels/phaseFraction/phaseFraction.C
|
||||
derivedFvPatchFields/wallBoilingSubModels/partitioningModels/Lavieville/Lavieville.C
|
||||
derivedFvPatchFields/wallBoilingSubModels/partitioningModels/cosine/cosine.C
|
||||
derivedFvPatchFields/wallBoilingSubModels/partitioningModels/linear/linear.C
|
||||
|
||||
derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/nucleationSiteModel.C
|
||||
derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/newNucleationSiteModel.C
|
||||
derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/LemmertChawla/LemmertChawla.C
|
||||
|
||||
derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/departureDiameterModel.C
|
||||
derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/newDepartureDiameterModel.C
|
||||
derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/TolubinskiKostanchuk/TolubinskiKostanchuk.C
|
||||
derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/KocamustafaogullariIshii/KocamustafaogullariIshii.C
|
||||
|
||||
derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/departureFrequencyModel.C
|
||||
derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/newDepartureFrequencyModel.C
|
||||
derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/Cole/Cole.C
|
||||
|
||||
derivedFvPatchFields/wallBoilingSubModels/IATEsource/wallBoiling.C
|
||||
|
||||
derivedFvPatchFields/alphatPhaseChangeJayatillekeWallFunction/alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.C
|
||||
derivedFvPatchFields/alphatFixedDmdtWallBoilingWallFunction/alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField.C
|
||||
derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C
|
||||
derivedFvPatchFields/copiedFixedValue/copiedFixedValueFvPatchScalarField.C
|
||||
derivedFvPatchFields/fixedMultiPhaseHeatFlux/fixedMultiPhaseHeatFluxFvPatchScalarField.C
|
||||
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libtwoPhaseReactingTurbulenceModels
|
||||
|
||||
@ -38,6 +38,31 @@ License
|
||||
#include "wallFvPatch.H"
|
||||
#include "uniformDimensionedFields.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
template<>
|
||||
const char* Foam::NamedEnum
|
||||
<
|
||||
Foam::compressible::
|
||||
alphatWallBoilingWallFunctionFvPatchScalarField::phaseType,
|
||||
2
|
||||
>::names[] =
|
||||
{
|
||||
"vapor",
|
||||
"liquid"
|
||||
};
|
||||
|
||||
const Foam::NamedEnum
|
||||
<
|
||||
Foam::compressible::
|
||||
alphatWallBoilingWallFunctionFvPatchScalarField::phaseType,
|
||||
2
|
||||
>
|
||||
Foam::compressible::
|
||||
alphatWallBoilingWallFunctionFvPatchScalarField::phaseTypeNames_;
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
@ -55,14 +80,20 @@ alphatWallBoilingWallFunctionFvPatchScalarField
|
||||
)
|
||||
:
|
||||
alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField(p, iF),
|
||||
phaseType_(liquidPhase),
|
||||
relax_(0.5),
|
||||
AbyV_(p.size(), 0.0),
|
||||
alphatConv_(p.size(), 0.0)
|
||||
AbyV_(p.size(), 0),
|
||||
alphatConv_(p.size(), 0),
|
||||
dDep_(p.size(), 0),
|
||||
partitioningModel_(nullptr),
|
||||
nucleationSiteModel_(nullptr),
|
||||
departureDiamModel_(nullptr),
|
||||
departureFreqModel_(nullptr)
|
||||
{
|
||||
AbyV_ = this->patch().magSf();
|
||||
forAll(AbyV_,facei)
|
||||
forAll(AbyV_, facei)
|
||||
{
|
||||
label faceCelli = this->patch().faceCells()[facei];
|
||||
const label faceCelli = this->patch().faceCells()[facei];
|
||||
AbyV_[facei] /= iF.mesh().V()[faceCelli];
|
||||
}
|
||||
}
|
||||
@ -77,19 +108,68 @@ alphatWallBoilingWallFunctionFvPatchScalarField
|
||||
)
|
||||
:
|
||||
alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField(p, iF, dict),
|
||||
phaseType_(phaseTypeNames_.read(dict.lookup("phaseType"))),
|
||||
relax_(dict.lookupOrDefault<scalar>("relax", 0.5)),
|
||||
AbyV_(p.size(), 0.0),
|
||||
alphatConv_(p.size(), 0.0)
|
||||
AbyV_(p.size(), 0),
|
||||
alphatConv_(p.size(), 0),
|
||||
dDep_(p.size(), 0),
|
||||
partitioningModel_(nullptr),
|
||||
nucleationSiteModel_(nullptr),
|
||||
departureDiamModel_(nullptr),
|
||||
departureFreqModel_(nullptr)
|
||||
{
|
||||
switch (phaseType_)
|
||||
{
|
||||
case vaporPhase:
|
||||
{
|
||||
partitioningModel_ =
|
||||
wallBoilingModels::partitioningModel::New
|
||||
(
|
||||
dict.subDict("partitioningModel")
|
||||
);
|
||||
|
||||
dmdt_ = 0;
|
||||
|
||||
break;
|
||||
}
|
||||
case liquidPhase:
|
||||
{
|
||||
partitioningModel_ =
|
||||
wallBoilingModels::partitioningModel::New
|
||||
(
|
||||
dict.subDict("partitioningModel")
|
||||
);
|
||||
|
||||
nucleationSiteModel_ =
|
||||
wallBoilingModels::nucleationSiteModel::New
|
||||
(
|
||||
dict.subDict("nucleationSiteModel")
|
||||
);
|
||||
|
||||
departureDiamModel_ =
|
||||
wallBoilingModels::departureDiameterModel::New
|
||||
(
|
||||
dict.subDict("departureDiamModel")
|
||||
);
|
||||
|
||||
departureFreqModel_ =
|
||||
wallBoilingModels::departureFrequencyModel::New
|
||||
(
|
||||
dict.subDict("departureFreqModel")
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (dict.found("alphatConv"))
|
||||
{
|
||||
alphatConv_ = scalarField("alphatConv", dict, p.size());
|
||||
}
|
||||
|
||||
AbyV_ = this->patch().magSf();
|
||||
forAll(AbyV_,facei)
|
||||
forAll(AbyV_, facei)
|
||||
{
|
||||
label faceCelli = this->patch().faceCells()[facei];
|
||||
const label faceCelli = this->patch().faceCells()[facei];
|
||||
AbyV_[facei] /= iF.mesh().V()[faceCelli];
|
||||
}
|
||||
}
|
||||
@ -113,7 +193,12 @@ alphatWallBoilingWallFunctionFvPatchScalarField
|
||||
),
|
||||
relax_(psf.relax_),
|
||||
AbyV_(psf.AbyV_),
|
||||
alphatConv_(psf.alphatConv_, mapper)
|
||||
alphatConv_(psf.alphatConv_, mapper),
|
||||
dDep_(psf.dDep_, mapper),
|
||||
partitioningModel_(psf.partitioningModel_),
|
||||
nucleationSiteModel_(psf.nucleationSiteModel_),
|
||||
departureDiamModel_(psf.departureDiamModel_),
|
||||
departureFreqModel_(psf.departureFreqModel_)
|
||||
{}
|
||||
|
||||
|
||||
@ -126,7 +211,12 @@ alphatWallBoilingWallFunctionFvPatchScalarField
|
||||
alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField(psf),
|
||||
relax_(psf.relax_),
|
||||
AbyV_(psf.AbyV_),
|
||||
alphatConv_(psf.alphatConv_)
|
||||
alphatConv_(psf.alphatConv_),
|
||||
dDep_(psf.dDep_),
|
||||
partitioningModel_(psf.partitioningModel_),
|
||||
nucleationSiteModel_(psf.nucleationSiteModel_),
|
||||
departureDiamModel_(psf.departureDiamModel_),
|
||||
departureFreqModel_(psf.departureFreqModel_)
|
||||
{}
|
||||
|
||||
|
||||
@ -140,7 +230,12 @@ alphatWallBoilingWallFunctionFvPatchScalarField
|
||||
alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField(psf, iF),
|
||||
relax_(psf.relax_),
|
||||
AbyV_(psf.AbyV_),
|
||||
alphatConv_(psf.alphatConv_)
|
||||
alphatConv_(psf.alphatConv_),
|
||||
dDep_(psf.dDep_),
|
||||
partitioningModel_(psf.partitioningModel_),
|
||||
nucleationSiteModel_(psf.nucleationSiteModel_),
|
||||
departureDiamModel_(psf.departureDiamModel_),
|
||||
departureFreqModel_(psf.departureFreqModel_)
|
||||
{}
|
||||
|
||||
|
||||
@ -153,13 +248,21 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs()
|
||||
return;
|
||||
}
|
||||
|
||||
// Check that partitioningModel has been constructed
|
||||
if (!partitioningModel_.valid())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "partitioningModel has not been constructed!"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
// Lookup the fluid model
|
||||
const ThermalPhaseChangePhaseSystem<MomentumTransferPhaseSystem
|
||||
const ThermalPhaseChangePhaseSystem
|
||||
<
|
||||
twoPhaseSystem>
|
||||
>&
|
||||
fluid
|
||||
= refCast
|
||||
MomentumTransferPhaseSystem
|
||||
<
|
||||
twoPhaseSystem>
|
||||
>& fluid = refCast
|
||||
<
|
||||
const ThermalPhaseChangePhaseSystem
|
||||
<
|
||||
@ -170,192 +273,309 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs()
|
||||
db().lookupObject<phaseSystem>("phaseProperties")
|
||||
);
|
||||
|
||||
const phaseModel& liquid
|
||||
(
|
||||
fluid.phase1().name() == internalField().group()
|
||||
? fluid.phase1()
|
||||
: fluid.phase2()
|
||||
);
|
||||
|
||||
const phaseModel& vapor(fluid.otherPhase(liquid));
|
||||
|
||||
const label patchi = patch().index();
|
||||
|
||||
// Retrieve turbulence properties from model
|
||||
const phaseCompressibleTurbulenceModel& turbModel = liquid.turbulence();
|
||||
|
||||
const tmp<scalarField> tnutw = turbModel.nut(patchi);
|
||||
|
||||
const scalar Cmu25(pow025(Cmu_));
|
||||
|
||||
const scalarField& y = turbModel.y()[patchi];
|
||||
|
||||
const tmp<scalarField> tmuw = turbModel.mu(patchi);
|
||||
const scalarField& muw = tmuw();
|
||||
|
||||
const tmp<scalarField> talphaw = liquid.thermo().alpha(patchi);
|
||||
const scalarField& alphaw = talphaw();
|
||||
|
||||
const tmp<volScalarField> tk = turbModel.k();
|
||||
const volScalarField& k = tk();
|
||||
const fvPatchScalarField& kw = k.boundaryField()[patchi];
|
||||
|
||||
const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi];
|
||||
const scalarField magUp(mag(Uw.patchInternalField() - Uw));
|
||||
const scalarField magGradUw(mag(Uw.snGrad()));
|
||||
|
||||
const fvPatchScalarField& rhow = turbModel.rho().boundaryField()[patchi];
|
||||
const fvPatchScalarField& hew =
|
||||
liquid.thermo().he().boundaryField()[patchi];
|
||||
|
||||
const fvPatchScalarField& Tw =
|
||||
liquid.thermo().T().boundaryField()[patchi];
|
||||
const scalarField Tc(Tw.patchInternalField());
|
||||
|
||||
scalarField uTau(Cmu25*sqrt(kw));
|
||||
|
||||
scalarField yPlus(uTau*y/(muw/rhow));
|
||||
|
||||
scalarField Pr(muw/alphaw);
|
||||
|
||||
// Molecular-to-turbulent Prandtl number ratio
|
||||
scalarField Prat(Pr/Prt_);
|
||||
|
||||
// Thermal sublayer thickness
|
||||
scalarField P(this->Psmooth(Prat));
|
||||
|
||||
scalarField yPlusTherm(this->yPlusTherm(P, Prat));
|
||||
|
||||
const scalarField rhoc(rhow.patchInternalField());
|
||||
|
||||
tmp<volScalarField> trhoVapor = vapor.thermo().rho();
|
||||
const volScalarField& rhoVapor = trhoVapor();
|
||||
const fvPatchScalarField& rhoVaporw =
|
||||
rhoVapor.boundaryField()[patchi];
|
||||
const scalarField rhoVaporp(rhoVaporw.patchInternalField());
|
||||
|
||||
tmp<volScalarField> tCp = liquid.thermo().Cp();
|
||||
const volScalarField& Cp = tCp();
|
||||
const fvPatchScalarField& Cpw = Cp.boundaryField()[patchi];
|
||||
|
||||
// Saturation temperature
|
||||
const tmp<volScalarField> tTsat =
|
||||
fluid.saturation().Tsat(liquid.thermo().p());
|
||||
const volScalarField& Tsat = tTsat();
|
||||
const fvPatchScalarField& Tsatw(Tsat.boundaryField()[patchi]);
|
||||
const scalarField Tsatc(Tsatw.patchInternalField());
|
||||
|
||||
// Gravitational acceleration
|
||||
const uniformDimensionedVectorField& g =
|
||||
db().lookupObject<uniformDimensionedVectorField>("g");
|
||||
|
||||
const fvPatchScalarField& pw =
|
||||
liquid.thermo().p().boundaryField()[patchi];
|
||||
|
||||
const scalarField L
|
||||
(
|
||||
vapor.thermo().he(pw,Tsatc,patchi)-hew.patchInternalField()
|
||||
);
|
||||
|
||||
// Liquid temperature at y+=250 is estimated from logarithmic
|
||||
// thermal wall function (Koncar, Krepper & Egorov, 2005)
|
||||
scalarField Tplus_y250(Prt_*(log(E_*250)/kappa_ + P));
|
||||
scalarField Tplus(Prt_*(log(E_*yPlus)/kappa_ + P));
|
||||
scalarField Tl(Tw - (Tplus_y250/Tplus)*(Tw - Tc));
|
||||
Tl = max(Tc - 40, min(Tc, Tl));
|
||||
|
||||
// Nucleation site density:
|
||||
// Reformulation of Lemmert & Chawla (Egorov & Menter, 2004)
|
||||
const scalarField N
|
||||
(
|
||||
0.8*9.922e5*pow(max((Tw - Tsatw)/10, scalar(0)), 1.805)
|
||||
);
|
||||
|
||||
// Bubble departure diameter:
|
||||
// Tolubinski and Kostanchuk (1970)
|
||||
const scalarField Tsub(max(Tsatw - Tl, scalar(0)));
|
||||
const scalarField Ddep
|
||||
(
|
||||
max(min(0.0006*exp(-Tsub/45), scalar(0.0014)), scalar(1e-6))
|
||||
);
|
||||
|
||||
// Bubble departure frequency:
|
||||
// Cole (1960)
|
||||
const scalarField F
|
||||
(
|
||||
sqrt
|
||||
(
|
||||
4*mag(g).value()*(max(rhoc - rhoVaporp, scalar(0.1)))/(3*Ddep*rhow)
|
||||
)
|
||||
);
|
||||
|
||||
// Area fractions:
|
||||
|
||||
// Del Valle & Kenning (1985)
|
||||
const scalarField Ja(rhoc*Cpw*Tsub/(rhoVaporp*L));
|
||||
const scalarField Al(4.8*exp(-Ja/80));
|
||||
|
||||
// Liquid phase fraction at the wall
|
||||
const scalarField liquidw(liquid.boundaryField()[patchi]);
|
||||
|
||||
// Damp boiling at high void fractions.
|
||||
const scalarField W(min(liquidw/0.2, scalar(1)));
|
||||
|
||||
const scalarField A2(W*min(M_PI*sqr(Ddep)*N*Al/4, scalar(1)));
|
||||
const scalarField A1(max(1 - A2, scalar(1e-4)));
|
||||
const scalarField A2E(W*min(M_PI*sqr(Ddep)*N*Al/4, scalar(5)));
|
||||
|
||||
// Wall evaporation heat flux [kg/s3 = J/m2s]
|
||||
const scalarField Qe((1.0/6.0)*A2E*Ddep*rhoVaporw*F*L);
|
||||
|
||||
// Volumetric mass source in the near wall cell due to the wall boiling
|
||||
dmdt_ = (1 - relax_)*dmdt_ + relax_*Qe*AbyV_/L;
|
||||
|
||||
// Volumetric source in the near wall cell due to the wall boiling
|
||||
mDotL_ = dmdt_*L;
|
||||
|
||||
// Quenching heat transfer coefficient
|
||||
const scalarField hQ
|
||||
(
|
||||
2*(alphaw*Cpw)*F*sqrt((0.8/F)/(M_PI*alphaw/rhow))
|
||||
);
|
||||
|
||||
// Quenching heat flux
|
||||
const scalarField Qq(A2*hQ*max(Tw - Tl, scalar(0)));
|
||||
|
||||
// Convective heat flux
|
||||
alphatConv_ = calcAlphat(alphatConv_);
|
||||
//const scalarField Qc(A1*(alphatConv_ + alphaw)*hew.snGrad());
|
||||
|
||||
// Effective thermal diffusivity that corresponds to the calculated
|
||||
// convective, quenching and evaporative heat fluxes
|
||||
|
||||
operator==
|
||||
(
|
||||
A1*alphatConv_ + (Qq + Qe)/max(liquidw*hew.snGrad(), scalar(1e-16))
|
||||
);
|
||||
|
||||
if(debug)
|
||||
switch (phaseType_)
|
||||
{
|
||||
Info<< " L: " << gMin(L) << " - " << gMax(L) << endl;
|
||||
Info<< " Tl: " << gMin(Tl) << " - " << gMax(Tl) << endl;
|
||||
Info<< " N: " << gMin(N) << " - " << gMax(N) << endl;
|
||||
Info<< " Ddep: " << gMin(Ddep) << " - " << gMax(Ddep) << endl;
|
||||
Info<< " F: " << gMin(F) << " - " << gMax(F) << endl;
|
||||
Info<< " Al: " << gMin(Al) << " - " << gMax(Al) << endl;
|
||||
Info<< " A1: " << gMin(A1) << " - " << gMax(A1) << endl;
|
||||
Info<< " A2: " << gMin(A2) << " - " << gMax(A2) << endl;
|
||||
Info<< " A2E: " << gMin(A2E) << " - " << gMax(A2E) << endl;
|
||||
Info<< " dmdtW: " << gMin(dmdt_) << " - " << gMax(dmdt_) << endl;
|
||||
const scalarField Qc(A1*(alphatConv_ + alphaw)*hew.snGrad());
|
||||
Info<< " Qc: " << gMin(Qc) << " - " << gMax(Qc) << endl;
|
||||
Info<< " Qq: " << gMin(Qq) << " - " << gMax(Qq) << endl;
|
||||
Info<< " Qe: " << gMin(Qe) << " - " << gMax(Qe) << endl;
|
||||
const scalarField QEff(liquidw*(*this + alphaw)*hew.snGrad());
|
||||
Info<< " QEff: " << gMin(QEff) << " - " << gMax(QEff) << endl;
|
||||
Info<< " alphat: " << gMin(*this) << " - " << gMax(*this) << endl;
|
||||
Info<< " alphatConv: " << gMin(alphatConv_)
|
||||
<< " - " << gMax(alphatConv_) << endl;
|
||||
case vaporPhase:
|
||||
{
|
||||
const phaseModel& vapor
|
||||
(
|
||||
fluid.phase1().name() == internalField().group()
|
||||
? fluid.phase1()
|
||||
: fluid.phase2()
|
||||
);
|
||||
|
||||
const phaseModel& liquid(fluid.otherPhase(vapor));
|
||||
|
||||
// Liquid phase fraction at the wall
|
||||
const scalarField liquidw(liquid.boundaryField()[patchi]);
|
||||
|
||||
// Vapor Liquid phase fraction at the wall
|
||||
const scalarField vaporw(vapor.boundaryField()[patchi]);
|
||||
|
||||
const scalarField fLiquid
|
||||
(
|
||||
partitioningModel_->fLiquid(liquidw)
|
||||
);
|
||||
|
||||
operator==
|
||||
(
|
||||
calcAlphat(*this)*(1 - fLiquid)/max(vaporw, scalar(1e-8))
|
||||
);
|
||||
break;
|
||||
}
|
||||
case liquidPhase:
|
||||
{
|
||||
// Check that nucleationSiteModel has been constructed
|
||||
if (!nucleationSiteModel_.valid())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "nucleationSiteModel has not been constructed!"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
// Check that departureDiameterModel has been constructed
|
||||
if (!departureDiamModel_.valid())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "departureDiameterModel has not been constructed!"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
// Check that nucleationSiteModel has been constructed
|
||||
if (!departureFreqModel_.valid())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "departureFrequencyModel has not been constructed!"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
const phaseModel& liquid
|
||||
(
|
||||
fluid.phase1().name() == internalField().group()
|
||||
? fluid.phase1()
|
||||
: fluid.phase2()
|
||||
);
|
||||
|
||||
const phaseModel& vapor(fluid.otherPhase(liquid));
|
||||
|
||||
// Retrieve turbulence properties from model
|
||||
const phaseCompressibleTurbulenceModel& turbModel =
|
||||
liquid.turbulence();
|
||||
|
||||
const tmp<scalarField> tnutw = turbModel.nut(patchi);
|
||||
|
||||
const scalar Cmu25(pow025(Cmu_));
|
||||
|
||||
const scalarField& y = turbModel.y()[patchi];
|
||||
|
||||
const tmp<scalarField> tmuw = turbModel.mu(patchi);
|
||||
const scalarField& muw = tmuw();
|
||||
|
||||
const tmp<scalarField> talphaw = liquid.thermo().alpha(patchi);
|
||||
const scalarField& alphaw = talphaw();
|
||||
|
||||
const tmp<volScalarField> tk = turbModel.k();
|
||||
const volScalarField& k = tk();
|
||||
const fvPatchScalarField& kw = k.boundaryField()[patchi];
|
||||
|
||||
const fvPatchVectorField& Uw =
|
||||
turbModel.U().boundaryField()[patchi];
|
||||
const scalarField magUp(mag(Uw.patchInternalField() - Uw));
|
||||
const scalarField magGradUw(mag(Uw.snGrad()));
|
||||
|
||||
const fvPatchScalarField& rhow =
|
||||
turbModel.rho().boundaryField()[patchi];
|
||||
const fvPatchScalarField& hew =
|
||||
liquid.thermo().he().boundaryField()[patchi];
|
||||
|
||||
const fvPatchScalarField& Tw =
|
||||
liquid.thermo().T().boundaryField()[patchi];
|
||||
const scalarField Tc(Tw.patchInternalField());
|
||||
|
||||
const scalarField uTau(Cmu25*sqrt(kw));
|
||||
|
||||
const scalarField yPlus(uTau*y/(muw/rhow));
|
||||
|
||||
const scalarField Pr(muw/alphaw);
|
||||
|
||||
// Molecular-to-turbulent Prandtl number ratio
|
||||
const scalarField Prat(Pr/Prt_);
|
||||
|
||||
// Thermal sublayer thickness
|
||||
const scalarField P(this->Psmooth(Prat));
|
||||
|
||||
const scalarField yPlusTherm(this->yPlusTherm(P, Prat));
|
||||
|
||||
const fvPatchScalarField& rhoLiquidw =
|
||||
liquid.turbulence().rho().boundaryField()[patchi];
|
||||
|
||||
const fvPatchScalarField& rhoVaporw =
|
||||
vapor.turbulence().rho().boundaryField()[patchi];
|
||||
|
||||
tmp<volScalarField> tCp = liquid.thermo().Cp();
|
||||
const volScalarField& Cp = tCp();
|
||||
const fvPatchScalarField& Cpw = Cp.boundaryField()[patchi];
|
||||
|
||||
// Saturation temperature
|
||||
const tmp<volScalarField> tTsat =
|
||||
fluid.saturation().Tsat(liquid.thermo().p());
|
||||
const volScalarField& Tsat = tTsat();
|
||||
const fvPatchScalarField& Tsatw(Tsat.boundaryField()[patchi]);
|
||||
const scalarField Tsatc(Tsatw.patchInternalField());
|
||||
|
||||
const fvPatchScalarField& pw =
|
||||
liquid.thermo().p().boundaryField()[patchi];
|
||||
|
||||
const scalarField L
|
||||
(
|
||||
vapor.thermo().he(pw,Tsatc,patchi)-hew.patchInternalField()
|
||||
);
|
||||
|
||||
// Liquid phase fraction at the wall
|
||||
const scalarField liquidw(liquid.boundaryField()[patchi]);
|
||||
|
||||
const scalarField fLiquid(partitioningModel_->fLiquid(liquidw));
|
||||
|
||||
// Convective thermal diffusivity
|
||||
alphatConv_ = calcAlphat(alphatConv_);
|
||||
|
||||
for (label i=0; i<10; i++)
|
||||
{
|
||||
// Liquid temperature at y+=250 is estimated from logarithmic
|
||||
// thermal wall function (Koncar, Krepper & Egorov, 2005)
|
||||
const scalarField Tplus_y250(Prt_*(log(E_*250)/kappa_ + P));
|
||||
|
||||
const scalarField Tplus(Prt_*(log(E_*yPlus)/kappa_ + P));
|
||||
scalarField Tl(Tw - (Tplus_y250/Tplus)*(Tw - Tc));
|
||||
Tl = max(Tc - 40, min(Tc, Tl));
|
||||
const scalarField Tsub(max(Tsatw - Tl, scalar(0)));
|
||||
|
||||
// Wall heat flux partitioning
|
||||
const scalarField fLiquid
|
||||
(
|
||||
partitioningModel_->fLiquid(liquidw)
|
||||
);
|
||||
|
||||
// Nucleation site density:
|
||||
const scalarField N
|
||||
(
|
||||
nucleationSiteModel_->N
|
||||
(
|
||||
liquid,
|
||||
vapor,
|
||||
patchi,
|
||||
Tsatw
|
||||
)
|
||||
);
|
||||
|
||||
// Bubble departure diameter:
|
||||
dDep_ = departureDiamModel_->dDeparture
|
||||
(
|
||||
liquid,
|
||||
vapor,
|
||||
patchi,
|
||||
Tsub
|
||||
);
|
||||
|
||||
// Bubble departure frequency:
|
||||
const scalarField fDep
|
||||
(
|
||||
departureFreqModel_->fDeparture
|
||||
(
|
||||
liquid,
|
||||
vapor,
|
||||
patchi,
|
||||
dDep_
|
||||
)
|
||||
);
|
||||
|
||||
// Area fractions:
|
||||
|
||||
// Del Valle & Kenning (1985)
|
||||
const scalarField Ja(rhoLiquidw*Cpw*Tsub/(rhoVaporw*L));
|
||||
const scalarField Al(fLiquid*4.8*exp(-Ja/80));
|
||||
|
||||
const scalarField A2(min(M_PI*sqr(dDep_)*N*Al/4, scalar(1)));
|
||||
const scalarField A1(max(1 - A2, scalar(1e-4)));
|
||||
const scalarField A2E(min(M_PI*sqr(dDep_)*N*Al/4, scalar(5)));
|
||||
|
||||
// Wall evaporation heat flux [kg/s3 = J/m2s]
|
||||
const scalarField Qe((1.0/6.0)*A2E*dDep_*rhoVaporw*fDep*L);
|
||||
|
||||
// Volumetric mass source in the near wall cell due to the
|
||||
// wall boiling
|
||||
dmdt_ = (1 - relax_)*dmdt_ + relax_*Qe*AbyV_/L;
|
||||
|
||||
// Volumetric source in the near wall cell due to the wall
|
||||
// boiling
|
||||
mDotL_ = dmdt_*L;
|
||||
|
||||
// Quenching heat transfer coefficient
|
||||
const scalarField hQ
|
||||
(
|
||||
2*(alphaw*Cpw)*fDep*sqrt((0.8/fDep)/(M_PI*alphaw/rhow))
|
||||
);
|
||||
|
||||
// Quenching heat flux
|
||||
const scalarField Qq(A2*hQ*max(Tw - Tl, scalar(0)));
|
||||
|
||||
// Effective thermal diffusivity that corresponds to the
|
||||
// calculated convective, quenching and evaporative heat fluxes
|
||||
|
||||
operator==
|
||||
(
|
||||
(
|
||||
A1*alphatConv_
|
||||
+ (Qq + Qe)/max(hew.snGrad(), scalar(1e-16))
|
||||
)
|
||||
/max(liquidw, scalar(1e-8))
|
||||
);
|
||||
|
||||
scalarField TsupPrev(max((Tw - Tsatw),scalar(0)));
|
||||
const_cast<fvPatchScalarField&>(Tw).evaluate();
|
||||
scalarField TsupNew(max((Tw - Tsatw),scalar(0)));
|
||||
|
||||
scalar maxErr(max(mag(TsupPrev - TsupNew)));
|
||||
|
||||
if (maxErr < 1e-1)
|
||||
{
|
||||
if (i > 0)
|
||||
{
|
||||
Info<< "Wall boiling wall function iterations: "
|
||||
<< i + 1 << endl;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (debug)
|
||||
{
|
||||
const scalarField Qc
|
||||
(
|
||||
fLiquid*A1*(alphatConv_ + alphaw)*hew.snGrad()
|
||||
);
|
||||
|
||||
const scalarField QEff
|
||||
(
|
||||
liquidw*(*this + alphaw)*hew.snGrad()
|
||||
);
|
||||
|
||||
Info<< " L: " << gMin(L) << " - " << gMax(L) << endl;
|
||||
Info<< " Tl: " << gMin(Tl) << " - " << gMax(Tl) << endl;
|
||||
Info<< " N: " << gMin(N) << " - " << gMax(N) << endl;
|
||||
Info<< " dDep_: " << gMin(dDep_) << " - "
|
||||
<< gMax(dDep_) << endl;
|
||||
Info<< " fDep: " << gMin(fDep) << " - "
|
||||
<< gMax(fDep) << endl;
|
||||
Info<< " Al: " << gMin(Al) << " - " << gMax(Al) << endl;
|
||||
Info<< " A1: " << gMin(A1) << " - " << gMax(A1) << endl;
|
||||
Info<< " A2: " << gMin(A2) << " - " << gMax(A2) << endl;
|
||||
Info<< " A2E: " << gMin(A2E) << " - "
|
||||
<< gMax(A2E) << endl;
|
||||
Info<< " dmdtW: " << gMin(dmdt_) << " - "
|
||||
<< gMax(dmdt_) << endl;
|
||||
Info<< " Qc: " << gMin(Qc) << " - " << gMax(Qc) << endl;
|
||||
Info<< " Qq: " << gMin(fLiquid*Qq) << " - "
|
||||
<< gMax(fLiquid*Qq) << endl;
|
||||
Info<< " Qe: " << gMin(fLiquid*Qe) << " - "
|
||||
<< gMax(fLiquid*Qe) << endl;
|
||||
Info<< " QEff: " << gMin(QEff) << " - "
|
||||
<< gMax(QEff) << endl;
|
||||
Info<< " alphat: " << gMin(*this) << " - "
|
||||
<< gMax(*this) << endl;
|
||||
Info<< " alphatConv: " << gMin(alphatConv_)
|
||||
<< " - " << gMax(alphatConv_) << endl;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unknown phase type. Valid types are: "
|
||||
<< phaseTypeNames_ << nl << exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
fixedValueFvPatchScalarField::updateCoeffs();
|
||||
@ -365,7 +585,47 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs()
|
||||
void alphatWallBoilingWallFunctionFvPatchScalarField::write(Ostream& os) const
|
||||
{
|
||||
fvPatchField<scalar>::write(os);
|
||||
|
||||
os.writeKeyword("phaseType") << phaseTypeNames_[phaseType_]
|
||||
<< token::END_STATEMENT << nl;
|
||||
|
||||
os.writeKeyword("relax") << relax_ << token::END_STATEMENT << nl;
|
||||
|
||||
switch (phaseType_)
|
||||
{
|
||||
case vaporPhase:
|
||||
{
|
||||
os.writeKeyword("partitioningModel") << nl;
|
||||
os << indent << token::BEGIN_BLOCK << incrIndent << nl;
|
||||
partitioningModel_->write(os);
|
||||
os << decrIndent << indent << token::END_BLOCK << nl;
|
||||
break;
|
||||
}
|
||||
case liquidPhase:
|
||||
{
|
||||
os.writeKeyword("partitioningModel") << nl;
|
||||
os << indent << token::BEGIN_BLOCK << incrIndent << nl;
|
||||
partitioningModel_->write(os);
|
||||
os << decrIndent << indent << token::END_BLOCK << nl;
|
||||
|
||||
os.writeKeyword("nucleationSiteModel") << nl;
|
||||
os << indent << token::BEGIN_BLOCK << incrIndent << nl;
|
||||
nucleationSiteModel_->write(os);
|
||||
os << decrIndent << indent << token::END_BLOCK << nl;
|
||||
|
||||
os.writeKeyword("departureDiamModel") << nl;
|
||||
os << indent << token::BEGIN_BLOCK << incrIndent << nl;
|
||||
departureDiamModel_->write(os);
|
||||
os << decrIndent << indent << token::END_BLOCK << nl;
|
||||
|
||||
os.writeKeyword("departureFreqModel") << nl;
|
||||
os << indent << token::BEGIN_BLOCK << incrIndent << nl;
|
||||
departureFreqModel_->write(os);
|
||||
os << decrIndent << indent << token::END_BLOCK << nl;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
dmdt_.writeEntry("dmdt", os);
|
||||
alphatConv_.writeEntry("alphatConv", os);
|
||||
writeEntry("value", os);
|
||||
|
||||
@ -28,11 +28,17 @@ Group
|
||||
grpCmpWallFunctions
|
||||
|
||||
Description
|
||||
A thermal wall function for simulation of subcooled nucleate wall boiling.
|
||||
A thermal wall function for simulation of subcooled nucleate wall boiling
|
||||
with runtime selctable submodels for:
|
||||
- wall heat flux partitioning model
|
||||
- nucleation site density
|
||||
- bubble departure frequency
|
||||
- bubble departure diameter
|
||||
|
||||
Implements a version of the well-known RPI wall boiling model
|
||||
(Kurul & Podowski, 1991). The model implementation is similar to the model
|
||||
described by Peltola & Pättikangas (2012).
|
||||
described by Peltola & Pättikangas (2012) but has been extended with the
|
||||
wall heat flux partitioning models.
|
||||
|
||||
References:
|
||||
\verbatim
|
||||
@ -51,8 +57,66 @@ Description
|
||||
Daejeon, Korea, September 10-12 2012
|
||||
\endverbatim
|
||||
|
||||
See also
|
||||
Foam::fixedValueFvPatchField
|
||||
Usage
|
||||
\table
|
||||
Property | Description | Required | Default value
|
||||
phaseType | 'vapor' or 'liquid' | yes |
|
||||
relax |wall boiling model relaxation| yes |
|
||||
Prt | inherited from alphatPhaseChangeJayatillekeWallFunction
|
||||
Cmu | inherited from alphatPhaseChangeJayatillekeWallFunction
|
||||
kappa | inherited from alphatPhaseChangeJayatillekeWallFunction
|
||||
E | inherited from alphatPhaseChangeJayatillekeWallFunction
|
||||
dmdt | phase change mass flux | yes |
|
||||
value | initial alphat value | yes |
|
||||
|
||||
if phaseType 'vapor':
|
||||
|
||||
partitioningModel| | yes |
|
||||
|
||||
if phaseType 'liquid':
|
||||
|
||||
partitioningModel| | yes |
|
||||
nucleationSiteModel| | yes |
|
||||
departureDiamModel| | yes |
|
||||
departureFreqModel| | yes |
|
||||
\endtable
|
||||
|
||||
NOTE: Runtime selectabale submodels may require model specific entries
|
||||
|
||||
Example usage:
|
||||
\verbatim
|
||||
hotWall
|
||||
{
|
||||
type compressible::alphatWallBoiling2WallFunction;
|
||||
phaseType liquid;
|
||||
Prt 0.85;
|
||||
Cmu 0.09;
|
||||
kappa 0.41;
|
||||
E 9.8;
|
||||
relax 0.001;
|
||||
dmdt uniform 0;
|
||||
partitioningModel
|
||||
{
|
||||
type Lavieville;
|
||||
alphaCrit 0.2;
|
||||
}
|
||||
nucleationSiteModel
|
||||
{
|
||||
type LemmertChawla;
|
||||
}
|
||||
departureDiamModel
|
||||
{
|
||||
type TolubinskiKostanchuk;
|
||||
}
|
||||
departureFreqModel
|
||||
{
|
||||
type Cole;
|
||||
}
|
||||
value uniform 0.01;
|
||||
\endverbatim
|
||||
|
||||
SeeAlso
|
||||
Foam::alphatPhaseChangeJayatillekeWallFunctionFvPatchField
|
||||
|
||||
SourceFiles
|
||||
alphatWallBoilingWallFunctionFvPatchScalarField.C
|
||||
@ -63,6 +127,10 @@ SourceFiles
|
||||
#define compressiblealphatWallBoilingWallFunctionFvPatchScalarField_H
|
||||
|
||||
#include "alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.H"
|
||||
#include "partitioningModel.H"
|
||||
#include "nucleationSiteModel.H"
|
||||
#include "departureDiameterModel.H"
|
||||
#include "departureFrequencyModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -79,8 +147,28 @@ class alphatWallBoilingWallFunctionFvPatchScalarField
|
||||
:
|
||||
public alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField
|
||||
{
|
||||
public:
|
||||
|
||||
// Data types
|
||||
|
||||
//- Enumeration listing the possible operational modes
|
||||
enum phaseType
|
||||
{
|
||||
vaporPhase,
|
||||
liquidPhase
|
||||
};
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Private data
|
||||
|
||||
//- Heat source type names
|
||||
static const NamedEnum<phaseType, 2> phaseTypeNames_;
|
||||
|
||||
//- Heat source type
|
||||
phaseType phaseType_;
|
||||
|
||||
//- dmdt relaxationFactor
|
||||
scalar relax_;
|
||||
|
||||
@ -90,6 +178,25 @@ class alphatWallBoilingWallFunctionFvPatchScalarField
|
||||
//- Convective turbulent thermal diffusivity
|
||||
scalarField alphatConv_;
|
||||
|
||||
//- Departure diameter field
|
||||
scalarField dDep_;
|
||||
|
||||
//- Run-time selected heat flux partitioning model
|
||||
autoPtr<wallBoilingModels::partitioningModel>
|
||||
partitioningModel_;
|
||||
|
||||
//- Run-time selected nucleation site density model
|
||||
autoPtr<wallBoilingModels::nucleationSiteModel>
|
||||
nucleationSiteModel_;
|
||||
|
||||
//- Run-time selected bubble departure diameter model
|
||||
autoPtr<wallBoilingModels::departureDiameterModel>
|
||||
departureDiamModel_;
|
||||
|
||||
//- Run-time selected bubble departure frequency model
|
||||
autoPtr<wallBoilingModels::departureFrequencyModel>
|
||||
departureFreqModel_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@ -162,6 +269,13 @@ public:
|
||||
|
||||
// Member functions
|
||||
|
||||
//- Calculate and return the departure diameter field
|
||||
const scalarField& dDeparture() const
|
||||
{
|
||||
return dDep_;
|
||||
}
|
||||
|
||||
|
||||
// Evaluation functions
|
||||
|
||||
//- Update the coefficients associated with the patch field
|
||||
|
||||
@ -0,0 +1,145 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "wallBoiling.H"
|
||||
#include "phaseCompressibleTurbulenceModel.H"
|
||||
#include "alphatWallBoilingWallFunctionFvPatchScalarField.H"
|
||||
#include "fvmSup.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace diameterModels
|
||||
{
|
||||
namespace IATEsources
|
||||
{
|
||||
defineTypeNameAndDebug(wallBoiling, 0);
|
||||
addToRunTimeSelectionTable(IATEsource, wallBoiling, dictionary);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::diameterModels::IATEsources::wallBoiling::wallBoiling
|
||||
(
|
||||
const IATE& iate,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
IATEsource(iate)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::fvScalarMatrix>
|
||||
Foam::diameterModels::IATEsources::wallBoiling::R
|
||||
(
|
||||
const volScalarField& alphai,
|
||||
volScalarField& kappai
|
||||
) const
|
||||
{
|
||||
volScalarField::Internal R
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"wallBoiling:R",
|
||||
phase().time().timeName(),
|
||||
phase().mesh()
|
||||
),
|
||||
phase().mesh(),
|
||||
dimensionedScalar("R", dimless/dimTime, 0)
|
||||
);
|
||||
|
||||
volScalarField::Internal Rdk
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"wallBoiling:Rdk",
|
||||
phase().time().timeName(),
|
||||
phase().mesh()
|
||||
),
|
||||
phase().mesh(),
|
||||
dimensionedScalar("Rdk", kappai.dimensions()/dimTime, 0)
|
||||
);
|
||||
|
||||
const phaseCompressibleTurbulenceModel& turbulence =
|
||||
const_cast<phaseCompressibleTurbulenceModel&>
|
||||
(
|
||||
phase().db().lookupObject<phaseCompressibleTurbulenceModel>
|
||||
(
|
||||
IOobject::groupName
|
||||
(
|
||||
turbulenceModel::propertiesName,
|
||||
otherPhase().name()
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
const tmp<volScalarField> talphat(turbulence.alphat());
|
||||
const volScalarField::Boundary& alphatBf = talphat().boundaryField();
|
||||
|
||||
const scalarField& rho = phase().rho();
|
||||
|
||||
typedef compressible::alphatWallBoilingWallFunctionFvPatchScalarField
|
||||
alphatWallBoilingWallFunction;
|
||||
|
||||
forAll(alphatBf, patchi)
|
||||
{
|
||||
if
|
||||
(
|
||||
isA<alphatWallBoilingWallFunction>(alphatBf[patchi])
|
||||
)
|
||||
{
|
||||
const alphatWallBoilingWallFunction& alphatw =
|
||||
refCast<const alphatWallBoilingWallFunction>(alphatBf[patchi]);
|
||||
|
||||
const scalarField& dmdt = alphatw.dmdt();
|
||||
const scalarField& dDep = alphatw.dDeparture();
|
||||
|
||||
const labelList& faceCells = alphatw.patch().faceCells();
|
||||
|
||||
forAll(alphatw, facei)
|
||||
{
|
||||
if (dmdt[facei] > SMALL)
|
||||
{
|
||||
const label faceCelli = faceCells[facei];
|
||||
R[faceCelli] =
|
||||
dmdt[facei]/(alphai[faceCelli]*rho[faceCelli]);
|
||||
Rdk[faceCelli] = R[faceCelli]*(6.0/dDep[facei]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return Rdk - fvm::Sp(R, kappai);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,98 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::diameterModels::IATEsources::wallBoiling
|
||||
|
||||
Description
|
||||
Wall-boiling IATE source.
|
||||
|
||||
SourceFiles
|
||||
wallBoiling.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef wallBoiling_H
|
||||
#define wallBoiling_H
|
||||
|
||||
#include "IATEsource.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace diameterModels
|
||||
{
|
||||
namespace IATEsources
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class wallBoiling Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class wallBoiling
|
||||
:
|
||||
public IATEsource
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("wallBoiling");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
wallBoiling
|
||||
(
|
||||
const IATE& iate,
|
||||
const dictionary& dict
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~wallBoiling()
|
||||
{}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
virtual tmp<fvScalarMatrix> R
|
||||
(
|
||||
const volScalarField& alphai,
|
||||
volScalarField& kappai
|
||||
) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace IATEsources
|
||||
} // End namespace diameterModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,119 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "KocamustafaogullariIshii.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "uniformDimensionedFields.H"
|
||||
#include "compressibleTurbulenceModel.H"
|
||||
#include "ThermalDiffusivity.H"
|
||||
#include "PhaseCompressibleTurbulenceModel.H"
|
||||
#include "phaseSystem.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace wallBoilingModels
|
||||
{
|
||||
namespace departureDiameterModels
|
||||
{
|
||||
defineTypeNameAndDebug(KocamustafaogullariIshii, 0);
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
departureDiameterModel,
|
||||
KocamustafaogullariIshii,
|
||||
dictionary
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::wallBoilingModels::departureDiameterModels::
|
||||
KocamustafaogullariIshii::KocamustafaogullariIshii
|
||||
(
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
departureDiameterModel(),
|
||||
phi_(readScalar(dict.lookup("phi")))
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::wallBoilingModels::departureDiameterModels::
|
||||
KocamustafaogullariIshii::~KocamustafaogullariIshii()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::scalarField>
|
||||
Foam::wallBoilingModels::departureDiameterModels::
|
||||
KocamustafaogullariIshii::dDeparture
|
||||
(
|
||||
const phaseModel& liquid,
|
||||
const phaseModel& vapor,
|
||||
const label patchi,
|
||||
const scalarField& Tsub
|
||||
) const
|
||||
{
|
||||
// Gravitational acceleration
|
||||
const uniformDimensionedVectorField& g =
|
||||
liquid.mesh().lookupObject<uniformDimensionedVectorField>("g");
|
||||
|
||||
const fvPatchScalarField& rhoLiquid =
|
||||
liquid.turbulence().rho().boundaryField()[patchi];
|
||||
|
||||
const fvPatchScalarField& rhoVapor =
|
||||
vapor.turbulence().rho().boundaryField()[patchi];
|
||||
|
||||
const scalarField rhoM((rhoLiquid-rhoVapor)/rhoVapor);
|
||||
|
||||
const tmp<volScalarField>& tsigma
|
||||
(
|
||||
liquid.fluid().sigma(phasePairKey(liquid.name(),vapor.name()))
|
||||
);
|
||||
const volScalarField& sigma = tsigma();
|
||||
const fvPatchScalarField& sigmaw = sigma.boundaryField()[patchi];
|
||||
|
||||
return
|
||||
0.0012*pow(rhoM,0.9)*0.0208*phi_
|
||||
*sqrt(sigmaw/(mag(g.value())*(rhoLiquid-rhoVapor)));
|
||||
}
|
||||
|
||||
|
||||
void Foam::wallBoilingModels::departureDiameterModels::
|
||||
KocamustafaogullariIshii::write(Ostream& os) const
|
||||
{
|
||||
departureDiameterModel::write(os);
|
||||
os.writeKeyword("phi") << phi_ << token::END_STATEMENT << nl;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,112 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::wallBoilingModels::departureDiameterModels::KocamustafaogullariIshii
|
||||
|
||||
Description
|
||||
A correlation for bubble departure diameter.
|
||||
|
||||
Requires model parameter 'phi': contact angle in degrees.
|
||||
|
||||
Reference:
|
||||
\verbatim
|
||||
Kocamustafaogullari, G., & Ishii, M. (1983).
|
||||
Interfacial area and nucleation site density in boiling systems.
|
||||
International Journal of Heat and Mass Transfer, 26(9), 1377-1387.
|
||||
\endverbatim
|
||||
|
||||
SourceFiles
|
||||
KocamustafaogullariIshii.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef KocamustafaogullariIshii_H
|
||||
#define KocamustafaogullariIshii_H
|
||||
|
||||
#include "departureDiameterModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace wallBoilingModels
|
||||
{
|
||||
namespace departureDiameterModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class KocamustafaogullariIshii Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class KocamustafaogullariIshii
|
||||
:
|
||||
public departureDiameterModel
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Contact angle
|
||||
scalar phi_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("KocamustafaogullariIshii");
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from a dictionary
|
||||
KocamustafaogullariIshii(const dictionary& dict);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~KocamustafaogullariIshii();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Calculate and return the departure diameter field
|
||||
virtual tmp<scalarField> dDeparture
|
||||
(
|
||||
const phaseModel& liquid,
|
||||
const phaseModel& vapor,
|
||||
const label patchi,
|
||||
const scalarField& Tsub
|
||||
) const;
|
||||
|
||||
virtual void write(Ostream& os) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace departureDiameterModels
|
||||
} // End namespace wallBoilingModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,84 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "TolubinskiKostanchuk.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace wallBoilingModels
|
||||
{
|
||||
namespace departureDiameterModels
|
||||
{
|
||||
defineTypeNameAndDebug(TolubinskiKostanchuk, 0);
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
departureDiameterModel,
|
||||
TolubinskiKostanchuk,
|
||||
dictionary
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::wallBoilingModels::departureDiameterModels::
|
||||
TolubinskiKostanchuk::TolubinskiKostanchuk
|
||||
(
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
departureDiameterModel()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::wallBoilingModels::departureDiameterModels::
|
||||
TolubinskiKostanchuk::~TolubinskiKostanchuk()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::scalarField>
|
||||
Foam::wallBoilingModels::departureDiameterModels::
|
||||
TolubinskiKostanchuk::dDeparture
|
||||
(
|
||||
const phaseModel& liquid,
|
||||
const phaseModel& vapor,
|
||||
const label patchi,
|
||||
const scalarField& Tsub
|
||||
) const
|
||||
{
|
||||
return max(min(0.0006*exp(-Tsub/45), scalar(0.0014)), scalar(1e-6));
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,105 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::wallBoilingModels::departureDiameterModels::TolubinskiKostanchuk
|
||||
|
||||
Description
|
||||
Tolubinski-Kostanchuk correlation for bubble departure diameter.
|
||||
|
||||
Reference:
|
||||
\verbatim
|
||||
Tolubinsky, V. I., & Kostanchuk, D. M. (1970).
|
||||
Vapour bubbles growth rate and heat transfer intensity at subcooled
|
||||
water boiling.
|
||||
In International Heat Transfer Conference 4 (Vol. 23). Begel House Inc.
|
||||
\endverbatim
|
||||
|
||||
SourceFiles
|
||||
TolubinskiKostanchuk.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef TolubinskiKostanchuk_H
|
||||
#define TolubinskiKostanchuk_H
|
||||
|
||||
#include "departureDiameterModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace wallBoilingModels
|
||||
{
|
||||
namespace departureDiameterModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class TolubinskiKostanchuk Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class TolubinskiKostanchuk
|
||||
:
|
||||
public departureDiameterModel
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("TolubinskiKostanchuk");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from a dictionary
|
||||
TolubinskiKostanchuk(const dictionary& dict);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~TolubinskiKostanchuk();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Calculate and return the departure diameter field
|
||||
virtual tmp<scalarField> dDeparture
|
||||
(
|
||||
const phaseModel& liquid,
|
||||
const phaseModel& vapor,
|
||||
const label patchi,
|
||||
const scalarField& Tsub
|
||||
) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace departureDiameterModels
|
||||
} // End namespace wallBoilingModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,59 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "departureDiameterModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace wallBoilingModels
|
||||
{
|
||||
defineTypeNameAndDebug(departureDiameterModel, 0);
|
||||
defineRunTimeSelectionTable(departureDiameterModel, dictionary);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::wallBoilingModels::departureDiameterModel::departureDiameterModel()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::wallBoilingModels::departureDiameterModel::~departureDiameterModel()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::wallBoilingModels::departureDiameterModel::write(Ostream& os) const
|
||||
{
|
||||
os.writeKeyword("type") << this->type() << token::END_STATEMENT << nl;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,125 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::departureDiameterModel
|
||||
|
||||
Description
|
||||
Base class for bubble departure diameter models
|
||||
|
||||
SourceFiles
|
||||
departureDiameterModel.C
|
||||
newdepartureDiameterModel.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef departureDiameterModel_H
|
||||
#define departureDiameterModel_H
|
||||
|
||||
#include "volFields.H"
|
||||
#include "dictionary.H"
|
||||
#include "runTimeSelectionTables.H"
|
||||
|
||||
#include "phaseModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace wallBoilingModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class departureDiameterModel Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class departureDiameterModel
|
||||
{
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
departureDiameterModel(const departureDiameterModel&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const departureDiameterModel&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("departureDiameterModel");
|
||||
|
||||
|
||||
//- Declare runtime construction
|
||||
declareRunTimeSelectionTable
|
||||
(
|
||||
autoPtr,
|
||||
departureDiameterModel,
|
||||
dictionary,
|
||||
(
|
||||
const dictionary& dict
|
||||
),
|
||||
(dict)
|
||||
);
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct null
|
||||
departureDiameterModel();
|
||||
|
||||
|
||||
// Selectors
|
||||
|
||||
//- Select null constructed
|
||||
static autoPtr<departureDiameterModel> New(const dictionary& dict);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~departureDiameterModel();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Calculate and return the departure diameter field
|
||||
virtual tmp<scalarField> dDeparture
|
||||
(
|
||||
const phaseModel& liquid,
|
||||
const phaseModel& vapor,
|
||||
const label patchi,
|
||||
const scalarField& Tsub
|
||||
) const = 0;
|
||||
|
||||
virtual void write(Ostream& os) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
} // End namespace wallBoilingModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,58 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "departureDiameterModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::autoPtr<Foam::wallBoilingModels::departureDiameterModel>
|
||||
Foam::wallBoilingModels::departureDiameterModel::New
|
||||
(
|
||||
const dictionary& dict
|
||||
)
|
||||
{
|
||||
word departureDiameterModelType(dict.lookup("type"));
|
||||
|
||||
Info<< "Selecting departureDiameterModel: "
|
||||
<< departureDiameterModelType << endl;
|
||||
|
||||
dictionaryConstructorTable::iterator cstrIter =
|
||||
dictionaryConstructorTablePtr_->find(departureDiameterModelType);
|
||||
|
||||
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unknown departureDiameterModelType type "
|
||||
<< departureDiameterModelType << endl << endl
|
||||
<< "Valid departureDiameterModel types are : " << endl
|
||||
<< dictionaryConstructorTablePtr_->sortedToc()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
return cstrIter()(dict);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,100 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "Cole.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "uniformDimensionedFields.H"
|
||||
#include "compressibleTurbulenceModel.H"
|
||||
#include "ThermalDiffusivity.H"
|
||||
#include "PhaseCompressibleTurbulenceModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace wallBoilingModels
|
||||
{
|
||||
namespace departureFrequencyModels
|
||||
{
|
||||
defineTypeNameAndDebug(Cole, 0);
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
departureFrequencyModel,
|
||||
Cole,
|
||||
dictionary
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::wallBoilingModels::departureFrequencyModels::
|
||||
Cole::Cole(const dictionary& dict)
|
||||
:
|
||||
departureFrequencyModel()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::wallBoilingModels::departureFrequencyModels::
|
||||
Cole::~Cole()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::scalarField>
|
||||
Foam::wallBoilingModels::departureFrequencyModels::
|
||||
Cole::fDeparture
|
||||
(
|
||||
const phaseModel& liquid,
|
||||
const phaseModel& vapor,
|
||||
const label patchi,
|
||||
const scalarField& dDep
|
||||
) const
|
||||
{
|
||||
// Gravitational acceleration
|
||||
const uniformDimensionedVectorField& g =
|
||||
liquid.mesh().lookupObject<uniformDimensionedVectorField>("g");
|
||||
|
||||
const fvPatchScalarField& rhoLiquid =
|
||||
liquid.turbulence().rho().boundaryField()[patchi];
|
||||
|
||||
const fvPatchScalarField& rhoVapor =
|
||||
vapor.turbulence().rho().boundaryField()[patchi];
|
||||
|
||||
return sqrt
|
||||
(
|
||||
4*mag(g).value()
|
||||
*max(rhoLiquid - rhoVapor, scalar(0.1))
|
||||
/(3*dDep*rhoLiquid)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,105 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::wallBoilingModels::departureFrequencyModels::Cole
|
||||
|
||||
Description
|
||||
Cole correlation for bubble departure frequency.
|
||||
|
||||
Reference:
|
||||
\verbatim
|
||||
Cole, R. (1960).
|
||||
A photographic study of pool boiling in the region of the
|
||||
critical heat flux.
|
||||
AIChE Journal, 6(4), 533-538.
|
||||
\endverbatim
|
||||
|
||||
SourceFiles
|
||||
Cole.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef Cole_H
|
||||
#define Cole_H
|
||||
|
||||
#include "departureFrequencyModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace wallBoilingModels
|
||||
{
|
||||
namespace departureFrequencyModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class Cole Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class Cole
|
||||
:
|
||||
public departureFrequencyModel
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("Cole");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from a dictionary
|
||||
Cole(const dictionary& dict);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~Cole();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Calculate and return the bubble departure frequency
|
||||
virtual tmp<scalarField> fDeparture
|
||||
(
|
||||
const phaseModel& liquid,
|
||||
const phaseModel& vapor,
|
||||
const label patchi,
|
||||
const scalarField& dDep
|
||||
) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace departureFrequencyModels
|
||||
} // End namespace wallBoilingModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,60 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "departureFrequencyModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace wallBoilingModels
|
||||
{
|
||||
defineTypeNameAndDebug(departureFrequencyModel, 0);
|
||||
defineRunTimeSelectionTable(departureFrequencyModel, dictionary);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::wallBoilingModels::departureFrequencyModel::departureFrequencyModel()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::wallBoilingModels::departureFrequencyModel::~departureFrequencyModel()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::wallBoilingModels::departureFrequencyModel::write(Ostream& os) const
|
||||
{
|
||||
os.writeKeyword("type") << this->type() << token::END_STATEMENT << nl;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,125 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::departureFrequencyModel
|
||||
|
||||
Description
|
||||
Base class for bubble departure frequency models
|
||||
|
||||
SourceFiles
|
||||
departureFrequencyModel.C
|
||||
newdepartureFrequencyModel.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef departureFrequencyModel_H
|
||||
#define departureFrequencyModel_H
|
||||
|
||||
#include "volFields.H"
|
||||
#include "dictionary.H"
|
||||
#include "runTimeSelectionTables.H"
|
||||
|
||||
#include "phaseModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace wallBoilingModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class departureFrequencyModel Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class departureFrequencyModel
|
||||
{
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
departureFrequencyModel(const departureFrequencyModel&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const departureFrequencyModel&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("departureFrequencyModel");
|
||||
|
||||
|
||||
//- Declare runtime construction
|
||||
declareRunTimeSelectionTable
|
||||
(
|
||||
autoPtr,
|
||||
departureFrequencyModel,
|
||||
dictionary,
|
||||
(
|
||||
const dictionary& dict
|
||||
),
|
||||
(dict)
|
||||
);
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct null
|
||||
departureFrequencyModel();
|
||||
|
||||
|
||||
// Selectors
|
||||
|
||||
//- Select null constructed
|
||||
static autoPtr<departureFrequencyModel> New(const dictionary& dict);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~departureFrequencyModel();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Calculate and return the bubble departure frequency
|
||||
virtual tmp<scalarField> fDeparture
|
||||
(
|
||||
const phaseModel& liquid,
|
||||
const phaseModel& vapor,
|
||||
const label patchi,
|
||||
const scalarField& dDep
|
||||
) const = 0;
|
||||
|
||||
virtual void write(Ostream& os) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
} // End namespace wallBoilingModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,58 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "departureFrequencyModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::autoPtr<Foam::wallBoilingModels::departureFrequencyModel>
|
||||
Foam::wallBoilingModels::departureFrequencyModel::New
|
||||
(
|
||||
const dictionary& dict
|
||||
)
|
||||
{
|
||||
word departureFrequencyModelType(dict.lookup("type"));
|
||||
|
||||
Info<< "Selecting departureFrequencyModel: "
|
||||
<< departureFrequencyModelType << endl;
|
||||
|
||||
dictionaryConstructorTable::iterator cstrIter =
|
||||
dictionaryConstructorTablePtr_->find(departureFrequencyModelType);
|
||||
|
||||
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unknown departureFrequencyModelType type "
|
||||
<< departureFrequencyModelType << endl << endl
|
||||
<< "Valid departureFrequencyModel types are : " << endl
|
||||
<< dictionaryConstructorTablePtr_->sortedToc()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
return cstrIter()(dict);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,84 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "LemmertChawla.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace wallBoilingModels
|
||||
{
|
||||
namespace nucleationSiteModels
|
||||
{
|
||||
defineTypeNameAndDebug(LemmertChawla, 0);
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
nucleationSiteModel,
|
||||
LemmertChawla,
|
||||
dictionary
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::wallBoilingModels::nucleationSiteModels::LemmertChawla::LemmertChawla
|
||||
(
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
nucleationSiteModel()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::wallBoilingModels::nucleationSiteModels::LemmertChawla::~LemmertChawla()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::scalarField>
|
||||
Foam::wallBoilingModels::nucleationSiteModels::LemmertChawla::N
|
||||
(
|
||||
const phaseModel& liquid,
|
||||
const phaseModel& vapor,
|
||||
const label patchi,
|
||||
const fvPatchScalarField& Tsatw
|
||||
) const
|
||||
{
|
||||
const fvPatchScalarField& Tw =
|
||||
liquid.thermo().T().boundaryField()[patchi];
|
||||
|
||||
return 0.8*9.922e5*pow(max((Tw - Tsatw)/10, scalar(0)), 1.805);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,109 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::wallBoilingModels::nucleationSiteModels::LemmertChawla
|
||||
|
||||
Description
|
||||
Lemmert & Chawla function for nucleation site density,
|
||||
correlation by Egorov & Menter.
|
||||
|
||||
References:
|
||||
\verbatim
|
||||
Lemmert, M., & Chawla, J. M. (1977).
|
||||
Influence of flow velocity on surface boiling heat transfer coefficient.
|
||||
Heat Transfer in Boiling, 237, 247.
|
||||
|
||||
Egorov, Y., & Menter, F. (2004).
|
||||
Experimental implementation of the RPI wall boiling model in CFX-5.6.
|
||||
Staudenfeldweg, 12, 83624.
|
||||
Technical Report ANSYS/TR-04-10, ANSYS Gmbh.
|
||||
\endverbatim
|
||||
|
||||
SourceFiles
|
||||
LemmertChawla.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef LemmertChawla_H
|
||||
#define LemmertChawla_H
|
||||
|
||||
#include "nucleationSiteModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace wallBoilingModels
|
||||
{
|
||||
namespace nucleationSiteModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class LemmertChawla Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class LemmertChawla
|
||||
:
|
||||
public nucleationSiteModel
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("LemmertChawla");
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from a dictionary
|
||||
LemmertChawla(const dictionary& dict);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~LemmertChawla();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Calculate and return the nucleation-site density
|
||||
virtual tmp<scalarField> N
|
||||
(
|
||||
const phaseModel& liquid,
|
||||
const phaseModel& vapor,
|
||||
const label patchi,
|
||||
const fvPatchScalarField& Tsatw
|
||||
) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace nucleationSiteModels
|
||||
} // End namespace wallBoilingModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,58 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "nucleationSiteModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::autoPtr<Foam::wallBoilingModels::nucleationSiteModel>
|
||||
Foam::wallBoilingModels::nucleationSiteModel::New
|
||||
(
|
||||
const dictionary& dict
|
||||
)
|
||||
{
|
||||
word nucleationSiteModelType(dict.lookup("type"));
|
||||
|
||||
Info<< "Selecting nucleationSiteModel: "
|
||||
<< nucleationSiteModelType << endl;
|
||||
|
||||
dictionaryConstructorTable::iterator cstrIter =
|
||||
dictionaryConstructorTablePtr_->find(nucleationSiteModelType);
|
||||
|
||||
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unknown nucleationSiteModelType type "
|
||||
<< nucleationSiteModelType << endl << endl
|
||||
<< "Valid nucleationSiteModel types are : " << endl
|
||||
<< dictionaryConstructorTablePtr_->sortedToc()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
return cstrIter()(dict);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,60 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "nucleationSiteModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace wallBoilingModels
|
||||
{
|
||||
defineTypeNameAndDebug(nucleationSiteModel, 0);
|
||||
defineRunTimeSelectionTable(nucleationSiteModel, dictionary);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::wallBoilingModels::nucleationSiteModel::nucleationSiteModel()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::wallBoilingModels::nucleationSiteModel::~nucleationSiteModel()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::wallBoilingModels::nucleationSiteModel::write(Ostream& os) const
|
||||
{
|
||||
os.writeKeyword("type") << this->type() << token::END_STATEMENT << nl;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,125 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::nucleationSiteModel
|
||||
|
||||
Description
|
||||
Base class for nucleation site density models
|
||||
|
||||
SourceFiles
|
||||
nucleationSiteModel.C
|
||||
newnucleationSiteModel.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef nucleationSiteModel_H
|
||||
#define nucleationSiteModel_H
|
||||
|
||||
#include "volFields.H"
|
||||
#include "dictionary.H"
|
||||
#include "runTimeSelectionTables.H"
|
||||
|
||||
#include "phaseModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace wallBoilingModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class nucleationSiteModel Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class nucleationSiteModel
|
||||
{
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
nucleationSiteModel(const nucleationSiteModel&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const nucleationSiteModel&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("nucleationSiteModel");
|
||||
|
||||
|
||||
//- Declare runtime construction
|
||||
declareRunTimeSelectionTable
|
||||
(
|
||||
autoPtr,
|
||||
nucleationSiteModel,
|
||||
dictionary,
|
||||
(
|
||||
const dictionary& dict
|
||||
),
|
||||
(dict)
|
||||
);
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct null
|
||||
nucleationSiteModel();
|
||||
|
||||
|
||||
// Selectors
|
||||
|
||||
//- Select null constructed
|
||||
static autoPtr<nucleationSiteModel> New(const dictionary& dict);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~nucleationSiteModel();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Calculate and return the nucleation-site density
|
||||
virtual tmp<scalarField> N
|
||||
(
|
||||
const phaseModel& liquid,
|
||||
const phaseModel& vapor,
|
||||
const label patchi,
|
||||
const fvPatchScalarField& Tsatw
|
||||
) const = 0;
|
||||
|
||||
virtual void write(Ostream& os) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
} // End namespace wallBoilingModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,95 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "Lavieville.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace wallBoilingModels
|
||||
{
|
||||
namespace partitioningModels
|
||||
{
|
||||
defineTypeNameAndDebug(Lavieville, 0);
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
partitioningModel,
|
||||
Lavieville,
|
||||
dictionary
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::wallBoilingModels::partitioningModels::
|
||||
Lavieville::Lavieville(const dictionary& dict)
|
||||
:
|
||||
partitioningModel(),
|
||||
alphaCrit_(readScalar(dict.lookup("alphaCrit")))
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::wallBoilingModels::partitioningModels::
|
||||
Lavieville::~Lavieville()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::scalarField>
|
||||
Foam::wallBoilingModels::partitioningModels::
|
||||
Lavieville::fLiquid
|
||||
(
|
||||
const scalarField& alphaLiquid
|
||||
) const
|
||||
{
|
||||
return
|
||||
pos(alphaLiquid-alphaCrit_)
|
||||
*(
|
||||
1 - 0.5*exp(-20*(alphaLiquid - alphaCrit_))
|
||||
)
|
||||
+ neg(alphaLiquid - alphaCrit_)
|
||||
*(
|
||||
pow(0.5*(alphaLiquid/alphaCrit_), 20*alphaCrit_)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
void Foam::wallBoilingModels::partitioningModels::
|
||||
Lavieville::write(Ostream& os) const
|
||||
{
|
||||
partitioningModel::write(os);
|
||||
os.writeKeyword("alphaCrit") << alphaCrit_ << token::END_STATEMENT << nl;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,109 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::wallBoilingModels::Lavieville
|
||||
|
||||
Description
|
||||
Lavieville wall heat flux partitioning model.
|
||||
|
||||
Model parameters:
|
||||
alphaCrit: critical liquid fraction
|
||||
|
||||
Reference:
|
||||
\verbatim
|
||||
Lavieville, J., Quemerais, E., Mimouni, S., Boucker, M., &
|
||||
Mechitoua, N. (2006).
|
||||
NEPTUNE CFD V1. 0 theory manual.
|
||||
NEPTUNE report Nept_2004_L1, 2(3).
|
||||
\endverbatim
|
||||
|
||||
SourceFiles
|
||||
Lavieville.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef Lavieville_H
|
||||
#define Lavieville_H
|
||||
|
||||
#include "partitioningModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace wallBoilingModels
|
||||
{
|
||||
namespace partitioningModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class Lavieville Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class Lavieville
|
||||
:
|
||||
public partitioningModel
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Critical liquid fraction
|
||||
scalar alphaCrit_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("Lavieville");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from a dictionary
|
||||
Lavieville(const dictionary& dict);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~Lavieville();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Liquid blending function
|
||||
virtual tmp<scalarField> fLiquid(const scalarField& alphaLiquid) const;
|
||||
|
||||
virtual void write(Ostream& os) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace partitioningModels
|
||||
} // End namespace wallBoilingModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,107 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "cosine.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace wallBoilingModels
|
||||
{
|
||||
namespace partitioningModels
|
||||
{
|
||||
defineTypeNameAndDebug(cosine, 0);
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
partitioningModel,
|
||||
cosine,
|
||||
dictionary
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::wallBoilingModels::partitioningModels::
|
||||
cosine::cosine(const dictionary& dict)
|
||||
:
|
||||
partitioningModel(),
|
||||
alphaLiquid1_(readScalar(dict.lookup("alphaLiquid1"))),
|
||||
alphaLiquid0_(readScalar(dict.lookup("alphaLiquid0")))
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::wallBoilingModels::partitioningModels::
|
||||
cosine::~cosine()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::scalarField>
|
||||
Foam::wallBoilingModels::partitioningModels::
|
||||
cosine::fLiquid
|
||||
(
|
||||
const scalarField& alphaLiquid
|
||||
) const
|
||||
{
|
||||
return
|
||||
pos(alphaLiquid1_ - alphaLiquid)
|
||||
*(
|
||||
neg(alphaLiquid0_ - alphaLiquid)
|
||||
*(
|
||||
0.5
|
||||
*(
|
||||
1 - cos
|
||||
(
|
||||
constant::mathematical::pi
|
||||
*(alphaLiquid1_ - alphaLiquid)
|
||||
/(alphaLiquid1_ - alphaLiquid0_)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
+ neg(alphaLiquid1_ - alphaLiquid);
|
||||
}
|
||||
|
||||
|
||||
void Foam::wallBoilingModels::partitioningModels::
|
||||
cosine::write(Ostream& os) const
|
||||
{
|
||||
partitioningModel::write(os);
|
||||
os.writeKeyword("alphaLiquid1") << alphaLiquid1_
|
||||
<< token::END_STATEMENT << nl;
|
||||
os.writeKeyword("alphaLiquid0") << alphaLiquid0_
|
||||
<< token::END_STATEMENT << nl;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,113 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::wallBoilingModels::cosine
|
||||
|
||||
Description
|
||||
Cosine wall heat flux partitioning model.
|
||||
|
||||
Proposed threshold liquid fractions:
|
||||
- alphaLiquid1 0.1
|
||||
- alphaLiquid0 0.05
|
||||
|
||||
\verbatim
|
||||
Ioilev, A., Samigulin, M., Ustinenko, V., Kucherova, P., Tentner,
|
||||
A., Lo, S., & Splawski, A. (2007).
|
||||
Advances in the modeling of cladding heat transfer
|
||||
and critical heat flux in boiling water reactor fuel assemblies.
|
||||
In Proc. 12th International Topical Meeting on Nuclear Reactor
|
||||
Thermal Hydraulics (NURETH-12),
|
||||
Pittsburgh, Pennsylvania, USA.
|
||||
\endverbatim
|
||||
|
||||
SourceFiles
|
||||
cosine.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef cosine_H
|
||||
#define cosine_H
|
||||
|
||||
#include "partitioningModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace wallBoilingModels
|
||||
{
|
||||
namespace partitioningModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class cosine Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class cosine
|
||||
:
|
||||
public partitioningModel
|
||||
{
|
||||
// Private data
|
||||
|
||||
// Model parameters, threshold liquid phase fractions
|
||||
scalar alphaLiquid1_;
|
||||
scalar alphaLiquid0_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("cosine");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from a dictionary
|
||||
cosine(const dictionary& dict);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~cosine();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Calculate and return the wall heat-flux partioning
|
||||
virtual tmp<scalarField> fLiquid(const scalarField& alphaLiquid) const;
|
||||
|
||||
virtual void write(Ostream& os) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace partitioningModels
|
||||
} // End namespace wallBoilingModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,100 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "linear.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace wallBoilingModels
|
||||
{
|
||||
namespace partitioningModels
|
||||
{
|
||||
defineTypeNameAndDebug(linear, 0);
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
partitioningModel,
|
||||
linear,
|
||||
dictionary
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::wallBoilingModels::partitioningModels::
|
||||
linear::linear(const dictionary& dict)
|
||||
:
|
||||
partitioningModel(),
|
||||
alphaLiquid1_(readScalar(dict.lookup("alphaLiquid1"))),
|
||||
alphaLiquid0_(readScalar(dict.lookup("alphaLiquid0")))
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::wallBoilingModels::partitioningModels::
|
||||
linear::~linear()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::scalarField>
|
||||
Foam::wallBoilingModels::partitioningModels::
|
||||
linear::fLiquid
|
||||
(
|
||||
const scalarField& alphaLiquid
|
||||
) const
|
||||
{
|
||||
return max
|
||||
(
|
||||
scalar(0),
|
||||
min
|
||||
(
|
||||
scalar(1)-(alphaLiquid1_ - alphaLiquid)
|
||||
/(alphaLiquid1_ - alphaLiquid0_),
|
||||
scalar(1)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
void Foam::wallBoilingModels::partitioningModels::
|
||||
linear::write(Ostream& os) const
|
||||
{
|
||||
partitioningModel::write(os);
|
||||
os.writeKeyword("alphaLiquid1") << alphaLiquid1_
|
||||
<< token::END_STATEMENT << nl;
|
||||
os.writeKeyword("alphaLiquid0") << alphaLiquid0_
|
||||
<< token::END_STATEMENT << nl;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,114 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::wallBoilingModels::linear
|
||||
|
||||
Description
|
||||
Linear wall heat flux partitioning model.
|
||||
|
||||
Proposed threshold liquid fractions:
|
||||
- alphaLiquid1 0.1
|
||||
- alphaLiquid0 0.05
|
||||
|
||||
Reference:
|
||||
\verbatim
|
||||
Ioilev, A., Samigulin, M., Ustinenko, V., Kucherova, P., Tentner, A.,
|
||||
Lo, S., & Splawski, A. (2007).
|
||||
Advances in the modeling of cladding heat transfer
|
||||
and critical heat flux in boiling water reactor fuel assemblies.
|
||||
In Proc. 12th International Topical Meeting on
|
||||
Nuclear Reactor Thermal Hydraulics (NURETH-12),
|
||||
Pittsburgh, Pennsylvania, USA.
|
||||
\endverbatim
|
||||
|
||||
SourceFiles
|
||||
linear.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef linear_H
|
||||
#define linear_H
|
||||
|
||||
#include "partitioningModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace wallBoilingModels
|
||||
{
|
||||
namespace partitioningModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class linear Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class linear
|
||||
:
|
||||
public partitioningModel
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Model parameters, threshold liquid phase fractions
|
||||
scalar alphaLiquid1_;
|
||||
scalar alphaLiquid0_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("linear");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from a dictionary
|
||||
linear(const dictionary& dict);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~linear();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Calculate and return the wall heat-flux partioning
|
||||
virtual tmp<scalarField> fLiquid(const scalarField& alphaLiquid) const;
|
||||
|
||||
virtual void write(Ostream& os) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace partitioningModels
|
||||
} // End namespace wallBoilingModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,58 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "partitioningModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::autoPtr<Foam::wallBoilingModels::partitioningModel>
|
||||
Foam::wallBoilingModels::partitioningModel::New
|
||||
(
|
||||
const dictionary& dict
|
||||
)
|
||||
{
|
||||
word partitioningModelType(dict.lookup("type"));
|
||||
|
||||
Info<< "Selecting partitioningModel: "
|
||||
<< partitioningModelType << endl;
|
||||
|
||||
dictionaryConstructorTable::iterator cstrIter =
|
||||
dictionaryConstructorTablePtr_->find(partitioningModelType);
|
||||
|
||||
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unknown partitioningModelType type "
|
||||
<< partitioningModelType << endl << endl
|
||||
<< "Valid partitioningModel types are : " << endl
|
||||
<< dictionaryConstructorTablePtr_->sortedToc()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
return cstrIter()(dict);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,60 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "partitioningModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace wallBoilingModels
|
||||
{
|
||||
defineTypeNameAndDebug(partitioningModel, 0);
|
||||
defineRunTimeSelectionTable(partitioningModel, dictionary);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::wallBoilingModels::partitioningModel::partitioningModel()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::wallBoilingModels::partitioningModel::~partitioningModel()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::wallBoilingModels::partitioningModel::write(Ostream& os) const
|
||||
{
|
||||
os.writeKeyword("type") << this->type() << token::END_STATEMENT << nl;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,120 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::partitioningModel
|
||||
|
||||
Description
|
||||
Base class for wall heat flux partitioning models
|
||||
|
||||
SourceFiles
|
||||
partitioningModel.C
|
||||
newpartitioningModel.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef partitioningModel_H
|
||||
#define partitioningModel_H
|
||||
|
||||
#include "volFields.H"
|
||||
#include "dictionary.H"
|
||||
#include "runTimeSelectionTables.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace wallBoilingModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class partitioningModel Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class partitioningModel
|
||||
{
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
partitioningModel(const partitioningModel&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const partitioningModel&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("partitioningModel");
|
||||
|
||||
|
||||
//- Declare runtime construction
|
||||
declareRunTimeSelectionTable
|
||||
(
|
||||
autoPtr,
|
||||
partitioningModel,
|
||||
dictionary,
|
||||
(
|
||||
const dictionary& dict
|
||||
),
|
||||
(dict)
|
||||
);
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct null
|
||||
partitioningModel();
|
||||
|
||||
|
||||
// Selectors
|
||||
|
||||
//- Select null constructed
|
||||
static autoPtr<partitioningModel> New(const dictionary& dict);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~partitioningModel();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Calculate and return the wall heat-flux partitioning
|
||||
virtual tmp<scalarField> fLiquid
|
||||
(
|
||||
const scalarField& alphaLiquid
|
||||
) const = 0;
|
||||
|
||||
virtual void write(Ostream& os) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
} // End namespace wallBoilingModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,78 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "phaseFraction.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace wallBoilingModels
|
||||
{
|
||||
namespace partitioningModels
|
||||
{
|
||||
defineTypeNameAndDebug(phaseFraction, 0);
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
partitioningModel,
|
||||
phaseFraction,
|
||||
dictionary
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::wallBoilingModels::partitioningModels::
|
||||
phaseFraction::phaseFraction(const dictionary& dict)
|
||||
:
|
||||
partitioningModel()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::wallBoilingModels::partitioningModels::
|
||||
phaseFraction::~phaseFraction()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::scalarField>
|
||||
Foam::wallBoilingModels::partitioningModels::
|
||||
phaseFraction::fLiquid
|
||||
(
|
||||
const scalarField& alphaLiquid
|
||||
) const
|
||||
{
|
||||
return tmp<scalarField>(alphaLiquid);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,91 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::wallBoilingModels::phaseFraction
|
||||
|
||||
Description
|
||||
Wall heat-flux partitioned according to the phase volume fraction.
|
||||
|
||||
SourceFiles
|
||||
phaseFraction.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef phaseFraction_H
|
||||
#define phaseFraction_H
|
||||
|
||||
#include "partitioningModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace wallBoilingModels
|
||||
{
|
||||
namespace partitioningModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class phaseFraction Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class phaseFraction
|
||||
:
|
||||
public partitioningModel
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("phaseFraction");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from a dictionary
|
||||
phaseFraction(const dictionary& dict);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~phaseFraction();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Calculate and return the wall heat-flux partioning
|
||||
virtual tmp<scalarField> fLiquid(const scalarField& alphaLiquid) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace partitioningModels
|
||||
} // End namespace wallBoilingModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -3,6 +3,7 @@ diameterModels/IATE/IATEsources/IATEsource/IATEsource.C
|
||||
diameterModels/IATE/IATEsources/wakeEntrainmentCoalescence/wakeEntrainmentCoalescence.C
|
||||
diameterModels/IATE/IATEsources/turbulentBreakUp/turbulentBreakUp.C
|
||||
diameterModels/IATE/IATEsources/randomCoalescence/randomCoalescence.C
|
||||
diameterModels/IATE/IATEsources/phaseChange/phaseChange.C
|
||||
|
||||
twoPhaseSystem.C
|
||||
newTwoPhaseSystem.C
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -116,43 +116,35 @@ Foam::tmp<Foam::volScalarField> Foam::diameterModels::IATE::dsm() const
|
||||
return max(6/max(kappai_, 6/dMax_), dMin_);
|
||||
}
|
||||
|
||||
// Placeholder for the nucleation/condensation model
|
||||
// Foam::tmp<Foam::volScalarField> Foam::diameterModels::IATE::Rph() const
|
||||
// {
|
||||
// const volScalarField& T = phase_thermo().T();
|
||||
// const volScalarField& p = phase_.p();
|
||||
//
|
||||
// scalar A, B, C, sigma, vm, Rph;
|
||||
//
|
||||
// volScalarField ps(1e5*pow(10, A - B/(T + C)));
|
||||
// volScalarField Dbc
|
||||
// (
|
||||
// 4*sigma*vm/(constant::physicoChemical::k*T*log(p/ps))
|
||||
// );
|
||||
//
|
||||
// return constant::mathematical::pi*sqr(Dbc)*Rph;
|
||||
// }
|
||||
|
||||
void Foam::diameterModels::IATE::correct()
|
||||
{
|
||||
// Initialise the accumulated source term to the dilatation effect
|
||||
volScalarField R
|
||||
volScalarField alphaAv
|
||||
(
|
||||
max
|
||||
(
|
||||
(1.0/3.0)
|
||||
/max
|
||||
(
|
||||
fvc::average(phase_ + phase_.oldTime()),
|
||||
residualAlpha_
|
||||
)
|
||||
fvc::average(phase_ + phase_.oldTime()),
|
||||
residualAlpha_
|
||||
)
|
||||
);
|
||||
|
||||
// Initialise the accumulated source term to the dilatation effect
|
||||
fvScalarMatrix R
|
||||
(
|
||||
-fvm::SuSp
|
||||
(
|
||||
((1.0/3.0)/alphaAv)
|
||||
*(
|
||||
fvc::ddt(phase_) + fvc::div(phase_.alphaPhi())
|
||||
- phase_.continuityError()/phase_.rho()
|
||||
),
|
||||
kappai_
|
||||
)
|
||||
*(fvc::ddt(phase_) + fvc::div(phase_.alphaPhi()))
|
||||
);
|
||||
|
||||
// Accumulate the run-time selectable sources
|
||||
forAll(sources_, j)
|
||||
{
|
||||
R -= sources_[j].R();
|
||||
R += sources_[j].R(alphaAv, kappai_);
|
||||
}
|
||||
|
||||
fv::options& fvOptions(fv::options::New(phase_.mesh()));
|
||||
@ -163,8 +155,7 @@ void Foam::diameterModels::IATE::correct()
|
||||
fvm::ddt(kappai_) + fvm::div(phase_.phi(), kappai_)
|
||||
- fvm::Sp(fvc::div(phase_.phi()), kappai_)
|
||||
==
|
||||
- fvm::SuSp(R, kappai_)
|
||||
//+ Rph() // Omit the nucleation/condensation term
|
||||
R
|
||||
+ fvOptions(kappai_)
|
||||
);
|
||||
|
||||
|
||||
@ -177,7 +177,11 @@ public:
|
||||
//- Return the bubble Webber number
|
||||
tmp<volScalarField> We() const;
|
||||
|
||||
virtual tmp<volScalarField> R() const = 0;
|
||||
virtual tmp<fvScalarMatrix> R
|
||||
(
|
||||
const volScalarField& alphai,
|
||||
volScalarField& kappai
|
||||
) const = 0;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -43,23 +43,26 @@ namespace IATEsources
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::diameterModels::IATEsources::dummy::R() const
|
||||
Foam::tmp<Foam::fvScalarMatrix>
|
||||
Foam::diameterModels::IATEsources::dummy::R
|
||||
(
|
||||
const volScalarField& alphai,
|
||||
volScalarField& kappai
|
||||
) const
|
||||
{
|
||||
return tmp<volScalarField>
|
||||
volScalarField::Internal R
|
||||
(
|
||||
new volScalarField
|
||||
IOobject
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"R",
|
||||
iate_.phase().U().time().timeName(),
|
||||
iate_.phase().mesh()
|
||||
),
|
||||
iate_.phase().U().mesh(),
|
||||
dimensionedScalar("R", dimless/dimTime, 0)
|
||||
)
|
||||
"dummy:R",
|
||||
iate_.phase().time().timeName(),
|
||||
iate_.phase().mesh()
|
||||
),
|
||||
iate_.phase().mesh(),
|
||||
dimensionedScalar("R", kappai.dimensions()/dimTime, 0)
|
||||
);
|
||||
|
||||
return fvm::Su(R, kappai);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -79,7 +79,11 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
virtual tmp<volScalarField> R() const;
|
||||
virtual tmp<fvScalarMatrix> R
|
||||
(
|
||||
const volScalarField& alphai,
|
||||
volScalarField& kappai
|
||||
) const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,94 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "phaseChange.H"
|
||||
#include "twoPhaseSystem.H"
|
||||
#include "phaseSystem.H"
|
||||
#include "ThermalPhaseChangePhaseSystem.H"
|
||||
#include "MomentumTransferPhaseSystem.H"
|
||||
#include "fvmSup.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace diameterModels
|
||||
{
|
||||
namespace IATEsources
|
||||
{
|
||||
defineTypeNameAndDebug(phaseChange, 0);
|
||||
addToRunTimeSelectionTable(IATEsource, phaseChange, dictionary);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::diameterModels::IATEsources::phaseChange::phaseChange
|
||||
(
|
||||
const IATE& iate,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
IATEsource(iate)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::fvScalarMatrix>
|
||||
Foam::diameterModels::IATEsources::phaseChange::R
|
||||
(
|
||||
const volScalarField& alphai,
|
||||
volScalarField& kappai
|
||||
) const
|
||||
{
|
||||
const ThermalPhaseChangePhaseSystem
|
||||
<
|
||||
MomentumTransferPhaseSystem
|
||||
<
|
||||
twoPhaseSystem
|
||||
>
|
||||
>& phaseChangeFluid = refCast
|
||||
<
|
||||
const ThermalPhaseChangePhaseSystem
|
||||
<
|
||||
MomentumTransferPhaseSystem<twoPhaseSystem>
|
||||
>
|
||||
>(fluid());
|
||||
|
||||
return -fvm::SuSp
|
||||
(
|
||||
(1.0/3.0)
|
||||
*phaseChangeFluid.iDmdt(phase())()()
|
||||
/(alphai()*phase().rho()()),
|
||||
kappai
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,98 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::diameterModels::IATEsources::phaseChange
|
||||
|
||||
Description
|
||||
Phase-change IATE source.
|
||||
|
||||
SourceFiles
|
||||
phaseChange.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef phaseChange_H
|
||||
#define phaseChange_H
|
||||
|
||||
#include "IATEsource.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace diameterModels
|
||||
{
|
||||
namespace IATEsources
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class phaseChange Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class phaseChange
|
||||
:
|
||||
public IATEsource
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("phaseChange");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
phaseChange
|
||||
(
|
||||
const IATE& iate,
|
||||
const dictionary& dict
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~phaseChange()
|
||||
{}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
virtual tmp<fvScalarMatrix> R
|
||||
(
|
||||
const volScalarField& alphai,
|
||||
volScalarField& kappai
|
||||
) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace IATEsources
|
||||
} // End namespace diameterModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -24,6 +24,7 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "randomCoalescence.H"
|
||||
#include "fvmSup.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
@ -59,42 +60,40 @@ randomCoalescence
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::diameterModels::IATEsources::randomCoalescence::R() const
|
||||
Foam::tmp<Foam::fvScalarMatrix>
|
||||
Foam::diameterModels::IATEsources::randomCoalescence::R
|
||||
(
|
||||
const volScalarField& alphai,
|
||||
volScalarField& kappai
|
||||
) const
|
||||
{
|
||||
tmp<volScalarField> tR
|
||||
volScalarField::Internal R
|
||||
(
|
||||
new volScalarField
|
||||
IOobject
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"R",
|
||||
iate_.phase().time().timeName(),
|
||||
iate_.phase().mesh()
|
||||
),
|
||||
iate_.phase().mesh(),
|
||||
dimensionedScalar("R", dimless/dimTime, 0)
|
||||
)
|
||||
"randomCoalescence:R",
|
||||
iate_.phase().time().timeName(),
|
||||
iate_.phase().mesh()
|
||||
),
|
||||
iate_.phase().mesh(),
|
||||
dimensionedScalar("R", dimless/dimTime, 0)
|
||||
);
|
||||
|
||||
volScalarField R = tR();
|
||||
|
||||
scalar Crc = Crc_.value();
|
||||
scalar C = C_.value();
|
||||
scalar alphaMax = alphaMax_.value();
|
||||
volScalarField Ut(this->Ut());
|
||||
const scalar Crc = Crc_.value();
|
||||
const scalar C = C_.value();
|
||||
const scalar alphaMax = alphaMax_.value();
|
||||
const volScalarField Ut(this->Ut());
|
||||
const volScalarField& alpha = phase();
|
||||
const volScalarField& kappai = iate_.kappai();
|
||||
scalar cbrtAlphaMax = cbrt(alphaMax);
|
||||
const scalar cbrtAlphaMax = cbrt(alphaMax);
|
||||
|
||||
forAll(R, celli)
|
||||
{
|
||||
if (alpha[celli] < alphaMax - SMALL)
|
||||
{
|
||||
scalar cbrtAlphaMaxMAlpha = cbrtAlphaMax - cbrt(alpha[celli]);
|
||||
const scalar cbrtAlphaMaxMAlpha = cbrtAlphaMax - cbrt(alpha[celli]);
|
||||
|
||||
R[celli] =
|
||||
(-12)*phi()*kappai[celli]*alpha[celli]
|
||||
12*phi()*kappai[celli]*alpha[celli]
|
||||
*Crc
|
||||
*Ut[celli]
|
||||
*(1 - exp(-C*cbrt(alpha[celli]*alphaMax)/cbrtAlphaMaxMAlpha))
|
||||
@ -102,7 +101,7 @@ Foam::diameterModels::IATEsources::randomCoalescence::R() const
|
||||
}
|
||||
}
|
||||
|
||||
return tR;
|
||||
return -fvm::Sp(R, kappai);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -89,7 +89,11 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
virtual tmp<volScalarField> R() const;
|
||||
virtual tmp<fvScalarMatrix> R
|
||||
(
|
||||
const volScalarField& alphai,
|
||||
volScalarField& kappai
|
||||
) const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -24,6 +24,7 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "turbulentBreakUp.H"
|
||||
#include "fvmSup.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
@ -58,46 +59,40 @@ turbulentBreakUp
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::diameterModels::IATEsources::turbulentBreakUp::R() const
|
||||
Foam::tmp<Foam::fvScalarMatrix>
|
||||
Foam::diameterModels::IATEsources::turbulentBreakUp::R
|
||||
(
|
||||
const volScalarField& alphai,
|
||||
volScalarField& kappai
|
||||
) const
|
||||
{
|
||||
tmp<volScalarField> tR
|
||||
volScalarField::Internal R
|
||||
(
|
||||
new volScalarField
|
||||
IOobject
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"R",
|
||||
iate_.phase().time().timeName(),
|
||||
iate_.phase().mesh()
|
||||
),
|
||||
iate_.phase().mesh(),
|
||||
dimensionedScalar("R", dimless/dimTime, 0)
|
||||
)
|
||||
"turbulentBreakUp:R",
|
||||
iate_.phase().time().timeName(),
|
||||
iate_.phase().mesh()
|
||||
),
|
||||
iate_.phase().mesh(),
|
||||
dimensionedScalar("R", kappai.dimensions()/dimTime, 0)
|
||||
);
|
||||
|
||||
volScalarField R = tR();
|
||||
|
||||
scalar Cti = Cti_.value();
|
||||
scalar WeCr = WeCr_.value();
|
||||
volScalarField Ut(this->Ut());
|
||||
volScalarField We(this->We());
|
||||
const volScalarField& d(iate_.d()());
|
||||
const scalar Cti = Cti_.value();
|
||||
const scalar WeCr = WeCr_.value();
|
||||
const volScalarField Ut(this->Ut());
|
||||
const volScalarField We(this->We());
|
||||
|
||||
forAll(R, celli)
|
||||
{
|
||||
if (We[celli] > WeCr)
|
||||
{
|
||||
R[celli] =
|
||||
(1.0/3.0)
|
||||
*Cti/d[celli]
|
||||
*Ut[celli]
|
||||
*sqrt(1 - WeCr/We[celli])
|
||||
*exp(-WeCr/We[celli]);
|
||||
2*Cti*Ut[celli]*sqrt(1 - WeCr/We[celli])*exp(-WeCr/We[celli]);
|
||||
}
|
||||
}
|
||||
|
||||
return tR;
|
||||
return fvm::Su(R, kappai);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
/*---------------------------------------------------------------------------* \
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -87,7 +87,11 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
virtual tmp<volScalarField> R() const;
|
||||
virtual tmp<fvScalarMatrix> R
|
||||
(
|
||||
const volScalarField& alphai,
|
||||
volScalarField& kappai
|
||||
) const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -24,6 +24,7 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "wakeEntrainmentCoalescence.H"
|
||||
#include "fvmSup.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
@ -62,10 +63,14 @@ wakeEntrainmentCoalescence
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::diameterModels::IATEsources::wakeEntrainmentCoalescence::R() const
|
||||
Foam::tmp<Foam::fvScalarMatrix>
|
||||
Foam::diameterModels::IATEsources::wakeEntrainmentCoalescence::R
|
||||
(
|
||||
const volScalarField& alphai,
|
||||
volScalarField& kappai
|
||||
) const
|
||||
{
|
||||
return (-12)*phi()*Cwe_*cbrt(CD())*iate_.a()*Ur();
|
||||
return -fvm::SuSp(12*phi()*Cwe_*cbrt(CD())*iate_.a()*Ur(), kappai);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -86,7 +86,11 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
virtual tmp<volScalarField> R() const;
|
||||
virtual tmp<fvScalarMatrix> R
|
||||
(
|
||||
const volScalarField& alphai,
|
||||
volScalarField& kappai
|
||||
) const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -403,7 +403,7 @@ void Foam::twoPhaseSystem::solve()
|
||||
fvScalarMatrix alpha1Eqn
|
||||
(
|
||||
fvm::ddt(alpha1) - fvc::ddt(alpha1)
|
||||
- fvm::laplacian(alphaDbyA, alpha1, "bounded")
|
||||
- fvm::laplacian(alphaDbyA(), alpha1, "bounded")
|
||||
);
|
||||
|
||||
alpha1Eqn.relax();
|
||||
|
||||
@ -31,6 +31,7 @@ kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStress
|
||||
kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C
|
||||
kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C
|
||||
kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C
|
||||
kineticTheoryModels/frictionalStressModel/JohnsonJacksonSchaeffer/JohnsonJacksonSchaefferFrictionalStress.C
|
||||
|
||||
kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C
|
||||
kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C
|
||||
|
||||
@ -190,6 +190,14 @@ void Foam::JohnsonJacksonParticleSlipFvPatchVectorField::updateCoeffs()
|
||||
)
|
||||
);
|
||||
|
||||
const scalarField nuFric
|
||||
(
|
||||
patch().lookupPatchField<volScalarField, scalar>
|
||||
(
|
||||
IOobject::groupName("nuFric", phased.name())
|
||||
)
|
||||
);
|
||||
|
||||
word ThetaName(IOobject::groupName("Theta", phased.name()));
|
||||
|
||||
const fvPatchScalarField& Theta
|
||||
@ -222,7 +230,7 @@ void Foam::JohnsonJacksonParticleSlipFvPatchVectorField::updateCoeffs()
|
||||
*gs0
|
||||
*specularityCoefficient_.value()
|
||||
*sqrt(3.0*Theta)
|
||||
/max(6.0*nu*alphaMax.value(), SMALL)
|
||||
/max(6.0*(nu - nuFric)*alphaMax.value(), SMALL)
|
||||
);
|
||||
|
||||
this->valueFraction() = c/(c + patch().deltaCoeffs());
|
||||
|
||||
@ -65,7 +65,8 @@ JohnsonJacksonParticleThetaFvPatchScalarField
|
||||
mixedFvPatchScalarField(ptf, p, iF, mapper),
|
||||
restitutionCoefficient_(ptf.restitutionCoefficient_),
|
||||
specularityCoefficient_(ptf.specularityCoefficient_)
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Foam::JohnsonJacksonParticleThetaFvPatchScalarField::
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -81,15 +81,16 @@ Foam::tmp<Foam::volScalarField>
|
||||
Foam::kineticTheoryModels::frictionalStressModels::JohnsonJackson::
|
||||
frictionalPressure
|
||||
(
|
||||
const volScalarField& alpha1,
|
||||
const phaseModel& phase,
|
||||
const dimensionedScalar& alphaMinFriction,
|
||||
const dimensionedScalar& alphaMax
|
||||
) const
|
||||
{
|
||||
const volScalarField& alpha = phase;
|
||||
|
||||
return
|
||||
Fr_*pow(max(alpha1 - alphaMinFriction, scalar(0)), eta_)
|
||||
/pow(max(alphaMax - alpha1, alphaDeltaMin_), p_);
|
||||
Fr_*pow(max(alpha - alphaMinFriction, scalar(0)), eta_)
|
||||
/pow(max(alphaMax - alpha, alphaDeltaMin_), p_);
|
||||
}
|
||||
|
||||
|
||||
@ -97,24 +98,26 @@ Foam::tmp<Foam::volScalarField>
|
||||
Foam::kineticTheoryModels::frictionalStressModels::JohnsonJackson::
|
||||
frictionalPressurePrime
|
||||
(
|
||||
const volScalarField& alpha1,
|
||||
const phaseModel& phase,
|
||||
const dimensionedScalar& alphaMinFriction,
|
||||
const dimensionedScalar& alphaMax
|
||||
) const
|
||||
{
|
||||
const volScalarField& alpha = phase;
|
||||
|
||||
return Fr_*
|
||||
(
|
||||
eta_*pow(max(alpha1 - alphaMinFriction, scalar(0)), eta_ - 1.0)
|
||||
*(alphaMax-alpha1)
|
||||
+ p_*pow(max(alpha1 - alphaMinFriction, scalar(0)), eta_)
|
||||
)/pow(max(alphaMax - alpha1, alphaDeltaMin_), p_ + 1.0);
|
||||
eta_*pow(max(alpha - alphaMinFriction, scalar(0)), eta_ - 1.0)
|
||||
*(alphaMax-alpha)
|
||||
+ p_*pow(max(alpha - alphaMinFriction, scalar(0)), eta_)
|
||||
)/pow(max(alphaMax - alpha, alphaDeltaMin_), p_ + 1.0);
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::kineticTheoryModels::frictionalStressModels::JohnsonJackson::nu
|
||||
(
|
||||
const volScalarField& alpha1,
|
||||
const phaseModel& phase,
|
||||
const dimensionedScalar& alphaMinFriction,
|
||||
const dimensionedScalar& alphaMax,
|
||||
const volScalarField& pf,
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -93,21 +93,21 @@ public:
|
||||
|
||||
virtual tmp<volScalarField> frictionalPressure
|
||||
(
|
||||
const volScalarField& alpha1,
|
||||
const phaseModel& phase,
|
||||
const dimensionedScalar& alphaMinFriction,
|
||||
const dimensionedScalar& alphaMax
|
||||
) const;
|
||||
|
||||
virtual tmp<volScalarField> frictionalPressurePrime
|
||||
(
|
||||
const volScalarField& alpha1,
|
||||
const phaseModel& phase,
|
||||
const dimensionedScalar& alphaMinFriction,
|
||||
const dimensionedScalar& alphaMax
|
||||
) const;
|
||||
|
||||
virtual tmp<volScalarField> nu
|
||||
(
|
||||
const volScalarField& alpha1,
|
||||
const phaseModel& phase,
|
||||
const dimensionedScalar& alphaMinFriction,
|
||||
const dimensionedScalar& alphaMax,
|
||||
const volScalarField& pf,
|
||||
|
||||
@ -0,0 +1,208 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "JohnsonJacksonSchaefferFrictionalStress.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "mathematicalConstants.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace kineticTheoryModels
|
||||
{
|
||||
namespace frictionalStressModels
|
||||
{
|
||||
defineTypeNameAndDebug(JohnsonJacksonSchaeffer, 0);
|
||||
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
frictionalStressModel,
|
||||
JohnsonJacksonSchaeffer,
|
||||
dictionary
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::kineticTheoryModels::frictionalStressModels::
|
||||
JohnsonJacksonSchaeffer::JohnsonJacksonSchaeffer
|
||||
(
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
frictionalStressModel(dict),
|
||||
coeffDict_(dict.subDict(typeName + "Coeffs")),
|
||||
Fr_("Fr", dimensionSet(1, -1, -2, 0, 0), coeffDict_),
|
||||
eta_("eta", dimless, coeffDict_),
|
||||
p_("p", dimless, coeffDict_),
|
||||
phi_("phi", dimless, coeffDict_),
|
||||
alphaDeltaMin_("alphaDeltaMin", dimless, coeffDict_)
|
||||
{
|
||||
phi_ *= constant::mathematical::pi/180.0;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::kineticTheoryModels::frictionalStressModels::
|
||||
JohnsonJacksonSchaeffer::~JohnsonJacksonSchaeffer()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::kineticTheoryModels::frictionalStressModels::
|
||||
JohnsonJacksonSchaeffer::frictionalPressure
|
||||
(
|
||||
const phaseModel& phase,
|
||||
const dimensionedScalar& alphaMinFriction,
|
||||
const dimensionedScalar& alphaMax
|
||||
) const
|
||||
{
|
||||
const volScalarField& alpha = phase;
|
||||
|
||||
return
|
||||
Fr_*pow(max(alpha - alphaMinFriction, scalar(0)), eta_)
|
||||
/pow(max(alphaMax - alpha, alphaDeltaMin_), p_);
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::kineticTheoryModels::frictionalStressModels::
|
||||
JohnsonJacksonSchaeffer::frictionalPressurePrime
|
||||
(
|
||||
const phaseModel& phase,
|
||||
const dimensionedScalar& alphaMinFriction,
|
||||
const dimensionedScalar& alphaMax
|
||||
) const
|
||||
{
|
||||
const volScalarField& alpha = phase;
|
||||
|
||||
return Fr_*
|
||||
(
|
||||
eta_*pow(max(alpha - alphaMinFriction, scalar(0)), eta_ - 1.0)
|
||||
*(alphaMax-alpha)
|
||||
+ p_*pow(max(alpha - alphaMinFriction, scalar(0)), eta_)
|
||||
)/pow(max(alphaMax - alpha, alphaDeltaMin_), p_ + 1.0);
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::kineticTheoryModels::frictionalStressModels::
|
||||
JohnsonJacksonSchaeffer::nu
|
||||
(
|
||||
const phaseModel& phase,
|
||||
const dimensionedScalar& alphaMinFriction,
|
||||
const dimensionedScalar& alphaMax,
|
||||
const volScalarField& pf,
|
||||
const volSymmTensorField& D
|
||||
) const
|
||||
{
|
||||
const volScalarField& alpha = phase;
|
||||
|
||||
tmp<volScalarField> tnu
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"JohnsonJacksonSchaeffer:nu",
|
||||
phase.mesh().time().timeName(),
|
||||
phase.mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
),
|
||||
phase.mesh(),
|
||||
dimensionedScalar("nu", dimensionSet(0, 2, -1, 0, 0), 0.0)
|
||||
)
|
||||
);
|
||||
|
||||
volScalarField& nuf = tnu.ref();
|
||||
|
||||
forAll(D, celli)
|
||||
{
|
||||
if (alpha[celli] > alphaMinFriction.value())
|
||||
{
|
||||
nuf[celli] =
|
||||
0.5*pf[celli]*sin(phi_.value())
|
||||
/(
|
||||
sqrt((1.0/3.0)*sqr(tr(D[celli])) - invariantII(D[celli]))
|
||||
+ SMALL
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const fvPatchList& patches = phase.mesh().boundary();
|
||||
const volVectorField& U = phase.U();
|
||||
|
||||
volScalarField::Boundary& nufBf = nuf.boundaryFieldRef();
|
||||
|
||||
forAll(patches, patchi)
|
||||
{
|
||||
if (!patches[patchi].coupled())
|
||||
{
|
||||
nufBf[patchi] =
|
||||
(
|
||||
pf.boundaryField()[patchi]*sin(phi_.value())
|
||||
/(
|
||||
mag(U.boundaryField()[patchi].snGrad())
|
||||
+ SMALL
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Correct coupled BCs
|
||||
nuf.correctBoundaryConditions();
|
||||
|
||||
return tnu;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::kineticTheoryModels::frictionalStressModels::
|
||||
JohnsonJacksonSchaeffer::read()
|
||||
{
|
||||
coeffDict_ <<= dict_.subDict(typeName + "Coeffs");
|
||||
|
||||
Fr_.read(coeffDict_);
|
||||
eta_.read(coeffDict_);
|
||||
p_.read(coeffDict_);
|
||||
|
||||
phi_.read(coeffDict_);
|
||||
phi_ *= constant::mathematical::pi/180.0;
|
||||
|
||||
alphaDeltaMin_.read(coeffDict_);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,131 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::kineticTheoryModels::frictionalStressModels::JohnsonJacksonSchaeffer
|
||||
|
||||
Description
|
||||
|
||||
SourceFiles
|
||||
JohnsonJacksonSchaefferFrictionalStress.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef JohnsonJacksonSchaeffer_H
|
||||
#define JohnsonJacksonSchaeffer_H
|
||||
|
||||
#include "frictionalStressModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace kineticTheoryModels
|
||||
{
|
||||
namespace frictionalStressModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class JohnsonJacksonSchaeffer Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class JohnsonJacksonSchaeffer
|
||||
:
|
||||
public frictionalStressModel
|
||||
{
|
||||
// Private data
|
||||
|
||||
dictionary coeffDict_;
|
||||
|
||||
//- Material constant for frictional normal stress
|
||||
dimensionedScalar Fr_;
|
||||
|
||||
//- Material constant for frictional normal stress
|
||||
dimensionedScalar eta_;
|
||||
|
||||
//- Material constant for frictional normal stress
|
||||
dimensionedScalar p_;
|
||||
|
||||
//- Angle of internal friction
|
||||
dimensionedScalar phi_;
|
||||
|
||||
//- Lower limit for (alphaMax - alpha1)
|
||||
dimensionedScalar alphaDeltaMin_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("JohnsonJacksonSchaeffer");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
JohnsonJacksonSchaeffer(const dictionary& dict);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~JohnsonJacksonSchaeffer();
|
||||
|
||||
|
||||
// Member functions
|
||||
|
||||
virtual tmp<volScalarField> frictionalPressure
|
||||
(
|
||||
const phaseModel& phase,
|
||||
const dimensionedScalar& alphaMinFriction,
|
||||
const dimensionedScalar& alphaMax
|
||||
) const;
|
||||
|
||||
virtual tmp<volScalarField> frictionalPressurePrime
|
||||
(
|
||||
const phaseModel& phase,
|
||||
const dimensionedScalar& alphaMinFriction,
|
||||
const dimensionedScalar& alphaMax
|
||||
) const;
|
||||
|
||||
virtual tmp<volScalarField> nu
|
||||
(
|
||||
const phaseModel& phase,
|
||||
const dimensionedScalar& alphaMinFriction,
|
||||
const dimensionedScalar& alphaMax,
|
||||
const volScalarField& pf,
|
||||
const volSymmTensorField& D
|
||||
) const;
|
||||
|
||||
virtual bool read();
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace frictionalStressModels
|
||||
} // End namespace kineticTheoryModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -74,14 +74,16 @@ Foam::tmp<Foam::volScalarField>
|
||||
Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::
|
||||
frictionalPressure
|
||||
(
|
||||
const volScalarField& alpha1,
|
||||
const phaseModel& phase,
|
||||
const dimensionedScalar& alphaMinFriction,
|
||||
const dimensionedScalar& alphaMax
|
||||
) const
|
||||
{
|
||||
const volScalarField& alpha = phase;
|
||||
|
||||
return
|
||||
dimensionedScalar("1e24", dimensionSet(1, -1, -2, 0, 0), 1e24)
|
||||
*pow(Foam::max(alpha1 - alphaMinFriction, scalar(0)), 10.0);
|
||||
*pow(Foam::max(alpha - alphaMinFriction, scalar(0)), 10.0);
|
||||
}
|
||||
|
||||
|
||||
@ -89,31 +91,31 @@ Foam::tmp<Foam::volScalarField>
|
||||
Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::
|
||||
frictionalPressurePrime
|
||||
(
|
||||
const volScalarField& alpha1,
|
||||
const phaseModel& phase,
|
||||
const dimensionedScalar& alphaMinFriction,
|
||||
const dimensionedScalar& alphaMax
|
||||
) const
|
||||
{
|
||||
const volScalarField& alpha = phase;
|
||||
|
||||
return
|
||||
dimensionedScalar("1e25", dimensionSet(1, -1, -2, 0, 0), 1e25)
|
||||
*pow(Foam::max(alpha1 - alphaMinFriction, scalar(0)), 9.0);
|
||||
*pow(Foam::max(alpha - alphaMinFriction, scalar(0)), 9.0);
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::nu
|
||||
(
|
||||
const volScalarField& alpha1,
|
||||
const phaseModel& phase,
|
||||
const dimensionedScalar& alphaMinFriction,
|
||||
const dimensionedScalar& alphaMax,
|
||||
const volScalarField& pf,
|
||||
const volSymmTensorField& D
|
||||
) const
|
||||
{
|
||||
const scalar I2Dsmall = 1.0e-15;
|
||||
const volScalarField& alpha = phase;
|
||||
|
||||
// Creating nu assuming it should be 0 on the boundary which may not be
|
||||
// true
|
||||
tmp<volScalarField> tnu
|
||||
(
|
||||
new volScalarField
|
||||
@ -121,13 +123,13 @@ Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::nu
|
||||
IOobject
|
||||
(
|
||||
"Schaeffer:nu",
|
||||
alpha1.mesh().time().timeName(),
|
||||
alpha1.mesh(),
|
||||
phase.mesh().time().timeName(),
|
||||
phase.mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
),
|
||||
alpha1.mesh(),
|
||||
phase.mesh(),
|
||||
dimensionedScalar("nu", dimensionSet(0, 2, -1, 0, 0), 0.0)
|
||||
)
|
||||
);
|
||||
@ -136,16 +138,33 @@ Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::nu
|
||||
|
||||
forAll(D, celli)
|
||||
{
|
||||
if (alpha1[celli] > alphaMinFriction.value())
|
||||
if (alpha[celli] > alphaMinFriction.value())
|
||||
{
|
||||
nuf[celli] =
|
||||
0.5*pf[celli]*sin(phi_.value())
|
||||
/(
|
||||
sqrt(1.0/6.0*(sqr(D[celli].xx() - D[celli].yy())
|
||||
+ sqr(D[celli].yy() - D[celli].zz())
|
||||
+ sqr(D[celli].zz() - D[celli].xx()))
|
||||
+ sqr(D[celli].xy()) + sqr(D[celli].xz())
|
||||
+ sqr(D[celli].yz())) + I2Dsmall
|
||||
sqrt((1.0/3.0)*sqr(tr(D[celli])) - invariantII(D[celli]))
|
||||
+ SMALL
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const fvPatchList& patches = phase.mesh().boundary();
|
||||
const volVectorField& U = phase.U();
|
||||
|
||||
volScalarField::Boundary& nufBf = nuf.boundaryFieldRef();
|
||||
|
||||
forAll(patches, patchi)
|
||||
{
|
||||
if (!patches[patchi].coupled())
|
||||
{
|
||||
nufBf[patchi] =
|
||||
(
|
||||
pf.boundaryField()[patchi]*sin(phi_.value())
|
||||
/(
|
||||
mag(U.boundaryField()[patchi].snGrad())
|
||||
+ SMALL
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -81,21 +81,21 @@ public:
|
||||
|
||||
virtual tmp<volScalarField> frictionalPressure
|
||||
(
|
||||
const volScalarField& alpha1,
|
||||
const phaseModel& phase,
|
||||
const dimensionedScalar& alphaMinFriction,
|
||||
const dimensionedScalar& alphaMax
|
||||
) const;
|
||||
|
||||
virtual tmp<volScalarField> frictionalPressurePrime
|
||||
(
|
||||
const volScalarField& alpha1,
|
||||
const phaseModel& phase,
|
||||
const dimensionedScalar& alphaMinFriction,
|
||||
const dimensionedScalar& alphaMax
|
||||
) const;
|
||||
|
||||
virtual tmp<volScalarField> nu
|
||||
(
|
||||
const volScalarField& alpha1,
|
||||
const phaseModel& phase,
|
||||
const dimensionedScalar& alphaMinFriction,
|
||||
const dimensionedScalar& alphaMax,
|
||||
const volScalarField& pf,
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -36,6 +36,7 @@ SourceFiles
|
||||
#include "volFields.H"
|
||||
#include "dimensionedTypes.H"
|
||||
#include "runTimeSelectionTables.H"
|
||||
#include "phaseModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -107,21 +108,21 @@ public:
|
||||
|
||||
virtual tmp<volScalarField> frictionalPressure
|
||||
(
|
||||
const volScalarField& alpha1,
|
||||
const phaseModel& phase,
|
||||
const dimensionedScalar& alphaMinFriction,
|
||||
const dimensionedScalar& alphaMax
|
||||
) const = 0;
|
||||
|
||||
virtual tmp<volScalarField> frictionalPressurePrime
|
||||
(
|
||||
const volScalarField& alpha1f,
|
||||
const phaseModel& phase,
|
||||
const dimensionedScalar& alphaMinFriction,
|
||||
const dimensionedScalar& alphaMax
|
||||
) const = 0;
|
||||
|
||||
virtual tmp<volScalarField> nu
|
||||
(
|
||||
const volScalarField& alpha1,
|
||||
const phaseModel& phase,
|
||||
const dimensionedScalar& alphaMinFriction,
|
||||
const dimensionedScalar& alphaMax,
|
||||
const volScalarField& pf,
|
||||
|
||||
@ -26,6 +26,7 @@ License
|
||||
#include "kineticTheoryModel.H"
|
||||
#include "mathematicalConstants.H"
|
||||
#include "twoPhaseSystem.H"
|
||||
#include "fvOptions.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
@ -43,10 +44,7 @@ Foam::RASModels::kineticTheoryModel::kineticTheoryModel
|
||||
:
|
||||
eddyViscosity
|
||||
<
|
||||
RASModel<EddyDiffusivity<ThermalDiffusivity
|
||||
<
|
||||
PhaseCompressibleTurbulenceModel<phaseModel>
|
||||
>>>
|
||||
RASModel<EddyDiffusivity<phaseCompressibleTurbulenceModel>>
|
||||
>
|
||||
(
|
||||
type,
|
||||
@ -113,6 +111,13 @@ Foam::RASModels::kineticTheoryModel::kineticTheoryModel
|
||||
coeffDict_
|
||||
),
|
||||
|
||||
maxNut_
|
||||
(
|
||||
"maxNut",
|
||||
dimensionSet(0,2,-1,0,0),
|
||||
coeffDict_.lookupOrDefault<scalar>("maxNut",1000)
|
||||
),
|
||||
|
||||
Theta_
|
||||
(
|
||||
IOobject
|
||||
@ -166,6 +171,20 @@ Foam::RASModels::kineticTheoryModel::kineticTheoryModel
|
||||
),
|
||||
U.mesh(),
|
||||
dimensionedScalar("zero", dimensionSet(1, -1, -1, 0, 0), 0.0)
|
||||
),
|
||||
|
||||
nuFric_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject::groupName("nuFric", phase.name()),
|
||||
U.time().timeName(),
|
||||
U.mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
U.mesh(),
|
||||
dimensionedScalar("zero", dimensionSet(0, 2, -1, 0, 0), 0.0)
|
||||
)
|
||||
{
|
||||
if (type == typeName)
|
||||
@ -189,10 +208,7 @@ bool Foam::RASModels::kineticTheoryModel::read()
|
||||
(
|
||||
eddyViscosity
|
||||
<
|
||||
RASModel<EddyDiffusivity<ThermalDiffusivity
|
||||
<
|
||||
PhaseCompressibleTurbulenceModel<phaseModel>
|
||||
>>>
|
||||
RASModel<EddyDiffusivity<phaseCompressibleTurbulenceModel>>
|
||||
>::read()
|
||||
)
|
||||
{
|
||||
@ -272,7 +288,7 @@ Foam::RASModels::kineticTheoryModel::pPrime() const
|
||||
)
|
||||
+ frictionalStressModel_->frictionalPressurePrime
|
||||
(
|
||||
alpha_,
|
||||
phase_,
|
||||
alphaMinFriction_,
|
||||
alphaMax_
|
||||
)
|
||||
@ -424,6 +440,8 @@ void Foam::RASModels::kineticTheoryModel::correct()
|
||||
// 'thermal' conductivity (Table 3.3, p. 49)
|
||||
kappa_ = conductivityModel_->kappa(alpha, Theta_, gs0_, rho, da, e_);
|
||||
|
||||
fv::options& fvOptions(fv::options::New(mesh_));
|
||||
|
||||
// Construct the granular temperature equation (Eq. 3.20, p. 44)
|
||||
// NB. note that there are two typos in Eq. 3.20:
|
||||
// Ps should be without grad
|
||||
@ -443,10 +461,13 @@ void Foam::RASModels::kineticTheoryModel::correct()
|
||||
+ fvm::Sp(-gammaCoeff, Theta_)
|
||||
+ fvm::Sp(-J1, Theta_)
|
||||
+ fvm::Sp(J2/(Theta_ + ThetaSmall), Theta_)
|
||||
+ fvOptions(alpha, rho, Theta_)
|
||||
);
|
||||
|
||||
ThetaEqn.relax();
|
||||
fvOptions.constrain(ThetaEqn);
|
||||
ThetaEqn.solve();
|
||||
fvOptions.correct(Theta_);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -519,24 +540,25 @@ void Foam::RASModels::kineticTheoryModel::correct()
|
||||
(
|
||||
frictionalStressModel_->frictionalPressure
|
||||
(
|
||||
alpha,
|
||||
phase_,
|
||||
alphaMinFriction_,
|
||||
alphaMax_
|
||||
)
|
||||
);
|
||||
|
||||
// Add frictional shear viscosity, Eq. 3.30, p. 52
|
||||
nut_ += frictionalStressModel_->nu
|
||||
nuFric_ = frictionalStressModel_->nu
|
||||
(
|
||||
alpha,
|
||||
phase_,
|
||||
alphaMinFriction_,
|
||||
alphaMax_,
|
||||
pf/rho,
|
||||
D
|
||||
);
|
||||
|
||||
// Limit viscosity
|
||||
nut_.min(100);
|
||||
// Limit viscosity and add frictional viscosity
|
||||
nut_.min(maxNut_);
|
||||
nuFric_ = min(nuFric_, maxNut_ - nut_);
|
||||
nut_ += nuFric_;
|
||||
}
|
||||
|
||||
if (debug)
|
||||
|
||||
@ -47,8 +47,7 @@ SourceFiles
|
||||
|
||||
#include "RASModel.H"
|
||||
#include "eddyViscosity.H"
|
||||
#include "PhaseCompressibleTurbulenceModel.H"
|
||||
#include "ThermalDiffusivity.H"
|
||||
#include "phaseCompressibleTurbulenceModel.H"
|
||||
#include "EddyDiffusivity.H"
|
||||
#include "phaseModel.H"
|
||||
#include "dragModel.H"
|
||||
@ -74,10 +73,7 @@ class kineticTheoryModel
|
||||
:
|
||||
public eddyViscosity
|
||||
<
|
||||
RASModel<EddyDiffusivity<ThermalDiffusivity
|
||||
<
|
||||
PhaseCompressibleTurbulenceModel<phaseModel>
|
||||
>>>
|
||||
RASModel<EddyDiffusivity<phaseCompressibleTurbulenceModel>>
|
||||
>
|
||||
{
|
||||
// Private data
|
||||
@ -124,6 +120,9 @@ class kineticTheoryModel
|
||||
//- Residual phase fraction
|
||||
dimensionedScalar residualAlpha_;
|
||||
|
||||
//- Maximum turbulent viscosity
|
||||
dimensionedScalar maxNut_;
|
||||
|
||||
|
||||
// Kinetic Theory Model Fields
|
||||
|
||||
@ -139,6 +138,9 @@ class kineticTheoryModel
|
||||
//- The granular "thermal" conductivity
|
||||
volScalarField kappa_;
|
||||
|
||||
//- The frictional viscosity
|
||||
volScalarField nuFric_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
|
||||
@ -0,0 +1,52 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Typedef
|
||||
Foam::phaseCompressibleTurbulenceModel
|
||||
|
||||
Description
|
||||
Typedef for phaseCompressibleTurbulenceModel
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef phaseCompressibleTurbulenceModel_H
|
||||
#define phaseCompressibleTurbulenceModel_H
|
||||
|
||||
#include "phaseCompressibleTurbulenceModelFwd.H"
|
||||
#include "PhaseCompressibleTurbulenceModel.H"
|
||||
#include "ThermalDiffusivity.H"
|
||||
#include "phaseModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
typedef ThermalDiffusivity<PhaseCompressibleTurbulenceModel<phaseModel>>
|
||||
phaseCompressibleTurbulenceModel;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,55 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Typedef
|
||||
Foam::phaseCompressibleTurbulenceModel
|
||||
|
||||
Description
|
||||
Forward declaration of typedef for phaseCompressibleTurbulenceModel
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef phaseCompressibleTurbulenceModelFwd_H
|
||||
#define phaseCompressibleTurbulenceModelFwd_H
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
class phaseModel;
|
||||
|
||||
template<class TransportModel>
|
||||
class PhaseCompressibleTurbulenceModel;
|
||||
|
||||
template<class BasicTurbulenceModel>
|
||||
class ThermalDiffusivity;
|
||||
|
||||
typedef ThermalDiffusivity<PhaseCompressibleTurbulenceModel<phaseModel>>
|
||||
phaseCompressibleTurbulenceModel;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -523,7 +523,7 @@ void Foam::twoPhaseSystem::solve()
|
||||
fvScalarMatrix alpha1Eqn
|
||||
(
|
||||
fvm::ddt(alpha1) - fvc::ddt(alpha1)
|
||||
- fvm::laplacian(alpha1alpha2f*pPrimeByA_(), alpha1, "bounded")
|
||||
- fvm::laplacian(alpha1alpha2f()*pPrimeByA_(), alpha1, "bounded")
|
||||
);
|
||||
|
||||
alpha1Eqn.relax();
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/mesh/blockMesh/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/fileFormats/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lblockMesh \
|
||||
-lmeshTools \
|
||||
-lfileFormats \
|
||||
-ldynamicMesh
|
||||
|
||||
@ -179,8 +179,6 @@ int main(int argc, char *argv[])
|
||||
Info<< "Creating block mesh from\n "
|
||||
<< meshDictIO.objectPath() << endl;
|
||||
|
||||
blockMesh::verbose(true);
|
||||
|
||||
IOdictionary meshDict(meshDictIO);
|
||||
blockMesh blocks(meshDict, regionName);
|
||||
|
||||
@ -289,8 +287,8 @@ int main(int argc, char *argv[])
|
||||
forAll(blocks, blockI)
|
||||
{
|
||||
const block& b = blocks[blockI];
|
||||
const labelListList& blockCells = b.cells();
|
||||
const word& zoneName = b.blockDef().zoneName();
|
||||
const List<FixedList<label, 8>> blockCells = b.cells();
|
||||
const word& zoneName = b.zoneName();
|
||||
|
||||
if (zoneName.size())
|
||||
{
|
||||
|
||||
@ -41,8 +41,6 @@ SourceFiles
|
||||
#ifndef conformalVoronoiMesh_H
|
||||
#define conformalVoronoiMesh_H
|
||||
|
||||
// Include uint.H before CGAL headers to define __STDC_LIMIT_MACROS
|
||||
#include "uint.H"
|
||||
#include "CGALTriangulation3Ddefs.H"
|
||||
#include "searchableSurfaces.H"
|
||||
#include "conformationSurfaces.H"
|
||||
|
||||
@ -39,8 +39,6 @@ SourceFiles
|
||||
#ifndef featurePointConformer_H
|
||||
#define featurePointConformer_H
|
||||
|
||||
// Include uint.H before CGAL headers to define __STDC_LIMIT_MACROS
|
||||
#include "uint.H"
|
||||
#include "CGALTriangulation3Ddefs.H"
|
||||
#include "vector.H"
|
||||
#include "DynamicList.H"
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -117,8 +117,6 @@ SourceFiles
|
||||
#define CGAL_INEXACT
|
||||
#define CGAL_HIERARCHY
|
||||
|
||||
// Include uint.H before CGAL headers to define __STDC_LIMIT_MACROS
|
||||
#include "uint.H"
|
||||
#include "CGALTriangulation2Ddefs.H"
|
||||
#include "Time.H"
|
||||
#include "point2DFieldFwd.H"
|
||||
|
||||
@ -43,14 +43,21 @@ Usage
|
||||
- \par -set \<value\>
|
||||
Adds or replaces the entry
|
||||
|
||||
- \par -remove
|
||||
Remove the selected entry
|
||||
|
||||
- \par -diff \<dictionary\>
|
||||
Write differences with respect to the specified dictionary
|
||||
(or sub entry if -entry specified)
|
||||
|
||||
- \par -expand
|
||||
Read the specified dictionary file, expand the macros etc. and write
|
||||
the resulting dictionary to standard output.
|
||||
|
||||
- \par -includes
|
||||
List the \c #include and \c #includeIfPresent files to standard output.
|
||||
List the \c #include and \c #includeIfPresent files to standard output
|
||||
|
||||
Typical usage:
|
||||
Example usage:
|
||||
- Change simulation to run for one timestep only:
|
||||
\verbatim
|
||||
foamDictionary system/controlDict -entry stopAt -set writeNow
|
||||
@ -78,6 +85,18 @@ Usage
|
||||
-set "{type uniformFixedValue; uniformValue (2 0 0);}"
|
||||
\endverbatim
|
||||
|
||||
- Write the differences with respect to a template dictionary:
|
||||
\verbatim
|
||||
foamDictionary 0/U -diff $FOAM_ETC/templates/closedVolume/0/U
|
||||
\endverbatim
|
||||
|
||||
- Write the differences in boundaryField with respect to a
|
||||
template dictionary:
|
||||
\verbatim
|
||||
foamDictionary 0/U -diff $FOAM_ETC/templates/closedVolume/0/U \
|
||||
-entry boundaryField
|
||||
\endverbatim
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "argList.H"
|
||||
@ -111,135 +130,94 @@ word scope(const fileName& entryName)
|
||||
}
|
||||
|
||||
|
||||
//- Extract keyword (last bit of scoped name
|
||||
word keyword(const word& scopedName)
|
||||
//- Extracts dict name and keyword
|
||||
Pair<word> dictAndKeyword(const word& scopedName)
|
||||
{
|
||||
word key(scopedName);
|
||||
string::size_type i = scopedName.find_last_of(".");
|
||||
if (i != string::npos)
|
||||
{
|
||||
key = scopedName.substr(i+1, string::npos);
|
||||
}
|
||||
return key;
|
||||
}
|
||||
|
||||
|
||||
void setScoped
|
||||
(
|
||||
dictionary& dict,
|
||||
const word& keyword,
|
||||
const bool overwrite,
|
||||
entry* d
|
||||
)
|
||||
{
|
||||
if (keyword[0] == ':')
|
||||
{
|
||||
// Go up to top level and recurse to find entries
|
||||
setScoped
|
||||
return Pair<word>
|
||||
(
|
||||
const_cast<dictionary&>(dict.topDict()),
|
||||
keyword.substr(1, keyword.size()-1),
|
||||
overwrite,
|
||||
d
|
||||
scopedName.substr(0, i),
|
||||
scopedName.substr(i+1, string::npos)
|
||||
);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
string::size_type dotPos = keyword.find('.');
|
||||
return Pair<word>("", scopedName);
|
||||
}
|
||||
}
|
||||
|
||||
if (dotPos == string::npos)
|
||||
|
||||
const dictionary& lookupScopedDict
|
||||
(
|
||||
const dictionary& dict,
|
||||
const word& subDictName
|
||||
)
|
||||
{
|
||||
if (subDictName == "")
|
||||
{
|
||||
return dict;
|
||||
}
|
||||
else
|
||||
{
|
||||
const entry* entPtr = dict.lookupScopedEntryPtr
|
||||
(
|
||||
subDictName,
|
||||
false,
|
||||
false
|
||||
);
|
||||
if (!entPtr || !entPtr->isDict())
|
||||
{
|
||||
// Non-scoped lookup
|
||||
if (overwrite)
|
||||
{
|
||||
dict.set(d);
|
||||
}
|
||||
else
|
||||
{
|
||||
dict.add(d, false);
|
||||
}
|
||||
return;
|
||||
FatalIOErrorInFunction(dict)
|
||||
<< "keyword " << subDictName
|
||||
<< " is undefined in dictionary "
|
||||
<< dict.name() << " or is not a dictionary"
|
||||
<< endl
|
||||
<< "Valid keywords are " << dict.keys()
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
else
|
||||
return entPtr->dict();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void remove(dictionary& dict, const dictionary& removeDict)
|
||||
{
|
||||
forAllConstIter(dictionary, removeDict, iter)
|
||||
{
|
||||
const entry* entPtr = dict.lookupEntryPtr
|
||||
(
|
||||
iter().keyword(),
|
||||
false,
|
||||
false
|
||||
);
|
||||
|
||||
if (entPtr)
|
||||
{
|
||||
if (dotPos == 0)
|
||||
if (entPtr->isDict())
|
||||
{
|
||||
// Starting with a '.'. Go up for every 2nd '.' found
|
||||
|
||||
const dictionary* dictPtr = &dict;
|
||||
|
||||
string::size_type begVar = dotPos + 1;
|
||||
string::const_iterator iter =
|
||||
keyword.begin() + begVar;
|
||||
string::size_type endVar = begVar;
|
||||
while
|
||||
(
|
||||
iter != keyword.end()
|
||||
&& *iter == '.'
|
||||
)
|
||||
if (iter().isDict())
|
||||
{
|
||||
++iter;
|
||||
++endVar;
|
||||
remove
|
||||
(
|
||||
const_cast<dictionary&>(entPtr->dict()),
|
||||
iter().dict()
|
||||
);
|
||||
|
||||
// Go to parent
|
||||
if (&dictPtr->parent() == &dictionary::null)
|
||||
// Check if dictionary is empty
|
||||
if (!entPtr->dict().size())
|
||||
{
|
||||
FatalIOErrorInFunction(dict)
|
||||
<< "No parent of current dictionary"
|
||||
<< " when searching for "
|
||||
<< keyword.substr
|
||||
(
|
||||
begVar,
|
||||
keyword.size() - begVar
|
||||
)
|
||||
<< exit(FatalIOError);
|
||||
dict.remove(iter().keyword());
|
||||
}
|
||||
dictPtr = &dictPtr->parent();
|
||||
}
|
||||
|
||||
setScoped
|
||||
(
|
||||
const_cast<dictionary&>(*dictPtr),
|
||||
keyword.substr(endVar),
|
||||
overwrite,
|
||||
d
|
||||
);
|
||||
return;
|
||||
}
|
||||
else
|
||||
else if (!iter().isDict())
|
||||
{
|
||||
// Extract the first word
|
||||
word firstWord = keyword.substr(0, dotPos);
|
||||
|
||||
const entry* entPtr = dict.lookupScopedEntryPtr
|
||||
(
|
||||
firstWord,
|
||||
false, // Recursive
|
||||
false
|
||||
);
|
||||
|
||||
if (!entPtr || !entPtr->isDict())
|
||||
if (*entPtr == iter())
|
||||
{
|
||||
FatalIOErrorInFunction(dict)
|
||||
<< "keyword " << firstWord
|
||||
<< " is undefined in dictionary "
|
||||
<< dict.name() << " or is not a dictionary"
|
||||
<< endl
|
||||
<< "Valid keywords are " << dict.keys()
|
||||
<< exit(FatalIOError);
|
||||
dict.remove(iter().keyword());
|
||||
}
|
||||
|
||||
const dictionary& firstDict = entPtr->dict();
|
||||
|
||||
setScoped
|
||||
(
|
||||
const_cast<dictionary&>(firstDict),
|
||||
keyword.substr(dotPos, keyword.size()-dotPos),
|
||||
overwrite,
|
||||
d
|
||||
);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -257,30 +235,41 @@ int main(int argc, char *argv[])
|
||||
argList::addBoolOption
|
||||
(
|
||||
"value",
|
||||
"print entry value"
|
||||
"Print entry value"
|
||||
);
|
||||
argList::addOption
|
||||
(
|
||||
"set",
|
||||
"value",
|
||||
"set entry value or add new entry"
|
||||
"Set entry value or add new entry"
|
||||
);
|
||||
argList::addOption
|
||||
(
|
||||
"add",
|
||||
"value",
|
||||
"add a new entry"
|
||||
"Add a new entry"
|
||||
);
|
||||
argList::addBoolOption
|
||||
(
|
||||
"remove",
|
||||
"Remove the entry."
|
||||
);
|
||||
argList::addOption
|
||||
(
|
||||
"diff",
|
||||
"dict",
|
||||
"Write differences with respect to the specified dictionary"
|
||||
);
|
||||
argList::addBoolOption
|
||||
(
|
||||
"includes",
|
||||
"List the #include/#includeIfPresent files to standard output."
|
||||
"List the #include/#includeIfPresent files to standard output"
|
||||
);
|
||||
argList::addBoolOption
|
||||
(
|
||||
"expand",
|
||||
"Read the specified dictionary file, expand the macros etc. and write "
|
||||
"the resulting dictionary to standard output."
|
||||
"the resulting dictionary to standard output"
|
||||
);
|
||||
|
||||
argList args(argc, argv);
|
||||
@ -295,140 +284,212 @@ int main(int argc, char *argv[])
|
||||
fileName dictFileName(args[1]);
|
||||
|
||||
autoPtr<IFstream> dictFile(new IFstream(dictFileName));
|
||||
|
||||
if (dictFile().good())
|
||||
{
|
||||
bool changed = false;
|
||||
|
||||
// Read but preserve headers
|
||||
dictionary dict;
|
||||
dict.read(dictFile(), true);
|
||||
|
||||
if (listIncludes)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else if (args.optionFound("expand"))
|
||||
{
|
||||
IOobject::writeBanner(Info)
|
||||
<<"//\n// " << dictFileName << "\n//\n";
|
||||
dict.write(Info, false);
|
||||
IOobject::writeDivider(Info);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
word entryName;
|
||||
if (args.optionReadIfPresent("entry", entryName))
|
||||
{
|
||||
word scopedName(scope(entryName));
|
||||
|
||||
string newValue;
|
||||
if
|
||||
(
|
||||
args.optionReadIfPresent("set", newValue)
|
||||
|| args.optionReadIfPresent("add", newValue)
|
||||
)
|
||||
{
|
||||
bool overwrite = args.optionFound("set");
|
||||
|
||||
word key(keyword(scopedName));
|
||||
|
||||
IStringStream str(string(key) + ' ' + newValue + ';');
|
||||
setScoped(dict, scopedName, overwrite, entry::New(str).ptr());
|
||||
changed = true;
|
||||
|
||||
// Print the changed entry
|
||||
const entry* entPtr = dict.lookupScopedEntryPtr
|
||||
(
|
||||
scopedName,
|
||||
false,
|
||||
true // Support wildcards
|
||||
);
|
||||
if (entPtr)
|
||||
{
|
||||
Info<< *entPtr << endl;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
const entry* entPtr = dict.lookupScopedEntryPtr
|
||||
(
|
||||
scopedName,
|
||||
false,
|
||||
true // Support wildcards
|
||||
);
|
||||
|
||||
if (entPtr)
|
||||
{
|
||||
if (args.optionFound("keywords"))
|
||||
{
|
||||
const dictionary& dict = entPtr->dict();
|
||||
forAllConstIter(dictionary, dict, iter)
|
||||
{
|
||||
Info<< iter().keyword() << endl;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (args.optionFound("value"))
|
||||
{
|
||||
if (entPtr->isStream())
|
||||
{
|
||||
const tokenList& tokens = entPtr->stream();
|
||||
forAll(tokens, i)
|
||||
{
|
||||
Info<< tokens[i] << token::SPACE;
|
||||
}
|
||||
Info<< endl;
|
||||
}
|
||||
else if (entPtr->isDict())
|
||||
{
|
||||
Info<< entPtr->dict();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< *entPtr << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalIOErrorInFunction(dictFile)
|
||||
<< "Cannot find entry " << entryName
|
||||
<< exit(FatalError, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (args.optionFound("keywords"))
|
||||
{
|
||||
forAllConstIter(dictionary, dict, iter)
|
||||
{
|
||||
Info<< iter().keyword() << endl;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< dict;
|
||||
}
|
||||
|
||||
if (changed)
|
||||
{
|
||||
dictFile.clear();
|
||||
OFstream os(dictFileName);
|
||||
IOobject::writeBanner(os);
|
||||
dict.write(os, false);
|
||||
IOobject::writeEndDivider(os);
|
||||
}
|
||||
}
|
||||
else
|
||||
if (!dictFile().good())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Cannot open file " << dictFileName
|
||||
<< exit(FatalError, 1);
|
||||
}
|
||||
|
||||
|
||||
bool changed = false;
|
||||
|
||||
// Read but preserve headers
|
||||
dictionary dict;
|
||||
dict.read(dictFile(), true);
|
||||
|
||||
if (listIncludes)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else if (args.optionFound("expand"))
|
||||
{
|
||||
IOobject::writeBanner(Info)
|
||||
<<"//\n// " << dictFileName << "\n//\n";
|
||||
dict.write(Info, false);
|
||||
IOobject::writeDivider(Info);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// Second dictionary for -diff
|
||||
dictionary diffDict;
|
||||
fileName diffFileName;
|
||||
if (args.optionReadIfPresent("diff", diffFileName))
|
||||
{
|
||||
autoPtr<IFstream> diffFile(new IFstream(diffFileName));
|
||||
if (!diffFile().good())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Cannot open file " << diffFileName
|
||||
<< exit(FatalError, 1);
|
||||
}
|
||||
|
||||
// Read but preserve headers
|
||||
diffDict.read(diffFile(), true);
|
||||
}
|
||||
|
||||
|
||||
word entryName;
|
||||
if (args.optionReadIfPresent("entry", entryName))
|
||||
{
|
||||
word scopedName(scope(entryName));
|
||||
|
||||
string newValue;
|
||||
if
|
||||
(
|
||||
args.optionReadIfPresent("set", newValue)
|
||||
|| args.optionReadIfPresent("add", newValue)
|
||||
)
|
||||
{
|
||||
bool overwrite = args.optionFound("set");
|
||||
|
||||
Pair<word> dAk(dictAndKeyword(scopedName));
|
||||
|
||||
IStringStream str(string(dAk.second()) + ' ' + newValue + ';');
|
||||
entry* ePtr(entry::New(str).ptr());
|
||||
const dictionary& d(lookupScopedDict(dict, dAk.first()));
|
||||
|
||||
if (overwrite)
|
||||
{
|
||||
const_cast<dictionary&>(d).set(ePtr);
|
||||
}
|
||||
else
|
||||
{
|
||||
const_cast<dictionary&>(d).add(ePtr, false);
|
||||
}
|
||||
changed = true;
|
||||
|
||||
// Print the changed entry
|
||||
const entry* entPtr = dict.lookupScopedEntryPtr
|
||||
(
|
||||
scopedName,
|
||||
false,
|
||||
true // Support wildcards
|
||||
);
|
||||
if (entPtr)
|
||||
{
|
||||
Info<< *entPtr << endl;
|
||||
}
|
||||
}
|
||||
else if (args.optionFound("remove"))
|
||||
{
|
||||
// Extract dictionary name and keyword
|
||||
Pair<word> dAk(dictAndKeyword(scopedName));
|
||||
|
||||
const dictionary& d(lookupScopedDict(dict, dAk.first()));
|
||||
const_cast<dictionary&>(d).remove(dAk.second());
|
||||
changed = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Optionally remove a second dictionary
|
||||
if (args.optionFound("diff"))
|
||||
{
|
||||
Pair<word> dAk(dictAndKeyword(scopedName));
|
||||
|
||||
const dictionary& d(lookupScopedDict(dict, dAk.first()));
|
||||
const dictionary& d2(lookupScopedDict(diffDict, dAk.first()));
|
||||
|
||||
const entry* ePtr =
|
||||
d.lookupEntryPtr(dAk.second(), false, true);
|
||||
const entry* e2Ptr =
|
||||
d2.lookupEntryPtr(dAk.second(), false, true);
|
||||
|
||||
if (ePtr && e2Ptr)
|
||||
{
|
||||
if (*ePtr == *e2Ptr)
|
||||
{
|
||||
const_cast<dictionary&>(d).remove(dAk.second());
|
||||
}
|
||||
else if (ePtr->isDict() && e2Ptr->isDict())
|
||||
{
|
||||
remove
|
||||
(
|
||||
const_cast<dictionary&>(ePtr->dict()),
|
||||
e2Ptr->dict()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const entry* entPtr = dict.lookupScopedEntryPtr
|
||||
(
|
||||
scopedName,
|
||||
false,
|
||||
true // Support wildcards
|
||||
);
|
||||
|
||||
if (entPtr)
|
||||
{
|
||||
if (args.optionFound("keywords"))
|
||||
{
|
||||
const dictionary& dict = entPtr->dict();
|
||||
forAllConstIter(dictionary, dict, iter)
|
||||
{
|
||||
Info<< iter().keyword() << endl;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (args.optionFound("value"))
|
||||
{
|
||||
if (entPtr->isStream())
|
||||
{
|
||||
const tokenList& tokens = entPtr->stream();
|
||||
forAll(tokens, i)
|
||||
{
|
||||
Info<< tokens[i] << token::SPACE;
|
||||
}
|
||||
Info<< endl;
|
||||
}
|
||||
else if (entPtr->isDict())
|
||||
{
|
||||
Info<< entPtr->dict();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< *entPtr << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalIOErrorInFunction(dictFile)
|
||||
<< "Cannot find entry " << entryName
|
||||
<< exit(FatalError, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (args.optionFound("keywords"))
|
||||
{
|
||||
forAllConstIter(dictionary, dict, iter)
|
||||
{
|
||||
Info<< iter().keyword() << endl;
|
||||
}
|
||||
}
|
||||
else if (args.optionFound("diff"))
|
||||
{
|
||||
remove(dict, diffDict);
|
||||
dict.write(Info, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
dict.write(Info, false);
|
||||
}
|
||||
|
||||
if (changed)
|
||||
{
|
||||
dictFile.clear();
|
||||
OFstream os(dictFileName);
|
||||
IOobject::writeBanner(os);
|
||||
dict.write(os, false);
|
||||
IOobject::writeEndDivider(os);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -384,7 +384,6 @@ void Foam::tecplotWriter::writeConnectivity(const fvMesh& mesh) const
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::tecplotWriter::writeConnectivity
|
||||
(
|
||||
const indirectPrimitivePatch& pp
|
||||
@ -394,7 +393,8 @@ void Foam::tecplotWriter::writeConnectivity
|
||||
INTEGER4 NumFaceNodes = 2*pp.nEdges();
|
||||
|
||||
// All faces (=edges) have 2 nodes
|
||||
List<INTEGER4> FaceNodeCounts(NumFaces, 2);
|
||||
List<INTEGER4> FaceNodeCounts(NumFaces);
|
||||
FaceNodeCounts = 2;
|
||||
|
||||
List<INTEGER4> FaceNodes(NumFaceNodes);
|
||||
label nodeI = 0;
|
||||
|
||||
@ -93,7 +93,7 @@ Foam::tmp<Field<Type>> Foam::tecplotWriter::getFaceField
|
||||
const polyBoundaryMesh& patches = sfld.mesh().boundaryMesh();
|
||||
|
||||
tmp<Field<Type>> tfld(new Field<Type>(faceLabels.size()));
|
||||
Field<Type>& fld = tfld();
|
||||
Field<Type>& fld = tfld.ref();
|
||||
|
||||
forAll(faceLabels, i)
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -156,7 +156,7 @@ public:
|
||||
if (useSubMesh())
|
||||
{
|
||||
tmp<GeoField> subFld = subsetter_.interpolate(fld);
|
||||
subFld().rename(fld.name());
|
||||
subFld.ref().rename(fld.name());
|
||||
return subFld;
|
||||
}
|
||||
else
|
||||
|
||||
@ -75,7 +75,7 @@ void Foam::vtkPV3blockMesh::updateInfoBlocks
|
||||
const int nBlocks = blkMesh.size();
|
||||
for (int blockI = 0; blockI < nBlocks; ++blockI)
|
||||
{
|
||||
const blockDescriptor& blockDef = blkMesh[blockI].blockDef();
|
||||
const blockDescriptor& blockDef = blkMesh[blockI];
|
||||
|
||||
word partName = Foam::name(blockI);
|
||||
|
||||
@ -115,7 +115,7 @@ void Foam::vtkPV3blockMesh::updateInfoEdges
|
||||
arrayRangeEdges_.reset( arraySelection->GetNumberOfArrays() );
|
||||
|
||||
const blockMesh& blkMesh = *meshPtr_;
|
||||
const curvedEdgeList& edges = blkMesh.edges();
|
||||
const blockEdgeList& edges = blkMesh.edges();
|
||||
|
||||
const int nEdges = edges.size();
|
||||
forAll(edges, edgeI)
|
||||
@ -429,7 +429,7 @@ void Foam::vtkPV3blockMesh::renderPointNumbers
|
||||
|
||||
if (show && meshPtr_)
|
||||
{
|
||||
const pointField& cornerPts = meshPtr_->blockPointField();
|
||||
const pointField& cornerPts = meshPtr_->vertices();
|
||||
const scalar scaleFactor = meshPtr_->scaleFactor();
|
||||
|
||||
pointNumberTextActorsPtrs_.setSize(cornerPts.size());
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -55,7 +55,7 @@ void Foam::vtkPV3blockMesh::convertMeshBlocks
|
||||
label datasetNo = 0; // restart at dataset 0
|
||||
|
||||
const blockMesh& blkMesh = *meshPtr_;
|
||||
const Foam::pointField& blockPoints = blkMesh.blockPointField();
|
||||
const Foam::pointField& blockPoints = blkMesh.vertices();
|
||||
|
||||
if (debug)
|
||||
{
|
||||
@ -77,7 +77,7 @@ void Foam::vtkPV3blockMesh::convertMeshBlocks
|
||||
continue;
|
||||
}
|
||||
|
||||
const blockDescriptor& blockDef = blkMesh[blockI].blockDef();
|
||||
const blockDescriptor& blockDef = blkMesh[blockI];
|
||||
|
||||
vtkUnstructuredGrid* vtkmesh = vtkUnstructuredGrid::New();
|
||||
|
||||
@ -148,7 +148,7 @@ void Foam::vtkPV3blockMesh::convertMeshEdges
|
||||
label datasetNo = 0; // restart at dataset 0
|
||||
|
||||
const blockMesh& blkMesh = *meshPtr_;
|
||||
const curvedEdgeList& edges = blkMesh.edges();
|
||||
const blockEdgeList& edges = blkMesh.edges();
|
||||
|
||||
int edgeI = 0;
|
||||
const scalar scaleFactor = blkMesh.scaleFactor();
|
||||
@ -168,7 +168,7 @@ void Foam::vtkPV3blockMesh::convertMeshEdges
|
||||
// search each block
|
||||
forAll(blkMesh, blockI)
|
||||
{
|
||||
const blockDescriptor& blockDef = blkMesh[blockI].blockDef();
|
||||
const blockDescriptor& blockDef = blkMesh[blockI];
|
||||
|
||||
edgeList blkEdges = blockDef.blockShape().edges();
|
||||
|
||||
@ -256,7 +256,7 @@ void Foam::vtkPV3blockMesh::convertMeshCorners
|
||||
range.block(blockNo); // set output block
|
||||
label datasetNo = 0; // restart at dataset 0
|
||||
|
||||
const pointField& blockPoints = meshPtr_->blockPointField();
|
||||
const pointField& blockPoints = meshPtr_->vertices();
|
||||
const scalar& scaleFactor = meshPtr_->scaleFactor();
|
||||
|
||||
if (debug)
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/fileFormats/lnInclude \
|
||||
-I$(LIB_SRC)/mesh/blockMesh/lnInclude \
|
||||
-I$(ParaView_INCLUDE_DIR) \
|
||||
-I$(ParaView_INCLUDE_DIR)/vtkkwiml \
|
||||
@ -8,6 +9,7 @@ EXE_INC = \
|
||||
|
||||
LIB_LIBS = \
|
||||
-lmeshTools \
|
||||
-lfileFormats \
|
||||
-lblockMesh \
|
||||
-L$(FOAM_LIBBIN) -lvtkPVReaders \
|
||||
$(GLIBS)
|
||||
|
||||
@ -75,7 +75,7 @@ void Foam::vtkPVblockMesh::updateInfoBlocks
|
||||
const int nBlocks = blkMesh.size();
|
||||
for (int blockI = 0; blockI < nBlocks; ++blockI)
|
||||
{
|
||||
const blockDescriptor& blockDef = blkMesh[blockI].blockDef();
|
||||
const blockDescriptor& blockDef = blkMesh[blockI];
|
||||
|
||||
word partName = Foam::name(blockI);
|
||||
|
||||
@ -115,7 +115,7 @@ void Foam::vtkPVblockMesh::updateInfoEdges
|
||||
arrayRangeEdges_.reset( arraySelection->GetNumberOfArrays() );
|
||||
|
||||
const blockMesh& blkMesh = *meshPtr_;
|
||||
const curvedEdgeList& edges = blkMesh.edges();
|
||||
const blockEdgeList& edges = blkMesh.edges();
|
||||
|
||||
const int nEdges = edges.size();
|
||||
forAll(edges, edgeI)
|
||||
@ -429,7 +429,7 @@ void Foam::vtkPVblockMesh::renderPointNumbers
|
||||
|
||||
if (show && meshPtr_)
|
||||
{
|
||||
const pointField& cornerPts = meshPtr_->blockPointField();
|
||||
const pointField& cornerPts = meshPtr_->vertices();
|
||||
const scalar scaleFactor = meshPtr_->scaleFactor();
|
||||
|
||||
pointNumberTextActorsPtrs_.setSize(cornerPts.size());
|
||||
|
||||
@ -55,7 +55,7 @@ void Foam::vtkPVblockMesh::convertMeshBlocks
|
||||
label datasetNo = 0; // restart at dataset 0
|
||||
|
||||
const blockMesh& blkMesh = *meshPtr_;
|
||||
const Foam::pointField& blockPoints = blkMesh.blockPointField();
|
||||
const Foam::pointField& blockPoints = blkMesh.vertices();
|
||||
|
||||
if (debug)
|
||||
{
|
||||
@ -77,7 +77,7 @@ void Foam::vtkPVblockMesh::convertMeshBlocks
|
||||
continue;
|
||||
}
|
||||
|
||||
const blockDescriptor& blockDef = blkMesh[blockI].blockDef();
|
||||
const blockDescriptor& blockDef = blkMesh[blockI];
|
||||
|
||||
vtkUnstructuredGrid* vtkmesh = vtkUnstructuredGrid::New();
|
||||
|
||||
@ -148,7 +148,7 @@ void Foam::vtkPVblockMesh::convertMeshEdges
|
||||
label datasetNo = 0; // restart at dataset 0
|
||||
|
||||
const blockMesh& blkMesh = *meshPtr_;
|
||||
const curvedEdgeList& edges = blkMesh.edges();
|
||||
const blockEdgeList& edges = blkMesh.edges();
|
||||
|
||||
int edgeI = 0;
|
||||
const scalar scaleFactor = blkMesh.scaleFactor();
|
||||
@ -168,10 +168,15 @@ void Foam::vtkPVblockMesh::convertMeshEdges
|
||||
// search each block
|
||||
forAll(blkMesh, blockI)
|
||||
{
|
||||
const blockDescriptor& blockDef = blkMesh[blockI].blockDef();
|
||||
const blockDescriptor& blockDef = blkMesh[blockI];
|
||||
|
||||
edgeList blkEdges = blockDef.blockShape().edges();
|
||||
|
||||
// List of edge point and weighting factors
|
||||
pointField edgesPoints[12];
|
||||
scalarList edgesWeights[12];
|
||||
blockDef.edgesPointsWeights(edgesPoints, edgesWeights);
|
||||
|
||||
// find the corresponding edge within the block
|
||||
label foundEdgeI = -1;
|
||||
forAll(blkEdges, blkEdgeI)
|
||||
@ -185,9 +190,7 @@ void Foam::vtkPVblockMesh::convertMeshEdges
|
||||
|
||||
if (foundEdgeI != -1)
|
||||
{
|
||||
const List<point>& edgePoints =
|
||||
blockDef.blockEdgePoints()[foundEdgeI];
|
||||
|
||||
const List<point>& edgePoints = edgesPoints[foundEdgeI];
|
||||
|
||||
vtkPolyData* vtkmesh = vtkPolyData::New();
|
||||
vtkPoints* vtkpoints = vtkPoints::New();
|
||||
@ -256,7 +259,7 @@ void Foam::vtkPVblockMesh::convertMeshCorners
|
||||
range.block(blockNo); // set output block
|
||||
label datasetNo = 0; // restart at dataset 0
|
||||
|
||||
const pointField& blockPoints = meshPtr_->blockPointField();
|
||||
const pointField& blockPoints = meshPtr_->vertices();
|
||||
const scalar& scaleFactor = meshPtr_->scaleFactor();
|
||||
|
||||
if (debug)
|
||||
|
||||
@ -104,14 +104,7 @@ cleanCase()
|
||||
cleanSnappyFiles
|
||||
if [ -d constant/polyMesh ]
|
||||
then
|
||||
(cd constant/polyMesh && \
|
||||
rm -rf \
|
||||
allOwner* cell* face* meshModifiers* \
|
||||
owner* neighbour* point* edge* \
|
||||
cellLevel* pointLevel* refinementHistory* level0Edge* surfaceIndex* sets \
|
||||
boundary \
|
||||
> /dev/null 2>&1 \
|
||||
)
|
||||
rm -rf constant/polyMesh > /dev/null 2>&1
|
||||
fi
|
||||
if [ -d constant ]
|
||||
then
|
||||
|
||||
@ -86,8 +86,9 @@ unsetenv WM_THIRD_PARTY_DIR
|
||||
|
||||
unsetenv FOAM_APPBIN
|
||||
unsetenv FOAM_APP
|
||||
unsetenv FOAM_EXT_LIBBIN
|
||||
unsetenv FOAM_CODE_TEMPLATES
|
||||
unsetenv FOAM_ETC
|
||||
unsetenv FOAM_EXT_LIBBIN
|
||||
unsetenv FOAM_INST_DIR
|
||||
unsetenv FOAM_JOB_DIR
|
||||
unsetenv FOAM_LIBBIN
|
||||
|
||||
@ -77,8 +77,9 @@ unset WM_THIRD_PARTY_DIR
|
||||
|
||||
unset FOAM_APPBIN
|
||||
unset FOAM_APP
|
||||
unset FOAM_EXT_LIBBIN
|
||||
unset FOAM_CODE_TEMPLATES
|
||||
unset FOAM_ETC
|
||||
unset FOAM_EXT_LIBBIN
|
||||
unset FOAM_INST_DIR
|
||||
unset FOAM_JOB_DIR
|
||||
unset FOAM_LIBBIN
|
||||
|
||||
@ -31,8 +31,7 @@ Description
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// add to hash-table of functions with typename as the key
|
||||
//- Add to hash-table of functions with typename as the key
|
||||
#define addToRunTimeSelectionTable\
|
||||
(baseType,thisType,argNames) \
|
||||
\
|
||||
@ -41,7 +40,7 @@ Description
|
||||
add##thisType##argNames##ConstructorTo##baseType##Table_
|
||||
|
||||
|
||||
// add to hash-table of functions with 'lookup' as the key
|
||||
//- Add to hash-table of functions with 'lookup' as the key
|
||||
#define addNamedToRunTimeSelectionTable\
|
||||
(baseType,thisType,argNames,lookup) \
|
||||
\
|
||||
@ -51,7 +50,7 @@ Description
|
||||
(#lookup)
|
||||
|
||||
|
||||
// add to hash-table of functions with typename as the key
|
||||
//- Add to hash-table of functions with typename as the key
|
||||
#define addRemovableToRunTimeSelectionTable\
|
||||
(baseType,thisType,argNames) \
|
||||
\
|
||||
@ -60,7 +59,7 @@ Description
|
||||
addRemovable##thisType##argNames##ConstructorTo##baseType##Table_
|
||||
|
||||
|
||||
// add to hash-table of functions with 'lookup' as the key
|
||||
//- Add to hash-table of functions with 'lookup' as the key
|
||||
#define addRemovableNamedToRunTimeSelectionTable\
|
||||
(baseType,thisType,argNames,lookup) \
|
||||
\
|
||||
@ -72,9 +71,8 @@ Description
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// add to hash-table of functions with typename as the key
|
||||
// use when baseType doesn't need a template argument (eg, is a typedef)
|
||||
//- Add to hash-table of functions with typename as the key.
|
||||
// Use when baseType doesn't need a template argument (eg, is a typedef)
|
||||
#define addTemplateToRunTimeSelectionTable\
|
||||
(baseType,thisType,Targ,argNames) \
|
||||
\
|
||||
@ -83,8 +81,8 @@ Description
|
||||
add##thisType##Targ##argNames##ConstructorTo##baseType##Table_
|
||||
|
||||
|
||||
// add to hash-table of functions with 'lookup' as the key
|
||||
// use when baseType doesn't need a template argument (eg, is a typedef)
|
||||
//- Add to hash-table of functions with 'lookup' as the key.
|
||||
// Use when baseType doesn't need a template argument (eg, is a typedef)
|
||||
#define addNamedTemplateToRunTimeSelectionTable\
|
||||
(baseType,thisType,Targ,argNames,lookup) \
|
||||
\
|
||||
@ -96,9 +94,8 @@ Description
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// add to hash-table of functions with typename as the key
|
||||
// use when baseType requires the Targ template argument as well
|
||||
//- Add to hash-table of functions with typename as the key.
|
||||
// Use when baseType requires the Targ template argument as well
|
||||
#define addTemplatedToRunTimeSelectionTable\
|
||||
(baseType,thisType,Targ,argNames) \
|
||||
\
|
||||
@ -107,8 +104,8 @@ Description
|
||||
add##thisType##Targ##argNames##ConstructorTo##baseType##Targ##Table_
|
||||
|
||||
|
||||
// add to hash-table of functions with 'lookup' as the key
|
||||
// use when baseType requires the Targ template argument as well
|
||||
//- Add to hash-table of functions with 'lookup' as the key.
|
||||
// Use when baseType requires the Targ template argument as well
|
||||
#define addNamedTemplatedToRunTimeSelectionTable\
|
||||
(baseType,thisType,Targ,argNames,lookup) \
|
||||
\
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -37,6 +37,22 @@ Description
|
||||
#include "symmTensor.H"
|
||||
#include "tensor.H"
|
||||
#include "triad.H"
|
||||
#include "macros.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define CAPITALIZE_scalar Scalar
|
||||
#define CAPITALIZE_vector Vector
|
||||
#define CAPITALIZE_sphericalTensor SphericalTensor
|
||||
#define CAPITALIZE_symmTensor SymmTensor
|
||||
#define CAPITALIZE_tensor Tensor
|
||||
|
||||
#define FOR_ALL_FIELD_TYPES(Macro, ...) \
|
||||
Macro(scalar, __VA_ARGS__) \
|
||||
Macro(vector, __VA_ARGS__) \
|
||||
Macro(sphericalTensor, __VA_ARGS__) \
|
||||
Macro(symmTensor, __VA_ARGS__) \
|
||||
Macro(tensor, __VA_ARGS__)
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -34,6 +34,7 @@ Description
|
||||
#define registerSwitch_H
|
||||
|
||||
#include "simpleRegIOobject.H"
|
||||
#include "macros.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -85,10 +86,6 @@ public:
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define CONCAT(x, y) x ## y
|
||||
#define CONCAT2(x, y) CONCAT(x, y)
|
||||
#define FILE_UNIQUE(x) CONCAT2(x, __LINE__)
|
||||
|
||||
#define registerOptSwitch(Name, Type, Switch) \
|
||||
static Foam::RegisterSwitch<Type> FILE_UNIQUE(_addToOpt_) \
|
||||
(Foam::debug::addOptimisationObject, Name, Switch)
|
||||
|
||||
60
src/OpenFOAM/include/macros.H
Normal file
60
src/OpenFOAM/include/macros.H
Normal file
@ -0,0 +1,60 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Description
|
||||
General C-preprocessor macros
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef macros_H
|
||||
#define macros_H
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
//- Concatenate two preprocessor tokens
|
||||
#define CAT_(a, b) a ## b
|
||||
#define CAT(a, b) CAT_(a, b)
|
||||
|
||||
//- Concatenate three preprocessor tokens
|
||||
#define CAT3_(a, b, c) a ## b ## c
|
||||
#define CAT3(a, b, c) CAT3_(a, b, c)
|
||||
|
||||
//- Concatenate four preprocessor tokens
|
||||
#define CAT4_(a, b, c, d) a ## b ## c ## d
|
||||
#define CAT4(a, b, c, d) CAT4_(a, b, c, d)
|
||||
|
||||
//- Concatenate five preprocessor tokens
|
||||
#define CAT5_(a, b, c, d, e) a ## b ## c ## d ## e
|
||||
#define CAT5(a, b, c, d, e) CAT5_(a, b, c, d, e)
|
||||
|
||||
//- Generate an identifier unique within the file in which it is generated
|
||||
#define FILE_UNIQUE(x) CAT(x, __LINE__)
|
||||
|
||||
//- Map 'name' to 'Name' via the predefined macro CAPITALIZE_name
|
||||
#define CAPITALIZE(name) CAPITALIZE_##name
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -56,7 +56,14 @@ Foam::label Foam::primitiveMesh::getEdge
|
||||
// Make new edge.
|
||||
label edgeI = es.size();
|
||||
pe[pointi].append(edgeI);
|
||||
pe[nextPointi].append(edgeI);
|
||||
|
||||
if (nextPointi != pointi)
|
||||
{
|
||||
// Very occasionally (e.g. blockMesh) a face can have duplicate
|
||||
// vertices. Make sure we register pointEdges only once.
|
||||
pe[nextPointi].append(edgeI);
|
||||
}
|
||||
|
||||
if (pointi < nextPointi)
|
||||
{
|
||||
es.append(edge(pointi, nextPointi));
|
||||
|
||||
@ -129,7 +129,7 @@ public:
|
||||
explicit plane(const vector& normalVector);
|
||||
|
||||
//- Construct from normal vector and point in plane
|
||||
plane
|
||||
explicit plane
|
||||
(
|
||||
const point& basePoint,
|
||||
const vector& normalVector,
|
||||
@ -137,7 +137,12 @@ public:
|
||||
);
|
||||
|
||||
//- Construct from three points in plane
|
||||
plane(const point&, const point&, const point&);
|
||||
explicit plane
|
||||
(
|
||||
const point& point1,
|
||||
const point& point2,
|
||||
const point& point3
|
||||
);
|
||||
|
||||
//- Construct from coefficients for the
|
||||
// plane equation: ax + by + cz + d = 0
|
||||
|
||||
@ -106,7 +106,7 @@ inline const Cmpt& VectorSpace<Form, Cmpt, Ncmpts>::component
|
||||
if (d >= Ncmpts)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "index out of range"
|
||||
<< "index " << d << " out of range"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
#endif
|
||||
@ -125,7 +125,7 @@ inline Cmpt& VectorSpace<Form, Cmpt, Ncmpts>::component
|
||||
if (d >= Ncmpts)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "index out of range"
|
||||
<< "index " << d << "out of range"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
#endif
|
||||
@ -145,7 +145,7 @@ inline void VectorSpace<Form, Cmpt, Ncmpts>::component
|
||||
if (d >= Ncmpts)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "index out of range"
|
||||
<< "index " << d << " out of range"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
#endif
|
||||
@ -165,7 +165,7 @@ inline void VectorSpace<Form, Cmpt, Ncmpts>::replace
|
||||
if (d >= Ncmpts)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "index out of range"
|
||||
<< "index " << d << " out of range"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
#endif
|
||||
@ -205,7 +205,7 @@ inline const Cmpt& VectorSpace<Form, Cmpt, Ncmpts>::operator[]
|
||||
if (d >= Ncmpts)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "index out of range"
|
||||
<< "index " << d << " out of range"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
#endif
|
||||
@ -224,7 +224,7 @@ inline Cmpt& VectorSpace<Form, Cmpt, Ncmpts>::operator[]
|
||||
if (d >= Ncmpts)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "index out of range"
|
||||
<< "index " << d << " out of range"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
#endif
|
||||
@ -246,7 +246,7 @@ ConstBlock<SubVector, BStart>::operator[]
|
||||
if (i >= Ncmpts)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "index out of range"
|
||||
<< "index " << d << " out of range"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
#endif
|
||||
@ -269,7 +269,7 @@ ConstBlock<SubVector, BStart>::operator()
|
||||
if (i >= Ncmpts)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "index out of range"
|
||||
<< "index " << d << " out of range"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
|
||||
@ -33,8 +33,7 @@ Description
|
||||
#ifndef direction_H
|
||||
#define direction_H
|
||||
|
||||
#define __STDC_LIMIT_MACROS
|
||||
#include <stdint.h>
|
||||
#include <cstdint>
|
||||
#include <iostream>
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -36,8 +36,7 @@ SourceFiles
|
||||
#ifndef int32_H
|
||||
#define int32_H
|
||||
|
||||
#define __STDC_LIMIT_MACROS
|
||||
#include <stdint.h>
|
||||
#include <cstdint>
|
||||
#include <climits>
|
||||
#include <cstdlib>
|
||||
|
||||
|
||||
@ -36,8 +36,7 @@ SourceFiles
|
||||
#ifndef int64_H
|
||||
#define int64_H
|
||||
|
||||
#define __STDC_LIMIT_MACROS
|
||||
#include <stdint.h>
|
||||
#include <cstdint>
|
||||
#include <climits>
|
||||
#include <cstdlib>
|
||||
|
||||
|
||||
@ -36,8 +36,7 @@ SourceFiles
|
||||
#ifndef uint32_H
|
||||
#define uint32_H
|
||||
|
||||
#define __STDC_LIMIT_MACROS
|
||||
#include <stdint.h>
|
||||
#include <cstdint>
|
||||
#include <climits>
|
||||
#include <cstdlib>
|
||||
|
||||
|
||||
@ -36,8 +36,7 @@ SourceFiles
|
||||
#ifndef uint64_H
|
||||
#define uint64_H
|
||||
|
||||
#define __STDC_LIMIT_MACROS
|
||||
#include <stdint.h>
|
||||
#include <cstdint>
|
||||
#include <climits>
|
||||
#include <cstdlib>
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -49,8 +49,8 @@ alphatPhaseChangeWallFunctionFvPatchScalarField
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchScalarField(p, iF),
|
||||
dmdt_(p.size(), 0.0),
|
||||
mDotL_(p.size(), 0.0)
|
||||
dmdt_(p.size(), 0),
|
||||
mDotL_(p.size(), 0)
|
||||
{}
|
||||
|
||||
|
||||
@ -63,8 +63,8 @@ alphatPhaseChangeWallFunctionFvPatchScalarField
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchScalarField(p, iF, dict),
|
||||
dmdt_(p.size(), 0.0),
|
||||
mDotL_(p.size(), 0.0)
|
||||
dmdt_(p.size(), 0),
|
||||
mDotL_(p.size(), 0)
|
||||
{
|
||||
if (dict.found("dmdt"))
|
||||
{
|
||||
|
||||
@ -561,7 +561,7 @@ void SpalartAllmarasDES<BasicTurbulenceModel>::correct()
|
||||
bound(nuTilda_, dimensionedScalar("0", nuTilda_.dimensions(), 0.0));
|
||||
nuTilda_.correctBoundaryConditions();
|
||||
|
||||
correctNut(fv1);
|
||||
correctNut();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -34,7 +34,7 @@ namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
makePatchFieldsTypeName(coupled);
|
||||
makePatchFieldTypeNames(coupled);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -34,7 +34,7 @@ namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
makePatchFieldsTypeName(transform);
|
||||
makePatchFieldTypeNames(transform);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@ License
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
makePatchFieldsTypeName(jumpCyclic);
|
||||
makePatchFieldTypeNames(jumpCyclic);
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
@ -34,7 +34,7 @@ namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
makePatchFieldsTypeName(jumpCyclicAMI);
|
||||
makePatchFieldTypeNames(jumpCyclicAMI);
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user