compiling
This commit is contained in:
parent
42158324e1
commit
dd8777480a
2 changed files with 36 additions and 7 deletions
|
|
@ -29,6 +29,8 @@ License
|
|||
#include "fvPatchFieldMapper.H"
|
||||
#include "surfaceFields.H"
|
||||
|
||||
#include "unitConversion.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::flowRateTiltedInletVelocityFvPatchVectorField::
|
||||
|
|
@ -42,7 +44,9 @@ flowRateTiltedInletVelocityFvPatchVectorField
|
|||
flowRate_(),
|
||||
volumetric_(false),
|
||||
rhoName_("rho"),
|
||||
rhoInlet_(0.0)
|
||||
rhoInlet_(0.0),
|
||||
angle_(0.0),
|
||||
axis_(vector(0,0,0))
|
||||
{}
|
||||
|
||||
|
||||
|
|
@ -59,7 +63,9 @@ flowRateTiltedInletVelocityFvPatchVectorField
|
|||
flowRate_(ptf.flowRate_().clone().ptr()),
|
||||
volumetric_(ptf.volumetric_),
|
||||
rhoName_(ptf.rhoName_),
|
||||
rhoInlet_(ptf.rhoInlet_)
|
||||
rhoInlet_(ptf.rhoInlet_),
|
||||
angle_(ptf.angle_),
|
||||
axis_(ptf.axis_)
|
||||
{}
|
||||
|
||||
|
||||
|
|
@ -111,6 +117,12 @@ flowRateTiltedInletVelocityFvPatchVectorField
|
|||
{
|
||||
evaluate(Pstream::blocking);
|
||||
}
|
||||
|
||||
angle_ = degToRad(readScalar(dict.lookup("angle")));
|
||||
|
||||
vector axis(dict.lookup("axis"));
|
||||
|
||||
axis_ = axis / mag(axis);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -124,7 +136,9 @@ flowRateTiltedInletVelocityFvPatchVectorField
|
|||
flowRate_(ptf.flowRate_().clone().ptr()),
|
||||
volumetric_(ptf.volumetric_),
|
||||
rhoName_(ptf.rhoName_),
|
||||
rhoInlet_(ptf.rhoInlet_)
|
||||
rhoInlet_(ptf.rhoInlet_),
|
||||
angle_(ptf.angle_),
|
||||
axis_(ptf.axis_)
|
||||
{}
|
||||
|
||||
|
||||
|
|
@ -139,7 +153,9 @@ flowRateTiltedInletVelocityFvPatchVectorField
|
|||
flowRate_(ptf.flowRate_().clone().ptr()),
|
||||
volumetric_(ptf.volumetric_),
|
||||
rhoName_(ptf.rhoName_),
|
||||
rhoInlet_(ptf.rhoInlet_)
|
||||
rhoInlet_(ptf.rhoInlet_),
|
||||
angle_(ptf.angle_),
|
||||
axis_(ptf.axis_)
|
||||
{}
|
||||
|
||||
|
||||
|
|
@ -159,10 +175,17 @@ void Foam::flowRateTiltedInletVelocityFvPatchVectorField::updateCoeffs()
|
|||
|
||||
tmp<vectorField> n = patch().nf();
|
||||
|
||||
scalarField B(Foam::asin(n & axis_));
|
||||
|
||||
scalarField tau(Foam::cos(B)*(Foam::tan(B+angle_) - Foam::tan(B)));
|
||||
|
||||
vectorField nt((n + tau * axis_)/(1.0 + tau * (axis_ & n)));
|
||||
|
||||
|
||||
if (volumetric_ || rhoName_ == "none")
|
||||
{
|
||||
// volumetric flow-rate or density not given
|
||||
operator==(n*avgU);
|
||||
operator==(nt*avgU);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -172,7 +195,7 @@ void Foam::flowRateTiltedInletVelocityFvPatchVectorField::updateCoeffs()
|
|||
const fvPatchField<scalar>& rhop =
|
||||
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
||||
|
||||
operator==(n*avgU/rhop);
|
||||
operator==(nt*avgU/rhop);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -186,7 +209,7 @@ void Foam::flowRateTiltedInletVelocityFvPatchVectorField::updateCoeffs()
|
|||
<< " and no constant density 'rhoInlet' specified"
|
||||
<< exit(FatalError);
|
||||
}
|
||||
operator==(n*avgU/rhoInlet_);
|
||||
operator==(nt*avgU/rhoInlet_);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -123,6 +123,12 @@ class flowRateTiltedInletVelocityFvPatchVectorField
|
|||
//- Rho initialisation value (for start; if value not supplied)
|
||||
scalar rhoInlet_;
|
||||
|
||||
//- Rho initialisation value (for start; if value not supplied)
|
||||
scalar angle_;
|
||||
|
||||
//- Rho initialisation value (for start; if value not supplied)
|
||||
vector axis_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue