30#include "twoPhaseSystem.H"
39 JohnsonJacksonParticleThetaFvPatchScalarField
45Foam::JohnsonJacksonParticleThetaFvPatchScalarField::
46JohnsonJacksonParticleThetaFvPatchScalarField
49 const DimensionedField<scalar, volMesh>& iF
52 mixedFvPatchScalarField(
p, iF),
53 restitutionCoefficient_(
"restitutionCoefficient",
dimless, Zero),
54 specularityCoefficient_(
"specularityCoefficient",
dimless, Zero)
58Foam::JohnsonJacksonParticleThetaFvPatchScalarField::
59JohnsonJacksonParticleThetaFvPatchScalarField
61 const JohnsonJacksonParticleThetaFvPatchScalarField& ptf,
63 const DimensionedField<scalar, volMesh>& iF,
64 const fvPatchFieldMapper& mapper
67 mixedFvPatchScalarField(ptf,
p, iF, mapper),
68 restitutionCoefficient_(ptf.restitutionCoefficient_),
69 specularityCoefficient_(ptf.specularityCoefficient_)
74Foam::JohnsonJacksonParticleThetaFvPatchScalarField::
75JohnsonJacksonParticleThetaFvPatchScalarField
78 const DimensionedField<scalar, volMesh>& iF,
79 const dictionary&
dict
82 mixedFvPatchScalarField(
p, iF),
83 restitutionCoefficient_(
"restitutionCoefficient",
dimless,
dict),
84 specularityCoefficient_(
"specularityCoefficient",
dimless,
dict)
88 (restitutionCoefficient_.value() < 0)
89 || (restitutionCoefficient_.value() > 1)
93 <<
"The restitution coefficient has to be between 0 and 1"
99 (specularityCoefficient_.value() < 0)
100 || (specularityCoefficient_.value() > 1)
104 <<
"The specularity coefficient has to be between 0 and 1"
105 <<
abort(FatalError);
108 fvPatchScalarField::operator=
115Foam::JohnsonJacksonParticleThetaFvPatchScalarField::
116JohnsonJacksonParticleThetaFvPatchScalarField
118 const JohnsonJacksonParticleThetaFvPatchScalarField& ptf
121 mixedFvPatchScalarField(ptf),
122 restitutionCoefficient_(ptf.restitutionCoefficient_),
123 specularityCoefficient_(ptf.specularityCoefficient_)
127Foam::JohnsonJacksonParticleThetaFvPatchScalarField::
128JohnsonJacksonParticleThetaFvPatchScalarField
130 const JohnsonJacksonParticleThetaFvPatchScalarField& ptf,
131 const DimensionedField<scalar, volMesh>& iF
134 mixedFvPatchScalarField(ptf, iF),
135 restitutionCoefficient_(ptf.restitutionCoefficient_),
136 specularityCoefficient_(ptf.specularityCoefficient_)
144 const fvPatchFieldMapper& m
147 mixedFvPatchScalarField::autoMap(m);
157 mixedFvPatchScalarField::rmap(ptf, addr);
169 const twoPhaseSystem&
fluid = db().lookupObject<twoPhaseSystem>
174 const phaseModel& phased
184 patch().lookupPatchField<volScalarField, scalar>
186 phased.volScalarField::name()
192 patch().lookupPatchField<volVectorField, vector>
200 patch().lookupPatchField<volScalarField, scalar>
208 patch().lookupPatchField<volScalarField, scalar>
222 .lookupObject<IOdictionary>
227 .subDict(
"kineticTheoryCoeffs")
231 if (restitutionCoefficient_.value() != 1.0)
235 *specularityCoefficient_.value()
237 /(scalar(1) -
sqr(restitutionCoefficient_.value()));
239 this->refGrad() = 0.0;
246 *(scalar(1) -
sqr(restitutionCoefficient_.value()))
251 this->valueFraction() =
c/(
c +
patch().deltaCoeffs());
258 this->refValue() = 0.0;
263 *specularityCoefficient_.value()
270 this->valueFraction() = 0.0;
273 mixedFvPatchScalarField::updateCoeffs();
283 os.
writeEntry(
"restitutionCoefficient", restitutionCoefficient_);
284 os.
writeEntry(
"specularityCoefficient", specularityCoefficient_);
285 writeEntry(
"value",
os);
Macros for easy insertion into run-time selection tables.
static word groupName(StringType base, const word &group)
Create dot-delimited name.group string.
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
virtual void updateCoeffs()
Update the coefficients.
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
const Type & value() const
Return const reference to value.
virtual bool write()
Write the output fields.
const word & name() const
const phaseModel & phase1() const
Return phase model 1.
const phaseModel & phase2() const
Return phase model 2.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
#define makePatchTypeField(PatchTypeField, typePatchTypeField)
constexpr const char *const group
Group name for atomic constants.
const dimensionedScalar kappa
Coulomb constant: default SI units: [N.m2/C2].
constexpr scalar pi(M_PI)
const dimensionedScalar c
Speed of light in a vacuum.
const std::string patch
OpenFOAM patch number as a std::string.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
const dimensionSet dimless
Dimensionless.
dimensionedScalar pos0(const dimensionedScalar &ds)
List< label > labelList
A List of labels.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
dimensionedScalar sqrt(const dimensionedScalar &ds)
errorManip< error > abort(error &err)
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
fvPatchField< vector > fvPatchVectorField
fvPatchField< scalar > fvPatchScalarField
dimensionedScalar alphaMax("alphaMax", dimless/dimTime, laminarTransport)