ENH: use simpler lookupPatchField form
This commit is contained in:
parent
35dae3fc3b
commit
27a7ae2d1d
@ -165,14 +165,10 @@ void Foam::smoluchowskiJumpTFvPatchScalarField::updateCoeffs()
|
||||
return;
|
||||
}
|
||||
|
||||
const fvPatchScalarField& pmu =
|
||||
patch().lookupPatchField<volScalarField, scalar>(muName_);
|
||||
const fvPatchScalarField& prho =
|
||||
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
||||
const fvPatchField<scalar>& ppsi =
|
||||
patch().lookupPatchField<volScalarField, scalar>(psiName_);
|
||||
const fvPatchVectorField& pU =
|
||||
patch().lookupPatchField<volVectorField, vector>(UName_);
|
||||
const auto& pmu = patch().lookupPatchField<volScalarField>(muName_);
|
||||
const auto& prho = patch().lookupPatchField<volScalarField>(rhoName_);
|
||||
const auto& ppsi = patch().lookupPatchField<volScalarField>(psiName_);
|
||||
const auto& pU = patch().lookupPatchField<volVectorField>(UName_);
|
||||
|
||||
// Prandtl number reading consistent with rhoCentralFoam
|
||||
const dictionary& thermophysicalProperties =
|
||||
|
@ -155,12 +155,9 @@ void Foam::maxwellSlipUFvPatchVectorField::updateCoeffs()
|
||||
return;
|
||||
}
|
||||
|
||||
const fvPatchScalarField& pmu =
|
||||
patch().lookupPatchField<volScalarField, scalar>(muName_);
|
||||
const fvPatchScalarField& prho =
|
||||
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
||||
const fvPatchField<scalar>& ppsi =
|
||||
patch().lookupPatchField<volScalarField, scalar>(psiName_);
|
||||
const auto& pmu = patch().lookupPatchField<volScalarField>(muName_);
|
||||
const auto& prho = patch().lookupPatchField<volScalarField>(rhoName_);
|
||||
const auto& ppsi = patch().lookupPatchField<volScalarField>(psiName_);
|
||||
|
||||
Field<scalar> C1
|
||||
(
|
||||
@ -187,8 +184,8 @@ void Foam::maxwellSlipUFvPatchVectorField::updateCoeffs()
|
||||
|
||||
if (curvature_)
|
||||
{
|
||||
const fvPatchTensorField& ptauMC =
|
||||
patch().lookupPatchField<volTensorField, tensor>(tauMCName_);
|
||||
const auto& ptauMC =
|
||||
patch().lookupPatchField<volTensorField>(tauMCName_);
|
||||
vectorField n(patch().nf());
|
||||
|
||||
refValue() -= C1/prho*transform(I - n*n, (n & ptauMC));
|
||||
|
@ -104,11 +104,8 @@ void Foam::fixedRhoFvPatchScalarField::updateCoeffs()
|
||||
return;
|
||||
}
|
||||
|
||||
const fvPatchField<scalar>& psip =
|
||||
patch().lookupPatchField<volScalarField, scalar>(psiName_);
|
||||
|
||||
const fvPatchField<scalar>& pp =
|
||||
patch().lookupPatchField<volScalarField, scalar>(pName_);
|
||||
const auto& psip = patch().lookupPatchField<volScalarField>(psiName_);
|
||||
const auto& pp = patch().lookupPatchField<volScalarField>(pName_);
|
||||
|
||||
operator==(psip*pp);
|
||||
|
||||
|
@ -88,26 +88,29 @@ kappa
|
||||
|
||||
case mtLookup:
|
||||
{
|
||||
if (mesh.foundObject<volScalarField>(kappaName_))
|
||||
{
|
||||
return patch().lookupPatchField<volScalarField, scalar>
|
||||
(
|
||||
kappaName_
|
||||
);
|
||||
const auto* ptr =
|
||||
mesh.cfindObject<volScalarField>(kappaName_);
|
||||
|
||||
if (ptr)
|
||||
{
|
||||
return patch().patchField(*ptr);
|
||||
}
|
||||
}
|
||||
else if (mesh.foundObject<volSymmTensorField>(kappaName_))
|
||||
{
|
||||
const symmTensorField& KWall =
|
||||
patch().lookupPatchField<volSymmTensorField, scalar>
|
||||
(
|
||||
kappaName_
|
||||
);
|
||||
const auto* ptr =
|
||||
mesh.cfindObject<volSymmTensorField>(kappaName_);
|
||||
|
||||
const vectorField n(patch().nf());
|
||||
if (ptr)
|
||||
{
|
||||
const symmTensorField& KWall = patch().patchField(*ptr);
|
||||
|
||||
return n & KWall & n;
|
||||
const vectorField n(patch().nf());
|
||||
|
||||
return n & KWall & n;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Did not find field " << kappaName_
|
||||
@ -117,9 +120,6 @@ kappa
|
||||
<< " or volSymmTensorField."
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@ -131,10 +131,8 @@ kappa
|
||||
mesh.lookupObject<phaseSystem>("phaseProperties")
|
||||
);
|
||||
|
||||
tmp<scalarField> kappaEff
|
||||
(
|
||||
new scalarField(patch().size(), 0.0)
|
||||
);
|
||||
auto tkappaEff = tmp<scalarField>::New(patch().size(), Zero);
|
||||
auto& kappaEff = tkappaEff.ref();
|
||||
|
||||
forAll(fluid.phases(), phasei)
|
||||
{
|
||||
@ -142,10 +140,10 @@ kappa
|
||||
|
||||
const fvPatchScalarField& alpha = phase.boundaryField()[patchi];
|
||||
|
||||
kappaEff.ref() += alpha*phase.kappaEff(patchi)();
|
||||
kappaEff += alpha*phase.kappaEff(patchi)();
|
||||
}
|
||||
|
||||
return kappaEff;
|
||||
return tkappaEff;
|
||||
|
||||
break;
|
||||
}
|
||||
@ -161,9 +159,11 @@ kappa
|
||||
}
|
||||
}
|
||||
|
||||
return scalarField(0);
|
||||
// Return zero-sized (not nullptr)
|
||||
return tmp<scalarField>::New();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -308,12 +308,11 @@ updateCoeffs()
|
||||
|
||||
scalarField& Tp = *this;
|
||||
|
||||
const turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField&
|
||||
nbrField = refCast
|
||||
<const turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField>
|
||||
(
|
||||
nbrPatch.lookupPatchField<volScalarField, scalar>(TnbrName_)
|
||||
);
|
||||
const auto& nbrField =
|
||||
refCast
|
||||
<
|
||||
const turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField
|
||||
>(nbrPatch.lookupPatchField<volScalarField>(TnbrName_));
|
||||
|
||||
// Swap to obtain full local values of neighbour internal field
|
||||
scalarField TcNbr(nbrField.patchInternalField());
|
||||
@ -330,13 +329,13 @@ updateCoeffs()
|
||||
scalarField qr(Tp.size(), 0.0);
|
||||
if (qrName_ != "none")
|
||||
{
|
||||
qr = patch().lookupPatchField<volScalarField, scalar>(qrName_);
|
||||
qr = patch().lookupPatchField<volScalarField>(qrName_);
|
||||
}
|
||||
|
||||
scalarField qrNbr(Tp.size(), 0.0);
|
||||
if (qrNbrName_ != "none")
|
||||
{
|
||||
qrNbr = nbrPatch.lookupPatchField<volScalarField, scalar>(qrNbrName_);
|
||||
qrNbr = nbrPatch.lookupPatchField<volScalarField>(qrNbrName_);
|
||||
mpp.distribute(qrNbr);
|
||||
}
|
||||
|
||||
|
@ -89,17 +89,10 @@ void Foam::adjointOutletPressureFvPatchScalarField::updateCoeffs()
|
||||
return;
|
||||
}
|
||||
|
||||
const fvsPatchField<scalar>& phip =
|
||||
patch().lookupPatchField<surfaceScalarField, scalar>("phi");
|
||||
|
||||
const fvsPatchField<scalar>& phiap =
|
||||
patch().lookupPatchField<surfaceScalarField, scalar>("phia");
|
||||
|
||||
const fvPatchField<vector>& Up =
|
||||
patch().lookupPatchField<volVectorField, vector>("U");
|
||||
|
||||
const fvPatchField<vector>& Uap =
|
||||
patch().lookupPatchField<volVectorField, vector>("Ua");
|
||||
const auto& phip = patch().lookupPatchField<surfaceScalarField>("phi");
|
||||
const auto& phiap = patch().lookupPatchField<surfaceScalarField>("phia");
|
||||
const auto& Up = patch().lookupPatchField<volVectorField>("U");
|
||||
const auto& Uap = patch().lookupPatchField<volVectorField>("Ua");
|
||||
|
||||
operator==((phiap/patch().magSf() - 1.0)*phip/patch().magSf() + (Up & Uap));
|
||||
|
||||
|
@ -90,11 +90,8 @@ void Foam::adjointOutletVelocityFvPatchVectorField::updateCoeffs()
|
||||
return;
|
||||
}
|
||||
|
||||
const fvsPatchField<scalar>& phiap =
|
||||
patch().lookupPatchField<surfaceScalarField, scalar>("phia");
|
||||
|
||||
const fvPatchField<vector>& Up =
|
||||
patch().lookupPatchField<volVectorField, vector>("U");
|
||||
const auto& phiap = patch().lookupPatchField<surfaceScalarField>("phia");
|
||||
const auto& Up = patch().lookupPatchField<volVectorField>("U");
|
||||
|
||||
scalarField Un(mag(patch().nf() & Up));
|
||||
vectorField UtHat((Up - patch().nf()*Un)/(Un + SMALL));
|
||||
|
@ -152,14 +152,9 @@ void tractionDisplacementFvPatchVectorField::updateCoeffs()
|
||||
db().lookupObject<IOdictionary>("thermalProperties");
|
||||
|
||||
|
||||
const fvPatchField<scalar>& rho =
|
||||
patch().lookupPatchField<volScalarField, scalar>("rho");
|
||||
|
||||
const fvPatchField<scalar>& rhoE =
|
||||
patch().lookupPatchField<volScalarField, scalar>("E");
|
||||
|
||||
const fvPatchField<scalar>& nu =
|
||||
patch().lookupPatchField<volScalarField, scalar>("nu");
|
||||
const auto& rho = patch().lookupPatchField<volScalarField>("rho");
|
||||
const auto& rhoE = patch().lookupPatchField<volScalarField>("E");
|
||||
const auto& nu = patch().lookupPatchField<volScalarField>("nu");
|
||||
|
||||
scalarField E(rhoE/rho);
|
||||
scalarField mu(E/(2.0*(1.0 + nu)));
|
||||
@ -176,8 +171,7 @@ void tractionDisplacementFvPatchVectorField::updateCoeffs()
|
||||
|
||||
vectorField n(patch().nf());
|
||||
|
||||
const fvPatchField<symmTensor>& sigmaD =
|
||||
patch().lookupPatchField<volSymmTensorField, symmTensor>("sigmaD");
|
||||
const auto& sigmaD = patch().lookupPatchField<volSymmTensorField>("sigmaD");
|
||||
|
||||
gradient() =
|
||||
(
|
||||
@ -187,11 +181,10 @@ void tractionDisplacementFvPatchVectorField::updateCoeffs()
|
||||
|
||||
if (thermalProperties.get<bool>("thermalStress"))
|
||||
{
|
||||
const fvPatchField<scalar>& threeKalpha=
|
||||
patch().lookupPatchField<volScalarField, scalar>("threeKalpha");
|
||||
const auto& threeKalpha =
|
||||
patch().lookupPatchField<volScalarField>("threeKalpha");
|
||||
|
||||
const fvPatchField<scalar>& T =
|
||||
patch().lookupPatchField<volScalarField, scalar>("T");
|
||||
const auto& T = patch().lookupPatchField<volScalarField>("T");
|
||||
|
||||
gradient() += n*threeKalpha*T/twoMuLambda;
|
||||
}
|
||||
|
@ -152,14 +152,9 @@ void tractionDisplacementCorrectionFvPatchVectorField::updateCoeffs()
|
||||
"mechanicalProperties"
|
||||
);
|
||||
|
||||
const fvPatchField<scalar>& rho =
|
||||
patch().lookupPatchField<volScalarField, scalar>("rho");
|
||||
|
||||
const fvPatchField<scalar>& rhoE =
|
||||
patch().lookupPatchField<volScalarField, scalar>("E");
|
||||
|
||||
const fvPatchField<scalar>& nu =
|
||||
patch().lookupPatchField<volScalarField, scalar>("nu");
|
||||
const auto& rho = patch().lookupPatchField<volScalarField>("rho");
|
||||
const auto& rhoE = patch().lookupPatchField<volScalarField>("E");
|
||||
const auto& nu = patch().lookupPatchField<volScalarField>("nu");
|
||||
|
||||
scalarField E(rhoE/rho);
|
||||
scalarField mu(E/(2.0*(1.0 + nu)));
|
||||
@ -172,11 +167,8 @@ void tractionDisplacementCorrectionFvPatchVectorField::updateCoeffs()
|
||||
|
||||
vectorField n(patch().nf());
|
||||
|
||||
const fvPatchField<symmTensor>& sigmaD =
|
||||
patch().lookupPatchField<volSymmTensorField, symmTensor>("sigmaD");
|
||||
|
||||
const fvPatchField<tensor>& sigmaExp =
|
||||
patch().lookupPatchField<volTensorField, tensor>("sigmaExp");
|
||||
const auto& sigmaD = patch().lookupPatchField<volSymmTensorField>("sigmaD");
|
||||
const auto& sigmaExp = patch().lookupPatchField<volTensorField>("sigmaExp");
|
||||
|
||||
gradient() =
|
||||
(
|
||||
|
@ -205,10 +205,8 @@ void Foam::CLASS::updateCoeffs()
|
||||
);
|
||||
|
||||
const scalarField& phip =
|
||||
this->patch().template lookupPatchField<surfaceScalarField, scalar>
|
||||
(
|
||||
"phi"
|
||||
);
|
||||
this->patch().template lookupPatchField<surfaceScalarField>("phi");
|
||||
|
||||
this->valueFraction() = 1.0 - pos0(phip);
|
||||
|
||||
PARENT::updateCoeffs();
|
||||
|
@ -150,11 +150,11 @@ void turbulentMixingLengthDissipationRateInletFvPatchScalarField::updateCoeffs()
|
||||
|
||||
const scalar Cmu75 = pow(Cmu_, 0.75);
|
||||
|
||||
const fvPatchScalarField& kp =
|
||||
patch().lookupPatchField<volScalarField, scalar>(kName_);
|
||||
const auto& kp =
|
||||
patch().lookupPatchField<volScalarField>(kName_);
|
||||
|
||||
const fvsPatchScalarField& phip =
|
||||
patch().lookupPatchField<surfaceScalarField, scalar>(this->phiName_);
|
||||
const auto& phip =
|
||||
patch().lookupPatchField<surfaceScalarField>(this->phiName_);
|
||||
|
||||
this->refValue() = (Cmu75/mixingLength_)*pow(kp, 1.5);
|
||||
this->valueFraction() = 1.0 - pos0(phip);
|
||||
|
@ -139,11 +139,11 @@ void turbulentMixingLengthFrequencyInletFvPatchScalarField::updateCoeffs()
|
||||
|
||||
const scalar Cmu25 = pow(Cmu, 0.25);
|
||||
|
||||
const fvPatchScalarField& kp =
|
||||
patch().lookupPatchField<volScalarField, scalar>(kName_);
|
||||
const auto& kp =
|
||||
patch().lookupPatchField<volScalarField>(kName_);
|
||||
|
||||
const fvsPatchScalarField& phip =
|
||||
patch().lookupPatchField<surfaceScalarField, scalar>(this->phiName_);
|
||||
const auto& phip =
|
||||
patch().lookupPatchField<surfaceScalarField>(this->phiName_);
|
||||
|
||||
this->refValue() = sqrt(kp)/(Cmu25*mixingLength_);
|
||||
this->valueFraction() = 1.0 - pos0(phip);
|
||||
|
@ -141,16 +141,13 @@ void Foam::porousBafflePressureFvPatchField::updateCoeffs()
|
||||
return;
|
||||
}
|
||||
|
||||
const auto& phi = db().lookupObject<surfaceScalarField>(phiName_);
|
||||
|
||||
const fvsPatchField<scalar>& phip =
|
||||
patch().patchField<surfaceScalarField, scalar>(phi);
|
||||
const auto& phip = patch().lookupPatchField<surfaceScalarField>(phiName_);
|
||||
|
||||
scalarField Un(phip/patch().magSf());
|
||||
|
||||
if (phi.dimensions() == dimMass/dimTime)
|
||||
if (phip.internalField().dimensions() == dimMass/dimTime)
|
||||
{
|
||||
Un /= patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
||||
Un /= patch().lookupPatchField<volScalarField>(rhoName_);
|
||||
}
|
||||
|
||||
if (uniformJump_)
|
||||
@ -185,7 +182,7 @@ void Foam::porousBafflePressureFvPatchField::updateCoeffs()
|
||||
{
|
||||
setJump
|
||||
(
|
||||
jump()*patch().lookupPatchField<volScalarField, scalar>(rhoName_)
|
||||
jump()*patch().lookupPatchField<volScalarField>(rhoName_)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -186,7 +186,7 @@ void atmTurbulentHeatFluxTemperatureFvPatchScalarField::updateCoeffs()
|
||||
}
|
||||
|
||||
const scalarField& alphaEffp =
|
||||
patch().lookupPatchField<volScalarField, scalar>(alphaEffName_);
|
||||
patch().lookupPatchField<volScalarField>(alphaEffName_);
|
||||
|
||||
const scalar t = db().time().timeOutputValue();
|
||||
const scalar Cp0 = Cp0_->value(t);
|
||||
|
@ -124,10 +124,7 @@ void Foam::inletOutletFaPatchField<Type>::updateCoeffs()
|
||||
}
|
||||
|
||||
const Field<scalar>& phip =
|
||||
this->patch(). template lookupPatchField<edgeScalarField, scalar>
|
||||
(
|
||||
phiName_
|
||||
);
|
||||
this->patch().template lookupPatchField<edgeScalarField>(phiName_);
|
||||
|
||||
this->valueFraction() = 1.0 - pos(phip);
|
||||
|
||||
|
@ -156,23 +156,13 @@ template<class Type>
|
||||
Foam::tmp<Foam::scalarField>
|
||||
Foam::advectiveFvPatchField<Type>::advectionSpeed() const
|
||||
{
|
||||
const surfaceScalarField& phi =
|
||||
this->db().objectRegistry::template lookupObject<surfaceScalarField>
|
||||
(phiName_);
|
||||
const auto& phip =
|
||||
this->patch().template lookupPatchField<surfaceScalarField>(phiName_);
|
||||
|
||||
fvsPatchField<scalar> phip =
|
||||
this->patch().template lookupPatchField<surfaceScalarField, scalar>
|
||||
(
|
||||
phiName_
|
||||
);
|
||||
|
||||
if (phi.dimensions() == dimMass/dimTime)
|
||||
if (phip.internalField().dimensions() == dimMass/dimTime)
|
||||
{
|
||||
const fvPatchScalarField& rhop =
|
||||
this->patch().template lookupPatchField<volScalarField, scalar>
|
||||
(
|
||||
rhoName_
|
||||
);
|
||||
const auto& rhop =
|
||||
this->patch().template lookupPatchField<volScalarField>(rhoName_);
|
||||
|
||||
return phip/(rhop*this->patch().magSf());
|
||||
}
|
||||
|
@ -38,11 +38,8 @@ void Foam::fanFvPatchField<Foam::scalar>::calcFanJump()
|
||||
{
|
||||
if (this->cyclicPatch().owner())
|
||||
{
|
||||
const surfaceScalarField& phi =
|
||||
db().lookupObject<surfaceScalarField>(phiName_);
|
||||
|
||||
const fvsPatchField<scalar>& phip =
|
||||
patch().patchField<surfaceScalarField, scalar>(phi);
|
||||
const auto& phip =
|
||||
patch().lookupPatchField<surfaceScalarField>(phiName_);
|
||||
|
||||
scalarField Un(max(phip/patch().magSf(), scalar(0)));
|
||||
|
||||
@ -77,9 +74,9 @@ void Foam::fanFvPatchField<Foam::scalar>::calcFanJump()
|
||||
}
|
||||
}
|
||||
|
||||
if (phi.dimensions() == dimMass/dimTime)
|
||||
if (phip.internalField().dimensions() == dimMass/dimTime)
|
||||
{
|
||||
Un /= patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
||||
Un /= patch().lookupPatchField<volScalarField>(rhoName_);
|
||||
}
|
||||
|
||||
if (nonDimensional_)
|
||||
|
@ -153,23 +153,20 @@ void Foam::fanPressureFvPatchScalarField::updateCoeffs()
|
||||
}
|
||||
|
||||
// Retrieve flux field
|
||||
const auto& phi = db().lookupObject<surfaceScalarField>(phiName());
|
||||
|
||||
const auto& phip = patch().patchField<surfaceScalarField, scalar>(phi);
|
||||
const auto& phip = patch().lookupPatchField<surfaceScalarField>(phiName());
|
||||
|
||||
const int dir = 2*direction_ - 1;
|
||||
|
||||
// Average volumetric flow rate
|
||||
scalar volFlowRate = 0;
|
||||
|
||||
if (phi.dimensions() == dimVolume/dimTime)
|
||||
if (phip.internalField().dimensions() == dimVolume/dimTime)
|
||||
{
|
||||
volFlowRate = dir*gSum(phip);
|
||||
}
|
||||
else if (phi.dimensions() == dimMass/dimTime)
|
||||
else if (phip.internalField().dimensions() == dimMass/dimTime)
|
||||
{
|
||||
const scalarField& rhop =
|
||||
patch().lookupPatchField<volScalarField, scalar>(rhoName());
|
||||
const auto& rhop = patch().lookupPatchField<volScalarField>(rhoName());
|
||||
volFlowRate = dir*gSum(phip/rhop);
|
||||
}
|
||||
else
|
||||
@ -218,7 +215,7 @@ void Foam::fanPressureFvPatchScalarField::updateCoeffs()
|
||||
totalPressureFvPatchScalarField::updateCoeffs
|
||||
(
|
||||
p0() - dir*pdFan,
|
||||
patch().lookupPatchField<volVectorField, vector>(UName())
|
||||
patch().lookupPatchField<volVectorField>(UName())
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -166,8 +166,8 @@ void Foam::fixedNormalInletOutletVelocityFvPatchVectorField::updateCoeffs()
|
||||
|
||||
if (fixTangentialInflow_)
|
||||
{
|
||||
const fvsPatchField<scalar>& phip =
|
||||
patch().lookupPatchField<surfaceScalarField, scalar>(phiName_);
|
||||
const auto& phip =
|
||||
patch().lookupPatchField<surfaceScalarField>(phiName_);
|
||||
|
||||
valueFraction() += neg(phip)*(I - valueFraction());
|
||||
}
|
||||
|
@ -105,8 +105,7 @@ void Foam::fixedPressureCompressibleDensityFvPatchScalarField::updateCoeffs()
|
||||
return;
|
||||
}
|
||||
|
||||
const fvPatchField<scalar>& pp =
|
||||
patch().lookupPatchField<volScalarField, scalar>(pName_);
|
||||
const auto& pp = patch().lookupPatchField<volScalarField>(pName_);
|
||||
|
||||
const dictionary& thermoProps =
|
||||
db().lookupObject<IOdictionary>("thermodynamicProperties");
|
||||
|
@ -218,8 +218,8 @@ void Foam::flowRateInletVelocityFvPatchVectorField::updateCoeffs()
|
||||
// Mass flow-rate
|
||||
if (db().foundObject<volScalarField>(rhoName_))
|
||||
{
|
||||
const fvPatchField<scalar>& rhop =
|
||||
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
||||
const auto& rhop =
|
||||
patch().lookupPatchField<volScalarField>(rhoName_);
|
||||
|
||||
updateValues(rhop);
|
||||
}
|
||||
|
@ -200,8 +200,8 @@ void Foam::flowRateOutletVelocityFvPatchVectorField::updateCoeffs()
|
||||
// Mass flow-rate
|
||||
if (db().foundObject<volScalarField>(rhoName_))
|
||||
{
|
||||
const fvPatchField<scalar>& rhop =
|
||||
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
||||
const auto& rhop =
|
||||
patch().lookupPatchField<volScalarField>(rhoName_);
|
||||
|
||||
updateValues(rhop);
|
||||
}
|
||||
|
@ -106,23 +106,18 @@ void Foam::fluxCorrectedVelocityFvPatchVectorField::evaluate
|
||||
|
||||
zeroGradientFvPatchVectorField::evaluate();
|
||||
|
||||
const surfaceScalarField& phi =
|
||||
db().lookupObject<surfaceScalarField>(phiName_);
|
||||
|
||||
const fvsPatchField<scalar>& phip =
|
||||
patch().patchField<surfaceScalarField, scalar>(phi);
|
||||
const auto& phip = patch().lookupPatchField<surfaceScalarField>(phiName_);
|
||||
|
||||
const vectorField n(patch().nf());
|
||||
const Field<scalar>& magS = patch().magSf();
|
||||
|
||||
if (phi.dimensions() == dimVolume/dimTime)
|
||||
if (phip.internalField().dimensions() == dimVolume/dimTime)
|
||||
{
|
||||
operator==(*this - n*(n & *this) + n*phip/magS);
|
||||
}
|
||||
else if (phi.dimensions() == dimMass/dimTime)
|
||||
else if (phip.internalField().dimensions() == dimMass/dimTime)
|
||||
{
|
||||
const fvPatchField<scalar>& rhop =
|
||||
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
||||
const auto& rhop = patch().lookupPatchField<volScalarField>(rhoName_);
|
||||
|
||||
operator==(*this - n*(n & *this) + n*phip/(rhop*magS));
|
||||
}
|
||||
|
@ -121,10 +121,7 @@ void Foam::freestreamPressureFvPatchScalarField::updateCoeffs()
|
||||
}
|
||||
|
||||
const Field<vector>& Up =
|
||||
patch().template lookupPatchField<volVectorField, vector>
|
||||
(
|
||||
UName_
|
||||
);
|
||||
patch().template lookupPatchField<volVectorField>(UName_);
|
||||
|
||||
valueFraction() = 0.5 + 0.5*(Up & patch().nf())/mag(Up);
|
||||
|
||||
|
@ -126,10 +126,7 @@ void Foam::inletOutletFvPatchField<Type>::updateCoeffs()
|
||||
}
|
||||
|
||||
const Field<scalar>& phip =
|
||||
this->patch().template lookupPatchField<surfaceScalarField, scalar>
|
||||
(
|
||||
phiName_
|
||||
);
|
||||
this->patch().template lookupPatchField<surfaceScalarField>(phiName_);
|
||||
|
||||
this->valueFraction() = 1.0 - pos0(phip);
|
||||
|
||||
|
@ -169,14 +169,14 @@ void Foam::inletOutletTotalTemperatureFvPatchScalarField::updateCoeffs()
|
||||
return;
|
||||
}
|
||||
|
||||
const fvPatchVectorField& Up =
|
||||
patch().lookupPatchField<volVectorField, vector>(UName_);
|
||||
const auto& Up =
|
||||
patch().lookupPatchField<volVectorField>(UName_);
|
||||
|
||||
const fvsPatchField<scalar>& phip =
|
||||
patch().lookupPatchField<surfaceScalarField, scalar>(this->phiName_);
|
||||
const auto& phip =
|
||||
patch().lookupPatchField<surfaceScalarField>(this->phiName_);
|
||||
|
||||
const fvPatchField<scalar>& psip =
|
||||
patch().lookupPatchField<volScalarField, scalar>(psiName_);
|
||||
const auto& psip =
|
||||
patch().lookupPatchField<volScalarField>(psiName_);
|
||||
|
||||
scalar gM1ByG = (gamma_ - 1.0)/gamma_;
|
||||
|
||||
|
@ -135,8 +135,7 @@ void Foam::interstitialInletVelocityFvPatchVectorField::updateCoeffs()
|
||||
return;
|
||||
}
|
||||
|
||||
const fvPatchField<scalar>& alphap =
|
||||
patch().lookupPatchField<volScalarField, scalar>(alphaName_);
|
||||
const auto& alphap = patch().lookupPatchField<volScalarField>(alphaName_);
|
||||
|
||||
operator==(inletVelocity_/alphap);
|
||||
fixedValueFvPatchVectorField::updateCoeffs();
|
||||
|
@ -904,11 +904,7 @@ void Foam::mappedPatchFieldBase<Type>::mappedWeightField
|
||||
if (!fieldName.empty())
|
||||
{
|
||||
thisWeights.ref() *=
|
||||
patchField_.patch().template lookupPatchField
|
||||
<
|
||||
volScalarField,
|
||||
scalar
|
||||
>
|
||||
patchField_.patch().template lookupPatchField<volScalarField>
|
||||
(
|
||||
fieldName
|
||||
).patchInternalField();
|
||||
|
@ -127,8 +127,10 @@ void Foam::mappedFlowRateFvPatchVectorField::updateCoeffs()
|
||||
nbrMesh
|
||||
).boundary()[mpp.samplePolyPatch().index()];
|
||||
|
||||
scalarList phi =
|
||||
nbrPatch.lookupPatchField<surfaceScalarField, scalar>(nbrPhiName_);
|
||||
scalarList phi
|
||||
(
|
||||
nbrPatch.lookupPatchField<surfaceScalarField>(nbrPhiName_)
|
||||
);
|
||||
|
||||
mpp.distribute(phi);
|
||||
|
||||
@ -147,8 +149,7 @@ void Foam::mappedFlowRateFvPatchVectorField::updateCoeffs()
|
||||
}
|
||||
else if (phiName.dimensions() == dimMass/dimTime)
|
||||
{
|
||||
const fvPatchField<scalar>& rhop =
|
||||
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
||||
const auto& rhop = patch().lookupPatchField<volScalarField>(rhoName_);
|
||||
|
||||
// mass flow-rate
|
||||
operator==(n*U/rhop);
|
||||
|
@ -117,7 +117,7 @@ Foam::movingWallVelocityFvPatchVectorField::Uwall() const
|
||||
|
||||
scalarField phip
|
||||
(
|
||||
p.patchField<surfaceScalarField, scalar>(fvc::meshPhi(U))
|
||||
p.patchField<surfaceScalarField>(fvc::meshPhi(U))
|
||||
);
|
||||
|
||||
const vectorField n(p.nf());
|
||||
|
@ -126,10 +126,7 @@ void Foam::outletInletFvPatchField<Type>::updateCoeffs()
|
||||
}
|
||||
|
||||
const Field<scalar>& phip =
|
||||
this->patch().template lookupPatchField<surfaceScalarField, scalar>
|
||||
(
|
||||
phiName_
|
||||
);
|
||||
this->patch().template lookupPatchField<surfaceScalarField>(phiName_);
|
||||
|
||||
this->valueFraction() = pos0(phip);
|
||||
|
||||
|
@ -132,8 +132,10 @@ void Foam::outletPhaseMeanVelocityFvPatchVectorField::updateCoeffs()
|
||||
return;
|
||||
}
|
||||
|
||||
scalarField alphap =
|
||||
patch().lookupPatchField<volScalarField, scalar>(alphaName_);
|
||||
scalarField alphap
|
||||
(
|
||||
patch().lookupPatchField<volScalarField>(alphaName_)
|
||||
);
|
||||
|
||||
alphap = max(alphap, scalar(0));
|
||||
alphap = min(alphap, scalar(1));
|
||||
|
@ -142,10 +142,7 @@ void Foam::phaseHydrostaticPressureFvPatchScalarField::updateCoeffs()
|
||||
}
|
||||
|
||||
const scalarField& alphap =
|
||||
patch().lookupPatchField<volScalarField, scalar>
|
||||
(
|
||||
phaseFraction_
|
||||
);
|
||||
patch().lookupPatchField<volScalarField>(phaseFraction_);
|
||||
|
||||
const uniformDimensionedVectorField& g =
|
||||
meshObjects::gravity::New(db().time());
|
||||
|
@ -177,10 +177,9 @@ void Foam::plenumPressureFvPatchScalarField::updateCoeffs()
|
||||
(
|
||||
internalField().name()
|
||||
).oldTime().boundaryField()[patch().index()];
|
||||
const fvPatchField<vector>& U =
|
||||
patch().lookupPatchField<volVectorField, vector>(UName_);
|
||||
const fvsPatchField<scalar>& phi =
|
||||
patch().lookupPatchField<surfaceScalarField, scalar>(phiName_);
|
||||
|
||||
const auto& U = patch().lookupPatchField<volVectorField>(UName_);
|
||||
const auto& phi = patch().lookupPatchField<surfaceScalarField>(phiName_);
|
||||
|
||||
// Get the timestep
|
||||
const scalar dt = db().time().deltaTValue();
|
||||
|
@ -151,23 +151,18 @@ void Foam::pressureDirectedInletOutletVelocityFvPatchVectorField::updateCoeffs()
|
||||
return;
|
||||
}
|
||||
|
||||
const surfaceScalarField& phi =
|
||||
db().lookupObject<surfaceScalarField>(phiName_);
|
||||
|
||||
const fvsPatchField<scalar>& phip =
|
||||
patch().patchField<surfaceScalarField, scalar>(phi);
|
||||
const auto& phip = patch().lookupPatchField<surfaceScalarField>(phiName_);
|
||||
|
||||
tmp<vectorField> n = patch().nf();
|
||||
tmp<scalarField> ndmagS = (n & inletDir_)*patch().magSf();
|
||||
|
||||
if (phi.dimensions() == dimVolume/dimTime)
|
||||
if (phip.internalField().dimensions() == dimVolume/dimTime)
|
||||
{
|
||||
refValue() = inletDir_*phip/ndmagS;
|
||||
}
|
||||
else if (phi.dimensions() == dimMass/dimTime)
|
||||
else if (phip.internalField().dimensions() == dimMass/dimTime)
|
||||
{
|
||||
const fvPatchField<scalar>& rhop =
|
||||
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
||||
const auto& rhop = patch().lookupPatchField<volScalarField>(rhoName_);
|
||||
|
||||
refValue() = inletDir_*phip/(rhop*ndmagS);
|
||||
}
|
||||
|
@ -141,23 +141,18 @@ void Foam::pressureDirectedInletVelocityFvPatchVectorField::updateCoeffs()
|
||||
return;
|
||||
}
|
||||
|
||||
const surfaceScalarField& phi =
|
||||
db().lookupObject<surfaceScalarField>(phiName_);
|
||||
|
||||
const fvsPatchField<scalar>& phip =
|
||||
patch().patchField<surfaceScalarField, scalar>(phi);
|
||||
const auto& phip = patch().lookupPatchField<surfaceScalarField>(phiName_);
|
||||
|
||||
tmp<vectorField> n = patch().nf();
|
||||
tmp<scalarField> ndmagS = (n & inletDir_)*patch().magSf();
|
||||
|
||||
if (phi.dimensions() == dimVolume/dimTime)
|
||||
if (phip.internalField().dimensions() == dimVolume/dimTime)
|
||||
{
|
||||
operator==(inletDir_*phip/ndmagS);
|
||||
}
|
||||
else if (phi.dimensions() == dimMass/dimTime)
|
||||
else if (phip.internalField().dimensions() == dimMass/dimTime)
|
||||
{
|
||||
const fvPatchField<scalar>& rhop =
|
||||
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
||||
const auto& rhop = patch().lookupPatchField<volScalarField>(rhoName_);
|
||||
|
||||
operator==(inletDir_*phip/(rhop*ndmagS));
|
||||
}
|
||||
|
@ -121,11 +121,7 @@ void Foam::pressureInletOutletParSlipVelocityFvPatchVectorField::updateCoeffs()
|
||||
return;
|
||||
}
|
||||
|
||||
const surfaceScalarField& phi =
|
||||
db().lookupObject<surfaceScalarField>(phiName_);
|
||||
|
||||
const fvsPatchField<scalar>& phip =
|
||||
patch().patchField<surfaceScalarField, scalar>(phi);
|
||||
const auto& phip = patch().lookupPatchField<surfaceScalarField>(phiName_);
|
||||
|
||||
tmp<vectorField> n = patch().nf();
|
||||
const Field<scalar>& magSf = patch().magSf();
|
||||
@ -134,14 +130,13 @@ void Foam::pressureInletOutletParSlipVelocityFvPatchVectorField::updateCoeffs()
|
||||
vectorField Ut(patchInternalField());
|
||||
Ut -= n()*(Ut & n());
|
||||
|
||||
if (phi.dimensions() == dimVolume/dimTime)
|
||||
if (phip.internalField().dimensions() == dimVolume/dimTime)
|
||||
{
|
||||
refValue() = Ut + n*phip/magSf;
|
||||
}
|
||||
else if (phi.dimensions() == dimMass/dimTime)
|
||||
else if (phip.internalField().dimensions() == dimMass/dimTime)
|
||||
{
|
||||
const fvPatchField<scalar>& rhop =
|
||||
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
||||
const auto& rhop = patch().lookupPatchField<volScalarField>(rhoName_);
|
||||
|
||||
refValue() = Ut + n*phip/(rhop*magSf);
|
||||
}
|
||||
|
@ -175,7 +175,7 @@ void Foam::pressureInletOutletVelocityFvPatchVectorField::updateCoeffs()
|
||||
}
|
||||
|
||||
const fvsPatchField<scalar>& phip =
|
||||
patch().lookupPatchField<surfaceScalarField, scalar>(phiName_);
|
||||
patch().lookupPatchField<surfaceScalarField>(phiName_);
|
||||
|
||||
valueFraction() = neg(phip)*(I - sqr(patch().nf()));
|
||||
|
||||
|
@ -109,23 +109,18 @@ void Foam::pressureInletVelocityFvPatchVectorField::updateCoeffs()
|
||||
return;
|
||||
}
|
||||
|
||||
const surfaceScalarField& phi =
|
||||
db().lookupObject<surfaceScalarField>(phiName_);
|
||||
|
||||
const fvsPatchField<scalar>& phip =
|
||||
patch().patchField<surfaceScalarField, scalar>(phi);
|
||||
const auto& phip = patch().lookupPatchField<surfaceScalarField>(phiName_);
|
||||
|
||||
tmp<vectorField> n = patch().nf();
|
||||
const Field<scalar>& magS = patch().magSf();
|
||||
|
||||
if (phi.dimensions() == dimVolume/dimTime)
|
||||
if (phip.internalField().dimensions() == dimVolume/dimTime)
|
||||
{
|
||||
operator==(n*phip/magS);
|
||||
}
|
||||
else if (phi.dimensions() == dimMass/dimTime)
|
||||
else if (phip.internalField().dimensions() == dimMass/dimTime)
|
||||
{
|
||||
const fvPatchField<scalar>& rhop =
|
||||
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
||||
const auto& rhop = patch().lookupPatchField<volScalarField>(rhoName_);
|
||||
|
||||
operator==(n*phip/(rhop*magS));
|
||||
}
|
||||
|
@ -121,23 +121,18 @@ void Foam::pressureNormalInletOutletVelocityFvPatchVectorField::updateCoeffs()
|
||||
return;
|
||||
}
|
||||
|
||||
const surfaceScalarField& phi =
|
||||
db().lookupObject<surfaceScalarField>(phiName_);
|
||||
|
||||
const fvsPatchField<scalar>& phip =
|
||||
patch().patchField<surfaceScalarField, scalar>(phi);
|
||||
const auto& phip = patch().lookupPatchField<surfaceScalarField>(phiName_);
|
||||
|
||||
tmp<vectorField> n = patch().nf();
|
||||
const Field<scalar>& magS = patch().magSf();
|
||||
|
||||
if (phi.dimensions() == dimVolume/dimTime)
|
||||
if (phip.internalField().dimensions() == dimVolume/dimTime)
|
||||
{
|
||||
refValue() = n*phip/magS;
|
||||
}
|
||||
else if (phi.dimensions() == dimMass/dimTime)
|
||||
else if (phip.internalField().dimensions() == dimMass/dimTime)
|
||||
{
|
||||
const fvPatchField<scalar>& rhop =
|
||||
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
||||
const auto& rhop = patch().lookupPatchField<volScalarField>(rhoName_);
|
||||
|
||||
refValue() = n*phip/(rhop*magS);
|
||||
}
|
||||
|
@ -222,10 +222,7 @@ void Foam::pressurePIDControlInletVelocityFvPatchVectorField::updateCoeffs()
|
||||
const scalar deltaT(db().time().deltaTValue());
|
||||
|
||||
// Get the flux field
|
||||
const surfaceScalarField& phi
|
||||
(
|
||||
db().lookupObject<surfaceScalarField>(phiName_)
|
||||
);
|
||||
const auto& phi = db().lookupObject<surfaceScalarField>(phiName_);
|
||||
|
||||
// Update the old-time quantities
|
||||
if (timeIndex_ != db().time().timeIndex())
|
||||
@ -244,10 +241,9 @@ void Foam::pressurePIDControlInletVelocityFvPatchVectorField::updateCoeffs()
|
||||
}
|
||||
else if (phi.dimensions() == dimMass/dimTime)
|
||||
{
|
||||
const fvPatchField<scalar>& rhoField =
|
||||
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
||||
const auto& rhop = patch().lookupPatchField<volScalarField>(rhoName_);
|
||||
|
||||
rho = gSum(rhoField*patch().magSf())/gSum(patch().magSf());
|
||||
rho = gSum(rhop*patch().magSf())/gSum(patch().magSf());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -131,21 +131,17 @@ updateCoeffs()
|
||||
return;
|
||||
}
|
||||
|
||||
const auto& phi = db().lookupObject<surfaceScalarField>(phiName_);
|
||||
|
||||
const fvsPatchField<scalar>& phip =
|
||||
patch().patchField<surfaceScalarField, scalar>(phi);
|
||||
const auto& phip = patch().lookupPatchField<surfaceScalarField>(phiName_);
|
||||
|
||||
const vectorField n(patch().nf());
|
||||
|
||||
if (phi.dimensions() == dimVolume/dimTime)
|
||||
if (phip.internalField().dimensions() == dimVolume/dimTime)
|
||||
{
|
||||
refValue() = (phip/patch().magSf())*n;
|
||||
}
|
||||
else if (phi.dimensions() == dimMass/dimTime)
|
||||
else if (phip.internalField().dimensions() == dimMass/dimTime)
|
||||
{
|
||||
const fvPatchField<scalar>& rhop =
|
||||
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
||||
const auto& rhop = patch().lookupPatchField<volScalarField>(rhoName_);
|
||||
|
||||
refValue() = (phip/(rhop*patch().magSf()))*n;
|
||||
}
|
||||
@ -164,7 +160,7 @@ updateCoeffs()
|
||||
if (alphaName_ != "none")
|
||||
{
|
||||
const scalarField& alphap =
|
||||
patch().lookupPatchField<volScalarField, scalar>(alphaName_);
|
||||
patch().lookupPatchField<volScalarField>(alphaName_);
|
||||
|
||||
const scalarField alphaCut(pos(alphap - alphaMin_));
|
||||
valueFraction() = max(alphaCut, valueFraction());
|
||||
|
@ -189,13 +189,13 @@ void Foam::prghPermeableAlphaTotalPressureFvPatchScalarField::updateSnGrad
|
||||
}
|
||||
|
||||
const scalarField& rhop =
|
||||
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
||||
patch().lookupPatchField<volScalarField>(rhoName_);
|
||||
|
||||
const scalarField& phip =
|
||||
patch().lookupPatchField<surfaceScalarField, scalar>(phiName_);
|
||||
patch().lookupPatchField<surfaceScalarField>(phiName_);
|
||||
|
||||
const vectorField& Up =
|
||||
patch().lookupPatchField<volVectorField, vector>(UName_);
|
||||
patch().lookupPatchField<volVectorField>(UName_);
|
||||
|
||||
const uniformDimensionedVectorField& g =
|
||||
meshObjects::gravity::New(db().time());
|
||||
@ -226,7 +226,8 @@ void Foam::prghPermeableAlphaTotalPressureFvPatchScalarField::updateSnGrad
|
||||
if (alphaName_ != "none")
|
||||
{
|
||||
const scalarField& alphap =
|
||||
patch().lookupPatchField<volScalarField, scalar>(alphaName_);
|
||||
patch().lookupPatchField<volScalarField>(alphaName_);
|
||||
|
||||
tmp<scalarField> alphaCut(pos(alphap - alphaMin_));
|
||||
valueFraction() = 1 - alphaCut;
|
||||
}
|
||||
|
@ -147,10 +147,8 @@ void Foam::prghPressureFvPatchScalarField::updateCoeffs()
|
||||
return;
|
||||
}
|
||||
|
||||
const scalarField& rhop = patch().lookupPatchField<volScalarField, scalar>
|
||||
(
|
||||
rhoName_
|
||||
);
|
||||
const scalarField& rhop =
|
||||
patch().lookupPatchField<volScalarField>(rhoName_);
|
||||
|
||||
const uniformDimensionedVectorField& g =
|
||||
meshObjects::gravity::New(db().time());
|
||||
|
@ -122,16 +122,16 @@ void Foam::prghTotalHydrostaticPressureFvPatchScalarField::updateCoeffs()
|
||||
}
|
||||
|
||||
const scalarField& rhop =
|
||||
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
||||
patch().lookupPatchField<volScalarField>(rhoName_);
|
||||
|
||||
const scalarField& ph_rghp =
|
||||
patch().lookupPatchField<volScalarField, scalar>(ph_rghName_);
|
||||
patch().lookupPatchField<volScalarField>(ph_rghName_);
|
||||
|
||||
const scalarField& phip =
|
||||
patch().lookupPatchField<surfaceScalarField, scalar>(phiName_);
|
||||
patch().lookupPatchField<surfaceScalarField>(phiName_);
|
||||
|
||||
const vectorField& Up =
|
||||
patch().lookupPatchField<volVectorField, vector>(UName_);
|
||||
patch().lookupPatchField<volVectorField>(UName_);
|
||||
|
||||
operator==
|
||||
(
|
||||
|
@ -154,13 +154,13 @@ void Foam::prghTotalPressureFvPatchScalarField::updateCoeffs()
|
||||
}
|
||||
|
||||
const scalarField& rhop =
|
||||
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
||||
patch().lookupPatchField<volScalarField>(rhoName_);
|
||||
|
||||
const scalarField& phip =
|
||||
patch().lookupPatchField<surfaceScalarField, scalar>(phiName_);
|
||||
patch().lookupPatchField<surfaceScalarField>(phiName_);
|
||||
|
||||
const vectorField& Up =
|
||||
patch().lookupPatchField<volVectorField, vector>(UName_);
|
||||
patch().lookupPatchField<volVectorField>(UName_);
|
||||
|
||||
const uniformDimensionedVectorField& g =
|
||||
meshObjects::gravity::New(db().time());
|
||||
|
@ -114,7 +114,7 @@ void Foam::rotatingTotalPressureFvPatchScalarField::updateCoeffs()
|
||||
|
||||
const vectorField Up
|
||||
(
|
||||
patch().lookupPatchField<volVectorField, vector>(UName())
|
||||
patch().lookupPatchField<volVectorField>(UName())
|
||||
+ rotationVelocity
|
||||
);
|
||||
|
||||
|
@ -166,14 +166,11 @@ void Foam::supersonicFreestreamFvPatchVectorField::updateCoeffs()
|
||||
return;
|
||||
}
|
||||
|
||||
const fvPatchField<scalar>& pT =
|
||||
patch().lookupPatchField<volScalarField, scalar>(TName_);
|
||||
const auto& pT = patch().lookupPatchField<volScalarField>(TName_);
|
||||
|
||||
const fvPatchField<scalar>& pp =
|
||||
patch().lookupPatchField<volScalarField, scalar>(pName_);
|
||||
const auto& pp = patch().lookupPatchField<volScalarField>(pName_);
|
||||
|
||||
const fvPatchField<scalar>& ppsi =
|
||||
patch().lookupPatchField<volScalarField, scalar>(psiName_);
|
||||
const auto& ppsi = patch().lookupPatchField<volScalarField>(psiName_);
|
||||
|
||||
// Need R of the free-stream flow. Assume R is independent of location
|
||||
// along patch so use face 0
|
||||
|
@ -40,25 +40,21 @@ void Foam::swirlFanVelocityFvPatchField::calcFanJump()
|
||||
{
|
||||
const scalar rpm = rpm_->value(this->db().time().timeOutputValue());
|
||||
|
||||
const surfaceScalarField& phi =
|
||||
db().lookupObject<surfaceScalarField>(phiName_);
|
||||
const auto& phi = db().lookupObject<surfaceScalarField>(phiName_);
|
||||
|
||||
const fvPatchField<scalar>& pOwner =
|
||||
patch().lookupPatchField<volScalarField, scalar>(pName_);
|
||||
const auto& pOwner = patch().lookupPatchField<volScalarField>(pName_);
|
||||
|
||||
const label nbrIndex = this->cyclicPatch().neighbPatchID();
|
||||
|
||||
const fvPatch& nbrPatch = patch().boundaryMesh()[nbrIndex];
|
||||
|
||||
const fvPatchField<scalar>& pSlave =
|
||||
nbrPatch.lookupPatchField<volScalarField, scalar>(pName_);
|
||||
const auto& pSlave = nbrPatch.lookupPatchField<volScalarField>(pName_);
|
||||
|
||||
scalarField deltaP(mag(pOwner - pSlave));
|
||||
|
||||
if (phi.dimensions() == dimMass/dimTime)
|
||||
{
|
||||
deltaP /=
|
||||
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
||||
deltaP /= patch().lookupPatchField<volScalarField>(rhoName_);
|
||||
}
|
||||
|
||||
const vector axisHat =
|
||||
|
@ -168,8 +168,7 @@ void Foam::swirlFlowRateInletVelocityFvPatchVectorField::updateCoeffs()
|
||||
|
||||
tmp<vectorField> n = patch().nf();
|
||||
|
||||
const surfaceScalarField& phi =
|
||||
db().lookupObject<surfaceScalarField>(phiName_);
|
||||
const auto& phi = db().lookupObject<surfaceScalarField>(phiName_);
|
||||
|
||||
if (phi.dimensions() == dimVolume/dimTime)
|
||||
{
|
||||
@ -178,8 +177,8 @@ void Foam::swirlFlowRateInletVelocityFvPatchVectorField::updateCoeffs()
|
||||
}
|
||||
else if (phi.dimensions() == dimMass/dimTime)
|
||||
{
|
||||
const fvPatchField<scalar>& rhop =
|
||||
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
||||
const auto& rhop =
|
||||
patch().lookupPatchField<volScalarField>(rhoName_);
|
||||
|
||||
// mass flow-rate
|
||||
operator==(tangentialVelocity + n*avgU/rhop);
|
||||
|
@ -200,17 +200,13 @@ void Foam::syringePressureFvPatchScalarField::updateCoeffs()
|
||||
scalar t = db().time().value();
|
||||
scalar deltaT = db().time().deltaTValue();
|
||||
|
||||
const surfaceScalarField& phi =
|
||||
db().lookupObject<surfaceScalarField>(phiName_);
|
||||
const auto& phip = patch().lookupPatchField<surfaceScalarField>(phiName_);
|
||||
|
||||
const fvsPatchField<scalar>& phip =
|
||||
patch().patchField<surfaceScalarField, scalar>(phi);
|
||||
|
||||
if (phi.dimensions() == dimVolume/dimTime)
|
||||
if (phip.internalField().dimensions() == dimVolume/dimTime)
|
||||
{
|
||||
ams_ = ams0_ + deltaT*sum((*this*psi_)*phip);
|
||||
}
|
||||
else if (phi.dimensions() == dimMass/dimTime)
|
||||
else if (phip.internalField().dimensions() == dimMass/dimTime)
|
||||
{
|
||||
ams_ = ams0_ + deltaT*sum(phip);
|
||||
}
|
||||
|
@ -167,8 +167,7 @@ void Foam::totalPressureFvPatchScalarField::updateCoeffs
|
||||
return;
|
||||
}
|
||||
|
||||
const fvsPatchField<scalar>& phip =
|
||||
patch().lookupPatchField<surfaceScalarField, scalar>(phiName_);
|
||||
const auto& phip = patch().lookupPatchField<surfaceScalarField>(phiName_);
|
||||
|
||||
if (internalField().dimensions() == dimPressure)
|
||||
{
|
||||
@ -176,8 +175,8 @@ void Foam::totalPressureFvPatchScalarField::updateCoeffs
|
||||
{
|
||||
// Variable density and low-speed compressible flow
|
||||
|
||||
const fvPatchField<scalar>& rho =
|
||||
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
||||
const auto& rho =
|
||||
patch().lookupPatchField<volScalarField>(rhoName_);
|
||||
|
||||
operator==(p0p - 0.5*rho*(1.0 - pos0(phip))*magSqr(Up));
|
||||
}
|
||||
@ -185,8 +184,8 @@ void Foam::totalPressureFvPatchScalarField::updateCoeffs
|
||||
{
|
||||
// High-speed compressible flow
|
||||
|
||||
const fvPatchField<scalar>& psip =
|
||||
patch().lookupPatchField<volScalarField, scalar>(psiName_);
|
||||
const auto& psip =
|
||||
patch().lookupPatchField<volScalarField>(psiName_);
|
||||
|
||||
if (gamma_ > 1)
|
||||
{
|
||||
@ -238,7 +237,7 @@ void Foam::totalPressureFvPatchScalarField::updateCoeffs()
|
||||
updateCoeffs
|
||||
(
|
||||
p0(),
|
||||
patch().lookupPatchField<volVectorField, vector>(UName())
|
||||
patch().lookupPatchField<volVectorField>(UName())
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -157,14 +157,14 @@ void Foam::totalTemperatureFvPatchScalarField::updateCoeffs()
|
||||
return;
|
||||
}
|
||||
|
||||
const fvPatchVectorField& Up =
|
||||
patch().lookupPatchField<volVectorField, vector>(UName_);
|
||||
const auto& Up =
|
||||
patch().lookupPatchField<volVectorField>(UName_);
|
||||
|
||||
const fvsPatchField<scalar>& phip =
|
||||
patch().lookupPatchField<surfaceScalarField, scalar>(phiName_);
|
||||
const auto& phip =
|
||||
patch().lookupPatchField<surfaceScalarField>(phiName_);
|
||||
|
||||
const fvPatchField<scalar>& psip =
|
||||
patch().lookupPatchField<volScalarField, scalar>(psiName_);
|
||||
const auto& psip =
|
||||
patch().lookupPatchField<volScalarField>(psiName_);
|
||||
|
||||
scalar gM1ByG = (gamma_ - 1.0)/gamma_;
|
||||
|
||||
|
@ -133,11 +133,11 @@ updateCoeffs()
|
||||
return;
|
||||
}
|
||||
|
||||
const fvPatchVectorField& Up =
|
||||
patch().lookupPatchField<volVectorField, vector>(UName_);
|
||||
const auto& Up =
|
||||
patch().lookupPatchField<volVectorField>(UName_);
|
||||
|
||||
const fvsPatchScalarField& phip =
|
||||
patch().lookupPatchField<surfaceScalarField, scalar>(this->phiName_);
|
||||
const auto& phip =
|
||||
patch().lookupPatchField<surfaceScalarField>(this->phiName_);
|
||||
|
||||
this->refValue() = 1.5*sqr(intensity_)*magSqr(Up);
|
||||
this->valueFraction() = 1.0 - pos0(phip);
|
||||
|
@ -152,7 +152,7 @@ void Foam::uniformInletOutletFvPatchField<Type>::updateCoeffs()
|
||||
this->refValue() = uniformInletValue_->value(t);
|
||||
|
||||
const Field<scalar>& phip =
|
||||
this->patch().template lookupPatchField<surfaceScalarField, scalar>
|
||||
this->patch().template lookupPatchField<surfaceScalarField>
|
||||
(
|
||||
phiName_
|
||||
);
|
||||
|
@ -155,8 +155,7 @@ void Foam::uniformTotalPressureFvPatchScalarField::updateCoeffs
|
||||
|
||||
scalar p0 = p0_->value(this->db().time().timeOutputValue());
|
||||
|
||||
const fvsPatchField<scalar>& phip =
|
||||
patch().lookupPatchField<surfaceScalarField, scalar>(phiName_);
|
||||
const auto& phip = patch().lookupPatchField<surfaceScalarField>(phiName_);
|
||||
|
||||
if (internalField().dimensions() == dimPressure)
|
||||
{
|
||||
@ -164,8 +163,8 @@ void Foam::uniformTotalPressureFvPatchScalarField::updateCoeffs
|
||||
{
|
||||
// Variable density and low-speed compressible flow
|
||||
|
||||
const fvPatchField<scalar>& rho =
|
||||
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
||||
const auto& rho =
|
||||
patch().lookupPatchField<volScalarField>(rhoName_);
|
||||
|
||||
operator==(p0 - 0.5*rho*(1.0 - pos0(phip))*magSqr(Up));
|
||||
}
|
||||
@ -173,8 +172,8 @@ void Foam::uniformTotalPressureFvPatchScalarField::updateCoeffs
|
||||
{
|
||||
// High-speed compressible flow
|
||||
|
||||
const fvPatchField<scalar>& psip =
|
||||
patch().lookupPatchField<volScalarField, scalar>(psiName_);
|
||||
const auto& psip =
|
||||
patch().lookupPatchField<volScalarField>(psiName_);
|
||||
|
||||
if (gamma_ > 1)
|
||||
{
|
||||
@ -223,7 +222,7 @@ void Foam::uniformTotalPressureFvPatchScalarField::updateCoeffs
|
||||
|
||||
void Foam::uniformTotalPressureFvPatchScalarField::updateCoeffs()
|
||||
{
|
||||
updateCoeffs(patch().lookupPatchField<volVectorField, vector>(UName_));
|
||||
updateCoeffs(patch().lookupPatchField<volVectorField>(UName_));
|
||||
}
|
||||
|
||||
|
||||
|
@ -137,8 +137,7 @@ void Foam::variableHeightFlowRateFvPatchScalarField::updateCoeffs()
|
||||
return;
|
||||
}
|
||||
|
||||
const fvsPatchField<scalar>& phip =
|
||||
patch().lookupPatchField<surfaceScalarField, scalar>(phiName_);
|
||||
const auto& phip = patch().lookupPatchField<surfaceScalarField>(phiName_);
|
||||
|
||||
scalarField alphap(this->patchInternalField());
|
||||
|
||||
|
@ -109,8 +109,10 @@ void Foam::variableHeightFlowRateInletVelocityFvPatchVectorField
|
||||
return;
|
||||
}
|
||||
|
||||
scalarField alphap =
|
||||
patch().lookupPatchField<volScalarField, scalar>(alphaName_);
|
||||
scalarField alphap
|
||||
(
|
||||
patch().lookupPatchField<volScalarField>(alphaName_)
|
||||
);
|
||||
|
||||
alphap = max(alphap, scalar(0));
|
||||
alphap = min(alphap, scalar(1));
|
||||
|
@ -155,8 +155,7 @@ void Foam::waveSurfacePressureFvPatchScalarField::updateCoeffs()
|
||||
ddtSchemeType ddtScheme(ddtSchemeTypeNames_[ddtSchemeName]);
|
||||
|
||||
// Retrieve the flux field from the database
|
||||
const surfaceScalarField& phi =
|
||||
db().lookupObject<surfaceScalarField>(phiName_);
|
||||
const auto& phi = db().lookupObject<surfaceScalarField>(phiName_);
|
||||
|
||||
// Cache the patch face-normal vectors
|
||||
tmp<vectorField> nf(patch().nf());
|
||||
@ -166,8 +165,7 @@ void Foam::waveSurfacePressureFvPatchScalarField::updateCoeffs()
|
||||
|
||||
if (phi.dimensions() == dimMass/dimTime)
|
||||
{
|
||||
const scalarField& rhop =
|
||||
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
||||
const auto& rhop = patch().lookupPatchField<volScalarField>(rhoName_);
|
||||
|
||||
dZetap /= rhop;
|
||||
}
|
||||
|
@ -110,22 +110,23 @@ Foam::tmp<Foam::scalarField>
|
||||
Foam::waveTransmissiveFvPatchField<Type>::advectionSpeed() const
|
||||
{
|
||||
// Lookup the velocity and compressibility of the patch
|
||||
const fvPatchField<scalar>& psip =
|
||||
this->patch().template
|
||||
lookupPatchField<volScalarField, scalar>(psiName_);
|
||||
const auto& psip =
|
||||
this->patch().template lookupPatchField<volScalarField>(psiName_);
|
||||
|
||||
const surfaceScalarField& phi =
|
||||
const auto& phi =
|
||||
this->db().template lookupObject<surfaceScalarField>(this->phiName_);
|
||||
|
||||
fvsPatchField<scalar> phip =
|
||||
scalarField phip
|
||||
(
|
||||
this->patch().template
|
||||
lookupPatchField<surfaceScalarField, scalar>(this->phiName_);
|
||||
lookupPatchField<surfaceScalarField>(this->phiName_)
|
||||
);
|
||||
|
||||
if (phi.dimensions() == dimMass/dimTime)
|
||||
{
|
||||
const fvPatchScalarField& rhop =
|
||||
const auto& rhop =
|
||||
this->patch().template
|
||||
lookupPatchField<volScalarField, scalar>(this->rhoName_);
|
||||
lookupPatchField<volScalarField>(this->rhoName_);
|
||||
|
||||
phip /= rhop;
|
||||
}
|
||||
|
@ -161,15 +161,11 @@ Foam::functionObjects::extractEulerianParticles::phiU() const
|
||||
{
|
||||
DebugInFunction << endl;
|
||||
|
||||
const surfaceScalarField& phi
|
||||
(
|
||||
mesh_.lookupObject<surfaceScalarField>(phiName_)
|
||||
);
|
||||
const auto& phi = mesh_.lookupObject<surfaceScalarField>(phiName_);
|
||||
|
||||
if (phi.dimensions() == dimMass/dimTime)
|
||||
{
|
||||
const volScalarField& rho =
|
||||
mesh_.lookupObject<volScalarField>(rhoName_);
|
||||
const auto& rho = mesh_.lookupObject<volScalarField>(rhoName_);
|
||||
|
||||
return phi/fvc::interpolate(rho);
|
||||
}
|
||||
|
@ -147,7 +147,7 @@ Foam::functionObjects::momentumError::momentumError
|
||||
{
|
||||
read(dict);
|
||||
|
||||
const auto& phi =lookupObject<surfaceScalarField>(phiName_);
|
||||
const auto& phi = lookupObject<surfaceScalarField>(phiName_);
|
||||
|
||||
const dimensionSet momDims
|
||||
(
|
||||
|
@ -127,8 +127,7 @@ Foam::scalar Foam::PatchFlowRateInjection<CloudType>::flowRate() const
|
||||
{
|
||||
const polyMesh& mesh = this->owner().mesh();
|
||||
|
||||
const surfaceScalarField& phi =
|
||||
mesh.lookupObject<surfaceScalarField>(phiName_);
|
||||
const auto& phi = mesh.lookupObject<surfaceScalarField>(phiName_);
|
||||
|
||||
const scalarField& phip = phi.boundaryField()[patchId_];
|
||||
|
||||
@ -139,8 +138,7 @@ Foam::scalar Foam::PatchFlowRateInjection<CloudType>::flowRate() const
|
||||
}
|
||||
else
|
||||
{
|
||||
const volScalarField& rho =
|
||||
mesh.lookupObject<volScalarField>(rhoName_);
|
||||
const auto& rho = mesh.lookupObject<volScalarField>(rhoName_);
|
||||
const scalarField& rhop = rho.boundaryField()[patchId_];
|
||||
|
||||
flowRateIn = max(0.0, -sum(phip/rhop));
|
||||
|
@ -110,7 +110,7 @@ void Foam::adjointFarFieldPressureFvPatchScalarField::updateCoeffs()
|
||||
|
||||
// Adjoint flux
|
||||
//const fvsPatchField<scalar>& phiap =
|
||||
// patch().lookupPatchField<surfaceScalarField, scalar>("phia");
|
||||
// patch().lookupPatchField<surfaceScalarField>("phia");
|
||||
|
||||
// Primal velocity
|
||||
const fvPatchField<vector>& Up = boundaryContrPtr_->Ub();
|
||||
|
@ -101,7 +101,7 @@ void Foam::copiedFixedValueFvPatchScalarField::updateCoeffs()
|
||||
|
||||
operator==
|
||||
(
|
||||
patch().lookupPatchField<volScalarField, scalar>(sourceFieldName_)
|
||||
patch().lookupPatchField<volScalarField>(sourceFieldName_)
|
||||
);
|
||||
|
||||
fixedValueFvPatchScalarField::updateCoeffs();
|
||||
|
@ -165,7 +165,7 @@ void Foam::JohnsonJacksonParticleSlipFvPatchVectorField::updateCoeffs()
|
||||
// lookup all the fields on this patch
|
||||
const fvPatchScalarField& alpha
|
||||
(
|
||||
patch().lookupPatchField<volScalarField, scalar>
|
||||
patch().lookupPatchField<volScalarField>
|
||||
(
|
||||
phased.volScalarField::name()
|
||||
)
|
||||
@ -173,7 +173,7 @@ void Foam::JohnsonJacksonParticleSlipFvPatchVectorField::updateCoeffs()
|
||||
|
||||
const fvPatchScalarField& gs0
|
||||
(
|
||||
patch().lookupPatchField<volScalarField, scalar>
|
||||
patch().lookupPatchField<volScalarField>
|
||||
(
|
||||
IOobject::groupName("gs0", phased.name())
|
||||
)
|
||||
@ -181,7 +181,7 @@ void Foam::JohnsonJacksonParticleSlipFvPatchVectorField::updateCoeffs()
|
||||
|
||||
const scalarField nu
|
||||
(
|
||||
patch().lookupPatchField<volScalarField, scalar>
|
||||
patch().lookupPatchField<volScalarField>
|
||||
(
|
||||
IOobject::groupName("nut", phased.name())
|
||||
)
|
||||
@ -189,7 +189,7 @@ void Foam::JohnsonJacksonParticleSlipFvPatchVectorField::updateCoeffs()
|
||||
|
||||
const scalarField nuFric
|
||||
(
|
||||
patch().lookupPatchField<volScalarField, scalar>
|
||||
patch().lookupPatchField<volScalarField>
|
||||
(
|
||||
IOobject::groupName("nuFric", phased.name())
|
||||
)
|
||||
@ -200,7 +200,7 @@ void Foam::JohnsonJacksonParticleSlipFvPatchVectorField::updateCoeffs()
|
||||
const fvPatchScalarField& Theta
|
||||
(
|
||||
db().foundObject<volScalarField>(ThetaName)
|
||||
? patch().lookupPatchField<volScalarField, scalar>(ThetaName)
|
||||
? patch().lookupPatchField<volScalarField>(ThetaName)
|
||||
: alpha
|
||||
);
|
||||
|
||||
|
@ -181,7 +181,7 @@ void Foam::JohnsonJacksonParticleThetaFvPatchScalarField::updateCoeffs()
|
||||
// lookup all the fields on this patch
|
||||
const fvPatchScalarField& alpha
|
||||
(
|
||||
patch().lookupPatchField<volScalarField, scalar>
|
||||
patch().lookupPatchField<volScalarField>
|
||||
(
|
||||
phased.volScalarField::name()
|
||||
)
|
||||
@ -189,7 +189,7 @@ void Foam::JohnsonJacksonParticleThetaFvPatchScalarField::updateCoeffs()
|
||||
|
||||
const fvPatchVectorField& U
|
||||
(
|
||||
patch().lookupPatchField<volVectorField, vector>
|
||||
patch().lookupPatchField<volVectorField>
|
||||
(
|
||||
IOobject::groupName("U", phased.name())
|
||||
)
|
||||
@ -197,7 +197,7 @@ void Foam::JohnsonJacksonParticleThetaFvPatchScalarField::updateCoeffs()
|
||||
|
||||
const fvPatchScalarField& gs0
|
||||
(
|
||||
patch().lookupPatchField<volScalarField, scalar>
|
||||
patch().lookupPatchField<volScalarField>
|
||||
(
|
||||
IOobject::groupName("gs0", phased.name())
|
||||
)
|
||||
@ -205,7 +205,7 @@ void Foam::JohnsonJacksonParticleThetaFvPatchScalarField::updateCoeffs()
|
||||
|
||||
const fvPatchScalarField& kappa
|
||||
(
|
||||
patch().lookupPatchField<volScalarField, scalar>
|
||||
patch().lookupPatchField<volScalarField>
|
||||
(
|
||||
IOobject::groupName("kappa", phased.name())
|
||||
)
|
||||
|
@ -163,25 +163,21 @@ void Foam::JohnsonJacksonParticleSlipFvPatchVectorField::updateCoeffs()
|
||||
);
|
||||
|
||||
// lookup all the fields on this patch
|
||||
const fvPatchScalarField& alpha
|
||||
(
|
||||
patch().lookupPatchField<volScalarField, scalar>
|
||||
const auto& alpha =
|
||||
patch().lookupPatchField<volScalarField>
|
||||
(
|
||||
phased.volScalarField::name()
|
||||
)
|
||||
);
|
||||
);
|
||||
|
||||
const fvPatchScalarField& gs0
|
||||
(
|
||||
patch().lookupPatchField<volScalarField, scalar>
|
||||
const auto& gs0 =
|
||||
patch().lookupPatchField<volScalarField>
|
||||
(
|
||||
IOobject::groupName("gs0", phased.name())
|
||||
)
|
||||
);
|
||||
);
|
||||
|
||||
const scalarField nu
|
||||
(
|
||||
patch().lookupPatchField<volScalarField, scalar>
|
||||
patch().lookupPatchField<volScalarField>
|
||||
(
|
||||
IOobject::groupName("nut", phased.name())
|
||||
)
|
||||
@ -189,7 +185,7 @@ void Foam::JohnsonJacksonParticleSlipFvPatchVectorField::updateCoeffs()
|
||||
|
||||
const scalarField nuFric
|
||||
(
|
||||
patch().lookupPatchField<volScalarField, scalar>
|
||||
patch().lookupPatchField<volScalarField>
|
||||
(
|
||||
IOobject::groupName("nuFric", phased.name())
|
||||
)
|
||||
@ -200,7 +196,7 @@ void Foam::JohnsonJacksonParticleSlipFvPatchVectorField::updateCoeffs()
|
||||
const fvPatchScalarField& Theta
|
||||
(
|
||||
db().foundObject<volScalarField>(ThetaName)
|
||||
? patch().lookupPatchField<volScalarField, scalar>(ThetaName)
|
||||
? patch().lookupPatchField<volScalarField>(ThetaName)
|
||||
: alpha
|
||||
);
|
||||
|
||||
|
@ -179,37 +179,29 @@ void Foam::JohnsonJacksonParticleThetaFvPatchScalarField::updateCoeffs()
|
||||
);
|
||||
|
||||
// lookup all the fields on this patch
|
||||
const fvPatchScalarField& alpha
|
||||
(
|
||||
patch().lookupPatchField<volScalarField, scalar>
|
||||
const auto& alpha =
|
||||
patch().lookupPatchField<volScalarField>
|
||||
(
|
||||
phased.volScalarField::name()
|
||||
)
|
||||
);
|
||||
);
|
||||
|
||||
const fvPatchVectorField& U
|
||||
(
|
||||
patch().lookupPatchField<volVectorField, vector>
|
||||
const auto& U =
|
||||
patch().lookupPatchField<volVectorField>
|
||||
(
|
||||
IOobject::groupName("U", phased.name())
|
||||
)
|
||||
);
|
||||
);
|
||||
|
||||
const fvPatchScalarField& gs0
|
||||
(
|
||||
patch().lookupPatchField<volScalarField, scalar>
|
||||
const auto& gs0 =
|
||||
patch().lookupPatchField<volScalarField>
|
||||
(
|
||||
IOobject::groupName("gs0", phased.name())
|
||||
)
|
||||
);
|
||||
);
|
||||
|
||||
const fvPatchScalarField& kappa
|
||||
(
|
||||
patch().lookupPatchField<volScalarField, scalar>
|
||||
const auto& kappa =
|
||||
patch().lookupPatchField<volScalarField>
|
||||
(
|
||||
IOobject::groupName("kappa", phased.name())
|
||||
)
|
||||
);
|
||||
);
|
||||
|
||||
const scalarField Theta(patchInternalField());
|
||||
|
||||
|
@ -266,14 +266,13 @@ void filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::updateCoeffs()
|
||||
|
||||
scalarField intFld(patchInternalField());
|
||||
|
||||
const filmPyrolysisRadiativeCoupledMixedFvPatchScalarField&
|
||||
nbrField =
|
||||
const auto& nbrField =
|
||||
refCast
|
||||
<
|
||||
const filmPyrolysisRadiativeCoupledMixedFvPatchScalarField
|
||||
>
|
||||
(
|
||||
nbrPatch.lookupPatchField<volScalarField, scalar>(TnbrName_)
|
||||
nbrPatch.lookupPatchField<volScalarField>(TnbrName_)
|
||||
);
|
||||
|
||||
// Swap to obtain full local values of neighbour internal field
|
||||
@ -307,7 +306,7 @@ void filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::updateCoeffs()
|
||||
coupledPatchi = patchi;
|
||||
if (qrName_ != "none")
|
||||
{
|
||||
qr = nbrPatch.lookupPatchField<volScalarField, scalar>(qrName_);
|
||||
qr = nbrPatch.lookupPatchField<volScalarField>(qrName_);
|
||||
mpp.distribute(qr);
|
||||
}
|
||||
}
|
||||
@ -316,7 +315,7 @@ void filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::updateCoeffs()
|
||||
coupledPatchi = nbrPatch.index();
|
||||
if (qrName_ != "none")
|
||||
{
|
||||
qr = patch().lookupPatchField<volScalarField, scalar>(qrName_);
|
||||
qr = patch().lookupPatchField<volScalarField>(qrName_);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -173,15 +173,13 @@ void Foam::filmPyrolysisVelocityCoupledFvPatchVectorField::updateCoeffs()
|
||||
pyrModel.toPrimary(pyrPatchi, phiPyr);
|
||||
|
||||
|
||||
const surfaceScalarField& phi =
|
||||
db().lookupObject<surfaceScalarField>(phiName_);
|
||||
const auto& phi = db().lookupObject<surfaceScalarField>(phiName_);
|
||||
|
||||
if (phi.dimensions() == dimVolume/dimTime)
|
||||
{}
|
||||
else if (phi.dimensions() == dimMass/dimTime)
|
||||
{
|
||||
const fvPatchField<scalar>& rhop =
|
||||
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
||||
const auto& rhop = patch().lookupPatchField<volScalarField>(rhoName_);
|
||||
phiPyr /= rhop;
|
||||
}
|
||||
else
|
||||
|
@ -114,14 +114,9 @@ void Foam::filmHeightInletVelocityFvPatchVectorField::updateCoeffs()
|
||||
return;
|
||||
}
|
||||
|
||||
const fvsPatchField<scalar>& phip =
|
||||
patch().lookupPatchField<surfaceScalarField, scalar>(phiName_);
|
||||
|
||||
const fvPatchField<scalar>& rhop =
|
||||
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
||||
|
||||
const fvPatchField<scalar>& deltafp =
|
||||
patch().lookupPatchField<volScalarField, scalar>(deltafName_);
|
||||
const auto& phip = patch().lookupPatchField<surfaceScalarField>(phiName_);
|
||||
const auto& rhop = patch().lookupPatchField<volScalarField>(rhoName_);
|
||||
const auto& deltafp = patch().lookupPatchField<volScalarField>(deltafName_);
|
||||
|
||||
vectorField n(patch().nf());
|
||||
const scalarField& magSf = patch().magSf();
|
||||
|
@ -319,7 +319,7 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs()
|
||||
{
|
||||
qr =
|
||||
qrRelaxation_
|
||||
*patch().lookupPatchField<volScalarField, scalar>(qrName_)
|
||||
*patch().lookupPatchField<volScalarField>(qrName_)
|
||||
+ (1 - qrRelaxation_)*qrPrevious_;
|
||||
|
||||
qrPrevious_ = qr;
|
||||
|
@ -439,14 +439,12 @@ void Foam::humidityTemperatureCoupledMixedFvPatchScalarField::updateCoeffs()
|
||||
const fvPatch& nbrPatch =
|
||||
refCast<const fvMesh>(nbrMesh).boundary()[nbrPatchI];
|
||||
|
||||
const humidityTemperatureCoupledMixedFvPatchScalarField&
|
||||
nbrField =
|
||||
refCast
|
||||
const auto& nbrField = refCast
|
||||
<
|
||||
const humidityTemperatureCoupledMixedFvPatchScalarField
|
||||
>
|
||||
(
|
||||
nbrPatch.lookupPatchField<volScalarField, scalar>(TnbrName_)
|
||||
nbrPatch.lookupPatchField<volScalarField>(TnbrName_)
|
||||
);
|
||||
|
||||
// Swap to obtain full local values of neighbour internal field
|
||||
@ -515,24 +513,21 @@ void Foam::humidityTemperatureCoupledMixedFvPatchScalarField::updateCoeffs()
|
||||
const fixedGradientFvPatchField<scalar>
|
||||
>
|
||||
(
|
||||
patch().lookupPatchField<volScalarField, scalar>
|
||||
(
|
||||
specieName_
|
||||
)
|
||||
patch().lookupPatchField<volScalarField>(specieName_)
|
||||
)
|
||||
);
|
||||
|
||||
const fvPatchScalarField& pp =
|
||||
patch().lookupPatchField<volScalarField, scalar>(pName_);
|
||||
const auto& pp =
|
||||
patch().lookupPatchField<volScalarField>(pName_);
|
||||
|
||||
const fvPatchVectorField& Up =
|
||||
patch().lookupPatchField<volVectorField, vector>(UName_);
|
||||
const auto& Up =
|
||||
patch().lookupPatchField<volVectorField>(UName_);
|
||||
|
||||
const fvPatchScalarField& rhop =
|
||||
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
||||
const auto& rhop =
|
||||
patch().lookupPatchField<volScalarField>(rhoName_);
|
||||
|
||||
const fvPatchScalarField& mup =
|
||||
patch().lookupPatchField<volScalarField, scalar>(muName_);
|
||||
const auto& mup =
|
||||
patch().lookupPatchField<volScalarField>(muName_);
|
||||
|
||||
const vectorField Ui(Up.patchInternalField());
|
||||
const scalarField Yi(Yp.patchInternalField());
|
||||
@ -716,13 +711,13 @@ void Foam::humidityTemperatureCoupledMixedFvPatchScalarField::updateCoeffs()
|
||||
scalarField qr(Tp.size(), Zero);
|
||||
if (qrName_ != "none")
|
||||
{
|
||||
qr = patch().lookupPatchField<volScalarField, scalar>(qrName_);
|
||||
qr = patch().lookupPatchField<volScalarField>(qrName_);
|
||||
}
|
||||
|
||||
scalarField qrNbr(Tp.size(), Zero);
|
||||
if (qrNbrName_ != "none")
|
||||
{
|
||||
qrNbr = nbrPatch.lookupPatchField<volScalarField, scalar>(qrNbrName_);
|
||||
qrNbr = nbrPatch.lookupPatchField<volScalarField>(qrNbrName_);
|
||||
mpp.distribute(qrNbr);
|
||||
}
|
||||
|
||||
|
@ -156,8 +156,7 @@ void Foam::outletMachNumberPressureFvPatchScalarField::updateCoeffs()
|
||||
|
||||
const scalarField pb(p.oldTime().boundaryField()[patchi]);
|
||||
|
||||
const fvsPatchField<scalar>& phi =
|
||||
patch().lookupPatchField<surfaceScalarField, scalar>(phiName_);
|
||||
const auto& phi = patch().lookupPatchField<surfaceScalarField>(phiName_);
|
||||
|
||||
// Calculate the current mass flow rate
|
||||
if (phi.internalField().dimensions() != dimMass/dimTime)
|
||||
@ -179,8 +178,7 @@ void Foam::outletMachNumberPressureFvPatchScalarField::updateCoeffs()
|
||||
|
||||
const scalarField gamma(thermoPtr->gamma()().boundaryField()[patchi]);
|
||||
|
||||
const fvPatchField<scalar>& rho =
|
||||
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
||||
const auto& rho = patch().lookupPatchField<volScalarField>(rhoName_);
|
||||
|
||||
const scalarField Mb(mag(Ub)/sqrt(gamma*pb/rho));
|
||||
|
||||
|
@ -132,8 +132,7 @@ Foam::semiPermeableBaffleMassFractionFvPatchScalarField::phiY() const
|
||||
const label nbrPatchi = samplePolyPatch().index();
|
||||
const fvPatch& nbrPatch = patch().boundaryMesh()[nbrPatchi];
|
||||
|
||||
const fvPatchScalarField& nbrYp =
|
||||
nbrPatch.lookupPatchField<volScalarField, scalar>(YName);
|
||||
const auto& nbrYp = nbrPatch.lookupPatchField<volScalarField>(YName);
|
||||
scalarField nbrYc(nbrYp.patchInternalField());
|
||||
mappedPatchBase::map().distribute(nbrYc);
|
||||
|
||||
@ -149,7 +148,7 @@ void Foam::semiPermeableBaffleMassFractionFvPatchScalarField::updateCoeffs()
|
||||
}
|
||||
|
||||
const scalarField& phip =
|
||||
patch().lookupPatchField<surfaceScalarField, scalar>(phiName_);
|
||||
patch().lookupPatchField<surfaceScalarField>(phiName_);
|
||||
|
||||
const turbulenceModel& turbModel =
|
||||
db().lookupObject<turbulenceModel>
|
||||
|
@ -139,7 +139,7 @@ void Foam::semiPermeableBaffleVelocityFvPatchVectorField::updateCoeffs()
|
||||
typedef semiPermeableBaffleMassFractionFvPatchScalarField YBCType;
|
||||
|
||||
const scalarField& rhop =
|
||||
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
||||
patch().lookupPatchField<volScalarField>(rhoName_);
|
||||
|
||||
const PtrList<volScalarField>& Y = composition().Y();
|
||||
|
||||
|
@ -341,10 +341,7 @@ Foam::tmp<Foam::scalarField> Foam::temperatureCoupledBase::kappa
|
||||
mesh.lookupObject<solidThermo>(basicThermo::dictName);
|
||||
|
||||
const symmTensorField& alphaAni =
|
||||
patch_.lookupPatchField<volSymmTensorField, scalar>
|
||||
(
|
||||
alphaAniName_
|
||||
);
|
||||
patch_.lookupPatchField<volSymmTensorField>(alphaAniName_);
|
||||
|
||||
const scalarField& pp = thermo.p().boundaryField()[patchi];
|
||||
|
||||
@ -498,10 +495,7 @@ Foam::tmp<Foam::scalarField> Foam::temperatureCoupledBase::alpha
|
||||
case mtDirectionalSolidThermo:
|
||||
{
|
||||
const symmTensorField& alphaAni =
|
||||
patch_.lookupPatchField<volSymmTensorField, scalar>
|
||||
(
|
||||
alphaAniName_
|
||||
);
|
||||
patch_.lookupPatchField<volSymmTensorField>(alphaAniName_);
|
||||
|
||||
const vectorField n(patch_.nf());
|
||||
|
||||
|
@ -220,7 +220,7 @@ const solidType& thermalBaffle1DFvPatchScalarField<solidType>::solid() const
|
||||
const thermalBaffle1DFvPatchScalarField& nbrField =
|
||||
refCast<const thermalBaffle1DFvPatchScalarField>
|
||||
(
|
||||
nbrPatch.template lookupPatchField<volScalarField, scalar>(TName_)
|
||||
nbrPatch.template lookupPatchField<volScalarField>(TName_)
|
||||
);
|
||||
|
||||
return nbrField.solid();
|
||||
@ -253,7 +253,7 @@ baffleThickness() const
|
||||
const thermalBaffle1DFvPatchScalarField& nbrField =
|
||||
refCast<const thermalBaffle1DFvPatchScalarField>
|
||||
(
|
||||
nbrPatch.template lookupPatchField<volScalarField, scalar>(TName_)
|
||||
nbrPatch.template lookupPatchField<volScalarField>(TName_)
|
||||
);
|
||||
|
||||
tmp<scalarField> tthickness
|
||||
@ -284,7 +284,7 @@ tmp<scalarField> thermalBaffle1DFvPatchScalarField<solidType>::qs() const
|
||||
const thermalBaffle1DFvPatchScalarField& nbrField =
|
||||
refCast<const thermalBaffle1DFvPatchScalarField>
|
||||
(
|
||||
nbrPatch.template lookupPatchField<volScalarField, scalar>(TName_)
|
||||
nbrPatch.template lookupPatchField<volScalarField>(TName_)
|
||||
);
|
||||
|
||||
tmp<scalarField> tqs(new scalarField(nbrField.qs()));
|
||||
@ -365,15 +365,14 @@ void thermalBaffle1DFvPatchScalarField<solidType>::updateCoeffs()
|
||||
const scalarField kappaw(turbModel.kappaEff(patchi));
|
||||
|
||||
const fvPatchScalarField& Tp =
|
||||
patch().template lookupPatchField<volScalarField, scalar>(TName_);
|
||||
patch().template lookupPatchField<volScalarField>(TName_);
|
||||
|
||||
|
||||
scalarField qr(Tp.size(), Zero);
|
||||
|
||||
if (qrName_ != "none")
|
||||
{
|
||||
qr = patch().template lookupPatchField<volScalarField, scalar>
|
||||
(qrName_);
|
||||
qr = patch().template lookupPatchField<volScalarField>(qrName_);
|
||||
|
||||
qr = qrRelaxation_*qr + (1.0 - qrRelaxation_)*qrPrevious_;
|
||||
qrPrevious_ = qr;
|
||||
|
@ -158,7 +158,7 @@ void Foam::totalFlowRateAdvectiveDiffusiveFvPatchScalarField::updateCoeffs()
|
||||
|
||||
const label patchi = patch().index();
|
||||
|
||||
const compressible::turbulenceModel& turbModel =
|
||||
const auto& turbModel =
|
||||
db().lookupObject<compressible::turbulenceModel>
|
||||
(
|
||||
IOobject::groupName
|
||||
@ -168,8 +168,7 @@ void Foam::totalFlowRateAdvectiveDiffusiveFvPatchScalarField::updateCoeffs()
|
||||
)
|
||||
);
|
||||
|
||||
const fvsPatchField<scalar>& phip =
|
||||
patch().lookupPatchField<surfaceScalarField, scalar>(phiName_);
|
||||
const auto& phip = patch().lookupPatchField<surfaceScalarField>(phiName_);
|
||||
|
||||
const scalarField alphap(turbModel.alphaEff(patchi));
|
||||
|
||||
|
@ -346,10 +346,7 @@ void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs()
|
||||
const turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
|
||||
>
|
||||
(
|
||||
nbrPatch.lookupPatchField<volScalarField, scalar>
|
||||
(
|
||||
TnbrName_
|
||||
)
|
||||
nbrPatch.lookupPatchField<volScalarField>(TnbrName_)
|
||||
);
|
||||
|
||||
// Swap to obtain full local values of neighbour K*delta
|
||||
|
@ -373,7 +373,7 @@ void turbulentTemperatureRadCoupledMixedFvPatchScalarField::updateCoeffs()
|
||||
const auto& nbrField = refCast
|
||||
<const turbulentTemperatureRadCoupledMixedFvPatchScalarField>
|
||||
(
|
||||
nbrPatch.lookupPatchField<volScalarField, scalar>(TnbrName_)
|
||||
nbrPatch.lookupPatchField<volScalarField>(TnbrName_)
|
||||
);
|
||||
|
||||
// Swap to obtain full local values of neighbour K*delta
|
||||
@ -421,7 +421,7 @@ void turbulentTemperatureRadCoupledMixedFvPatchScalarField::updateCoeffs()
|
||||
scalarField qr(Tp.size(), Zero);
|
||||
if (qrName_ != "none")
|
||||
{
|
||||
qr = patch().lookupPatchField<volScalarField, scalar>(qrName_);
|
||||
qr = patch().lookupPatchField<volScalarField>(qrName_);
|
||||
}
|
||||
|
||||
scalarField qrNbr(Tp.size(), Zero);
|
||||
@ -433,13 +433,11 @@ void turbulentTemperatureRadCoupledMixedFvPatchScalarField::updateCoeffs()
|
||||
const label samplePatchi = mpp.samplePolyPatch().index();
|
||||
const fvPatch& nbrPatch =
|
||||
refCast<const fvMesh>(nbrMesh).boundary()[samplePatchi];
|
||||
qrNbr =
|
||||
nbrPatch.lookupPatchField<volScalarField, scalar>(qrNbrName_);
|
||||
qrNbr = nbrPatch.lookupPatchField<volScalarField>(qrNbrName_);
|
||||
}
|
||||
else
|
||||
{
|
||||
qrNbr =
|
||||
patch().lookupPatchField<volScalarField, scalar>(qrNbrName_);
|
||||
qrNbr = patch().lookupPatchField<volScalarField>(qrNbrName_);
|
||||
}
|
||||
distribute(qrNbrName_, qrNbr);
|
||||
}
|
||||
@ -635,7 +633,7 @@ beta() const
|
||||
nbrField = refCast
|
||||
<const turbulentTemperatureRadCoupledMixedFvPatchScalarField>
|
||||
(
|
||||
nbrPatch.lookupPatchField<volScalarField, scalar>(TnbrName_)
|
||||
nbrPatch.lookupPatchField<volScalarField>(TnbrName_)
|
||||
);
|
||||
|
||||
// Swap to obtain full local values of neighbour internal field
|
||||
|
@ -133,15 +133,13 @@ void Foam::radiation::MarshakRadiationFvPatchScalarField::updateCoeffs()
|
||||
UPstream::msgType() = oldTag+1;
|
||||
|
||||
// Temperature field
|
||||
const scalarField& Tp =
|
||||
patch().lookupPatchField<volScalarField, scalar>(TName_);
|
||||
const auto& Tp = patch().lookupPatchField<volScalarField>(TName_);
|
||||
|
||||
// Re-calc reference value
|
||||
refValue() = 4.0*constant::physicoChemical::sigma.value()*pow4(Tp);
|
||||
|
||||
// Diffusion coefficient - created by radiation model's ::updateCoeffs()
|
||||
const scalarField& gamma =
|
||||
patch().lookupPatchField<volScalarField, scalar>("gammaRad");
|
||||
const auto& gamma = patch().lookupPatchField<volScalarField>("gammaRad");
|
||||
|
||||
const boundaryRadiationProperties& boundaryRadiation =
|
||||
boundaryRadiationProperties::New(internalField().mesh());
|
||||
|
@ -158,7 +158,7 @@ updateCoeffs()
|
||||
|
||||
// Diffusion coefficient - created by radiation model's ::updateCoeffs()
|
||||
const scalarField& gamma =
|
||||
patch().lookupPatchField<volScalarField, scalar>("gammaRad");
|
||||
patch().lookupPatchField<volScalarField>("gammaRad");
|
||||
|
||||
//const scalarField temissivity = emissivity();
|
||||
const boundaryRadiationProperties& boundaryRadiation =
|
||||
|
@ -151,8 +151,7 @@ updateCoeffs()
|
||||
int oldTag = UPstream::msgType();
|
||||
UPstream::msgType() = oldTag+1;
|
||||
|
||||
const scalarField& Tp =
|
||||
patch().lookupPatchField<volScalarField, scalar>(TName_);
|
||||
const auto& Tp = patch().lookupPatchField<volScalarField>(TName_);
|
||||
|
||||
const fvDOM& dom = db().lookupObject<fvDOM>("radiationProperties");
|
||||
|
||||
@ -224,7 +223,7 @@ updateCoeffs()
|
||||
if (dom.useSolarLoad())
|
||||
{
|
||||
// Looking for primary heat flux single band
|
||||
Ir += patch().lookupPatchField<volScalarField,scalar>
|
||||
Ir += patch().lookupPatchField<volScalarField>
|
||||
(
|
||||
dom.primaryFluxName_ + "_0"
|
||||
);
|
||||
|
@ -173,7 +173,7 @@ greyDiffusiveViewFactorFixedValueFvPatchScalarField::qro(label bandI) const
|
||||
|
||||
if (radiation.useSolarLoad())
|
||||
{
|
||||
tqrt.ref() += patch().lookupPatchField<volScalarField, scalar>
|
||||
tqrt.ref() += patch().lookupPatchField<volScalarField>
|
||||
(
|
||||
radiation.primaryFluxName_ + "_" + name(bandI)
|
||||
);
|
||||
|
@ -211,7 +211,7 @@ updateCoeffs()
|
||||
if (dom.useSolarLoad())
|
||||
{
|
||||
// Looking for primary heat flux single band
|
||||
Ir += patch().lookupPatchField<volScalarField,scalar>
|
||||
Ir += patch().lookupPatchField<volScalarField>
|
||||
(
|
||||
dom.primaryFluxName_ + "_" + name(lambdaId)
|
||||
);
|
||||
|
@ -208,10 +208,7 @@ patchSource() const
|
||||
const auto& Yp =
|
||||
refCast<const speciesSorptionFvPatchScalarField>
|
||||
(
|
||||
patch().lookupPatchField<volScalarField, scalar>
|
||||
(
|
||||
speciesName_
|
||||
)
|
||||
patch().lookupPatchField<volScalarField>(speciesName_)
|
||||
);
|
||||
|
||||
// mass rate [kg/sec/m3]
|
||||
@ -224,11 +221,8 @@ patchSource() const
|
||||
|
||||
if (includeHs_)
|
||||
{
|
||||
const fvPatchField<scalar>& pp =
|
||||
patch().lookupPatchField<volScalarField, scalar>(pName_);
|
||||
|
||||
const fvPatchField<scalar>& Tp =
|
||||
patch().lookupPatchField<volScalarField, scalar>(TName_);
|
||||
const auto& pp = patch().lookupPatchField<volScalarField>(pName_);
|
||||
const auto& Tp = patch().lookupPatchField<volScalarField>(TName_);
|
||||
|
||||
const auto& thermo = db().lookupObject<rhoReactionThermo>
|
||||
(
|
||||
@ -270,10 +264,7 @@ void Foam::enthalpySorptionFvPatchScalarField::updateCoeffs()
|
||||
const auto& Yp =
|
||||
refCast<const speciesSorptionFvPatchScalarField>
|
||||
(
|
||||
patch().lookupPatchField<volScalarField, scalar>
|
||||
(
|
||||
speciesName_
|
||||
)
|
||||
patch().lookupPatchField<volScalarField>(speciesName_)
|
||||
);
|
||||
|
||||
switch (enthalpyModel_)
|
||||
|
@ -369,8 +369,7 @@ void Foam::speciesSorptionFvPatchScalarField::updateCoeffs()
|
||||
// mole fraction
|
||||
tmp<scalarField> tco = calcMoleFractions();
|
||||
|
||||
const fvPatchField<scalar>& pp =
|
||||
patch().lookupPatchField<volScalarField, scalar>(pName_);
|
||||
const auto& pp = patch().lookupPatchField<volScalarField>(pName_);
|
||||
|
||||
cEq = max_*(kl_*tco()*pp/(1 + kl_*tco()*pp));
|
||||
break;
|
||||
|
@ -113,7 +113,7 @@ Foam::temperatureDependentAlphaContactAngleFvPatchScalarField::theta
|
||||
{
|
||||
return theta0_->value
|
||||
(
|
||||
patch().lookupPatchField<volScalarField, scalar>(TName_)
|
||||
patch().lookupPatchField<volScalarField>(TName_)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -146,8 +146,7 @@ void Foam::alphaFixedPressureFvPatchScalarField::updateCoeffs()
|
||||
const uniformDimensionedVectorField& g =
|
||||
meshObjects::gravity::New(db().time());
|
||||
|
||||
const fvPatchField<scalar>& rho =
|
||||
patch().lookupPatchField<volScalarField, scalar>("rho");
|
||||
const auto& rho = patch().lookupPatchField<volScalarField>("rho");
|
||||
|
||||
operator==(p_ - rho*(g.value() & patch().Cf()));
|
||||
|
||||
|
@ -56,13 +56,13 @@ functions
|
||||
#{
|
||||
// Lookup U
|
||||
Info<< "Looking up field U\n" << endl;
|
||||
const volVectorField& U = mesh().lookupObject<volVectorField>("U");
|
||||
const auto& U = mesh().lookupObject<volVectorField>("U");
|
||||
|
||||
Info<< "Reading inlet velocity uInfX\n" << endl;
|
||||
|
||||
scalar ULeft = 0.0;
|
||||
label leftI = mesh().boundaryMesh().findPatchID("left");
|
||||
const fvPatchVectorField& fvp = U.boundaryField()[leftI];
|
||||
const auto& fvp = U.boundaryField()[leftI];
|
||||
if (fvp.size())
|
||||
{
|
||||
ULeft = fvp[0].x();
|
||||
@ -76,7 +76,7 @@ functions
|
||||
|
||||
scalar magCylinder = 0.0;
|
||||
label cylI = mesh().boundaryMesh().findPatchID("cylinder");
|
||||
const fvPatchVectorField& cylFvp = mesh().C().boundaryField()[cylI];
|
||||
const auto& cylFvp = mesh().C().boundaryField()[cylI];
|
||||
if (cylFvp.size())
|
||||
{
|
||||
magCylinder = mag(cylFvp[0]);
|
||||
|
@ -112,8 +112,7 @@ functions
|
||||
|
||||
codeWrite
|
||||
#{
|
||||
const volScalarField& rho =
|
||||
mesh().lookupObject<volScalarField>("rho");
|
||||
const auto& rho = mesh().lookupObject<volScalarField>("rho");
|
||||
|
||||
Info<< "rho volume = " << rho.weightedAverage(mesh().Vsc()) << endl;
|
||||
#};
|
||||
|
@ -98,7 +98,7 @@ functions
|
||||
codeWrite
|
||||
#{
|
||||
|
||||
const volScalarField& alpha =
|
||||
const auto& alpha =
|
||||
mesh().lookupObject<volScalarField>("alpha.water");
|
||||
|
||||
Info<< "Alpha volume = " << alpha.weightedAverage(mesh().Vsc())
|
||||
|
@ -60,17 +60,16 @@ totalMass
|
||||
|
||||
code
|
||||
#{
|
||||
const volScalarField& alphaGas =
|
||||
const auto& alphaGas =
|
||||
mesh().lookupObject<volScalarField>("alpha.gas");
|
||||
const volScalarField& alphaLiquid =
|
||||
const auto& alphaLiquid =
|
||||
mesh().lookupObject<volScalarField>("alpha.liquid");
|
||||
|
||||
const volScalarField& rhoGas =
|
||||
const auto& rhoGas =
|
||||
mesh().lookupObject<volScalarField>("thermo:rho.gas");
|
||||
const volScalarField& rhoLiquid =
|
||||
const auto& rhoLiquid =
|
||||
mesh().lookupObject<volScalarField>("thermo:rho.liquid");
|
||||
|
||||
|
||||
const scalarField& v = mesh().V();
|
||||
|
||||
Info<< "coded totalMass output:" << endl
|
||||
|
Loading…
Reference in New Issue
Block a user