ENH: Updated smoluchowskiJump BC

This commit is contained in:
andy
2012-12-06 15:56:16 +00:00
parent 74e2acbc22
commit 2bb551bc85
2 changed files with 37 additions and 7 deletions

View File

@ -38,6 +38,10 @@ Foam::smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField
) )
: :
mixedFvPatchScalarField(p, iF), mixedFvPatchScalarField(p, iF),
UName_("U"),
rhoName_("rho"),
psiName_("thermo:psi"),
muName_("thermo:mu"),
accommodationCoeff_(1.0), accommodationCoeff_(1.0),
Twall_(p.size(), 0.0), Twall_(p.size(), 0.0),
gamma_(1.4) gamma_(1.4)
@ -57,6 +61,10 @@ Foam::smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField
) )
: :
mixedFvPatchScalarField(ptf, p, iF, mapper), mixedFvPatchScalarField(ptf, p, iF, mapper),
UName_(ptf.UName_),
rhoName_(ptf.rhoName_),
psiName_(ptf.psiName_),
muName_(ptf.muName_),
accommodationCoeff_(ptf.accommodationCoeff_), accommodationCoeff_(ptf.accommodationCoeff_),
Twall_(ptf.Twall_), Twall_(ptf.Twall_),
gamma_(ptf.gamma_) gamma_(ptf.gamma_)
@ -71,6 +79,10 @@ Foam::smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField
) )
: :
mixedFvPatchScalarField(p, iF), mixedFvPatchScalarField(p, iF),
UName_(dict.lookupOrDefault<word>("U", "U")),
rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
psiName_(dict.lookupOrDefault<word>("psi", "thermo:psi")),
muName_(dict.lookupOrDefault<word>("mu", "thermo:mu")),
accommodationCoeff_(readScalar(dict.lookup("accommodationCoeff"))), accommodationCoeff_(readScalar(dict.lookup("accommodationCoeff"))),
Twall_("Twall", dict, p.size()), Twall_("Twall", dict, p.size()),
gamma_(dict.lookupOrDefault<scalar>("gamma", 1.4)) gamma_(dict.lookupOrDefault<scalar>("gamma", 1.4))
@ -159,13 +171,13 @@ void Foam::smoluchowskiJumpTFvPatchScalarField::updateCoeffs()
} }
const fvPatchScalarField& pmu = const fvPatchScalarField& pmu =
patch().lookupPatchField<volScalarField, scalar>("mu"); patch().lookupPatchField<volScalarField, scalar>(muName_);
const fvPatchScalarField& prho = const fvPatchScalarField& prho =
patch().lookupPatchField<volScalarField, scalar>("rho"); patch().lookupPatchField<volScalarField, scalar>(rhoName_);
const fvPatchField<scalar>& ppsi = const fvPatchField<scalar>& ppsi =
patch().lookupPatchField<volScalarField, scalar>("psi"); patch().lookupPatchField<volScalarField, scalar>(psiName_);
const fvPatchVectorField& pU = const fvPatchVectorField& pU =
patch().lookupPatchField<volVectorField, vector>("U"); patch().lookupPatchField<volVectorField, vector>(UName_);
// Prandtl number reading consistent with rhoCentralFoam // Prandtl number reading consistent with rhoCentralFoam
const dictionary& thermophysicalProperties = const dictionary& thermophysicalProperties =
@ -204,6 +216,12 @@ void Foam::smoluchowskiJumpTFvPatchScalarField::updateCoeffs()
void Foam::smoluchowskiJumpTFvPatchScalarField::write(Ostream& os) const void Foam::smoluchowskiJumpTFvPatchScalarField::write(Ostream& os) const
{ {
fvPatchScalarField::write(os); fvPatchScalarField::write(os);
writeEntryIfDifferent<word>(os, "U", "U", UName_);
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
writeEntryIfDifferent<word>(os, "psi", "thermo:psi", psiName_);
writeEntryIfDifferent<word>(os, "mu", "thermo:mu", muName_);
os.writeKeyword("accommodationCoeff") os.writeKeyword("accommodationCoeff")
<< accommodationCoeff_ << token::END_STATEMENT << nl; << accommodationCoeff_ << token::END_STATEMENT << nl;
Twall_.writeEntry("Twall", os); Twall_.writeEntry("Twall", os);

View File

@ -53,13 +53,25 @@ class smoluchowskiJumpTFvPatchScalarField
// Private data // Private data
// Accommodation coefficient //- Velocity field name, default = "U"
word UName_;
//- Density field name, default = "rho"
word rhoName_;
//- Compressibility field name, default = "thermo:psi"
word psiName_;
//- Dynamic viscosity field name, default = "thermo:mu"
word muName_;
//- Accommodation coefficient
scalar accommodationCoeff_; scalar accommodationCoeff_;
// Wall surface temperature //- Wall surface temperature
scalarField Twall_; scalarField Twall_;
// Heat capacity ratio (default 1.4) //- Heat capacity ratio (default 1.4)
scalar gamma_; scalar gamma_;
public: public: