diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C b/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C index 61861b33fa..6ec81dd4dc 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C @@ -30,20 +30,20 @@ License #include "volFields.H" #include "fvcGrad.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField +Foam::maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField ( const fvPatch& p, const DimensionedField& iF ) : mixedFixedValueSlipFvPatchVectorField(p, iF), + TName_("T"), + rhoName_("rho"), + psiName_("thermo:psi"), + muName_("thermo:mu"), + tauMCName_("tauMC"), accommodationCoeff_(1.0), Uwall_(p.size(), vector(0.0, 0.0, 0.0)), thermalCreep_(true), @@ -51,23 +51,28 @@ maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField {} -maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField +Foam::maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField ( - const maxwellSlipUFvPatchVectorField& tdpvf, + const maxwellSlipUFvPatchVectorField& mspvf, const fvPatch& p, const DimensionedField& iF, const fvPatchFieldMapper& mapper ) : - mixedFixedValueSlipFvPatchVectorField(tdpvf, p, iF, mapper), - accommodationCoeff_(tdpvf.accommodationCoeff_), - Uwall_(tdpvf.Uwall_), - thermalCreep_(tdpvf.thermalCreep_), - curvature_(tdpvf.curvature_) + mixedFixedValueSlipFvPatchVectorField(mspvf, p, iF, mapper), + TName_(mspvf.TName_), + rhoName_(mspvf.rhoName_), + psiName_(mspvf.psiName_), + muName_(mspvf.muName_), + tauMCName_(mspvf.tauMCName_), + accommodationCoeff_(mspvf.accommodationCoeff_), + Uwall_(mspvf.Uwall_), + thermalCreep_(mspvf.thermalCreep_), + curvature_(mspvf.curvature_) {} -maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField +Foam::maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField ( const fvPatch& p, const DimensionedField& iF, @@ -75,6 +80,11 @@ maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField ) : mixedFixedValueSlipFvPatchVectorField(p, iF), + TName_(dict.lookupOrDefault("T", "T")), + rhoName_(dict.lookupOrDefault("rho", "rho")), + psiName_(dict.lookupOrDefault("psi", "thermo:psi")), + muName_(dict.lookupOrDefault("mu", "thermo:mu")), + tauMCName_(dict.lookupOrDefault("tauMC", "tauMC")), accommodationCoeff_(readScalar(dict.lookup("accommodationCoeff"))), Uwall_("Uwall", dict, p.size()), thermalCreep_(dict.lookupOrDefault("thermalCreep", true)), @@ -88,9 +98,12 @@ maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField { FatalIOErrorIn ( - "maxwellSlipUFvPatchScalarField::" - "maxwellSlipUFvPatchScalarField" - "(const fvPatch&, const scalarField&, const dictionary&)", + "maxwellSlipUFvPatchScalarField::maxwellSlipUFvPatchScalarField" + "(" + "const fvPatch&, " + "const DimensionedField&, " + "const dictionary&" + ")", dict ) << "unphysical accommodationCoeff_ specified" << "(0 < accommodationCoeff_ <= 1)" << endl @@ -119,23 +132,28 @@ maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField } -maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField +Foam::maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField ( - const maxwellSlipUFvPatchVectorField& tdpvf, + const maxwellSlipUFvPatchVectorField& mspvf, const DimensionedField& iF ) : - mixedFixedValueSlipFvPatchVectorField(tdpvf, iF), - accommodationCoeff_(tdpvf.accommodationCoeff_), - Uwall_(tdpvf.Uwall_), - thermalCreep_(tdpvf.thermalCreep_), - curvature_(tdpvf.curvature_) + mixedFixedValueSlipFvPatchVectorField(mspvf, iF), + TName_(mspvf.TName_), + rhoName_(mspvf.rhoName_), + psiName_(mspvf.psiName_), + muName_(mspvf.muName_), + tauMCName_(mspvf.tauMCName_), + accommodationCoeff_(mspvf.accommodationCoeff_), + Uwall_(mspvf.Uwall_), + thermalCreep_(mspvf.thermalCreep_), + curvature_(mspvf.curvature_) {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void maxwellSlipUFvPatchVectorField::updateCoeffs() +void Foam::maxwellSlipUFvPatchVectorField::updateCoeffs() { if (updated()) { @@ -143,11 +161,11 @@ void maxwellSlipUFvPatchVectorField::updateCoeffs() } const fvPatchScalarField& pmu = - patch().lookupPatchField("mu"); + patch().lookupPatchField(muName_); const fvPatchScalarField& prho = - patch().lookupPatchField("rho"); + patch().lookupPatchField(rhoName_); const fvPatchField& ppsi = - patch().lookupPatchField("psi"); + patch().lookupPatchField(psiName_); Field C1 ( @@ -163,7 +181,7 @@ void maxwellSlipUFvPatchVectorField::updateCoeffs() if (thermalCreep_) { const volScalarField& vsfT = - this->db().objectRegistry::lookupObject("T"); + this->db().objectRegistry::lookupObject(TName_); label patchi = this->patch().index(); const fvPatchScalarField& pT = vsfT.boundaryField()[patchi]; Field gradpT(fvc::grad(vsfT)().boundaryField()[patchi]); @@ -175,7 +193,7 @@ void maxwellSlipUFvPatchVectorField::updateCoeffs() if (curvature_) { const fvPatchTensorField& ptauMC = - patch().lookupPatchField("tauMC"); + patch().lookupPatchField(tauMCName_); vectorField n(patch().nf()); refValue() -= C1/prho*transform(I - n*n, (n & ptauMC)); @@ -185,9 +203,15 @@ void maxwellSlipUFvPatchVectorField::updateCoeffs() } -void maxwellSlipUFvPatchVectorField::write(Ostream& os) const +void Foam::maxwellSlipUFvPatchVectorField::write(Ostream& os) const { fvPatchVectorField::write(os); + writeEntryIfDifferent(os, "T", "T", TName_); + writeEntryIfDifferent(os, "rho", "rho", rhoName_); + writeEntryIfDifferent(os, "psi", "thermo:psi", psiName_); + writeEntryIfDifferent(os, "mu", "thermo:mu", muName_); + writeEntryIfDifferent(os, "tauMC", "tauMC", tauMCName_); + os.writeKeyword("accommodationCoeff") << accommodationCoeff_ << token::END_STATEMENT << nl; Uwall_.writeEntry("Uwall", os); @@ -204,14 +228,13 @@ void maxwellSlipUFvPatchVectorField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField -( - fvPatchVectorField, - maxwellSlipUFvPatchVectorField -); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam +namespace Foam +{ + makePatchTypeField + ( + fvPatchVectorField, + maxwellSlipUFvPatchVectorField + ); +} // ************************************************************************* // diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.H b/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.H index df441c5d91..afebd9a9bf 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.H +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.H @@ -54,6 +54,21 @@ class maxwellSlipUFvPatchVectorField { // Private data + //- Temperature field name, default = "T" + word TName_; + + //- Density field name, default = "rho" + word rhoName_; + + //- Compressibility field name, default = "thermo:psi" + word psiName_; + + //- Dynamic viscosity field name, default = "thermo:mu" + word muName_; + + //- tauMC field name, default = "tauMC" + word tauMCName_; + // Accommodation coefficient scalar accommodationCoeff_;