Skip to content
Snippets Groups Projects
Commit f74e0657 authored by Henry Weller's avatar Henry Weller Committed by Andrew Heather
Browse files

STYLE: cylindricalInletVelocityFvPatchVectorField: Rationalized naming convention

for consistency with other rotating BCs.
parent e7f979c4
Branches
Tags
No related merge requests found
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
...@@ -40,7 +40,7 @@ cylindricalInletVelocityFvPatchVectorField ...@@ -40,7 +40,7 @@ cylindricalInletVelocityFvPatchVectorField
) )
: :
fixedValueFvPatchField<vector>(p, iF), fixedValueFvPatchField<vector>(p, iF),
centre_(Zero), origin_(Zero),
axis_(Zero), axis_(Zero),
axialVelocity_(), axialVelocity_(),
radialVelocity_(), radialVelocity_(),
...@@ -58,7 +58,7 @@ cylindricalInletVelocityFvPatchVectorField ...@@ -58,7 +58,7 @@ cylindricalInletVelocityFvPatchVectorField
) )
: :
fixedValueFvPatchField<vector>(ptf, p, iF, mapper), fixedValueFvPatchField<vector>(ptf, p, iF, mapper),
centre_(ptf.centre_), origin_(ptf.origin_),
axis_(ptf.axis_), axis_(ptf.axis_),
axialVelocity_(ptf.axialVelocity_.clone()), axialVelocity_(ptf.axialVelocity_.clone()),
radialVelocity_(ptf.radialVelocity_.clone()), radialVelocity_(ptf.radialVelocity_.clone()),
...@@ -75,7 +75,7 @@ cylindricalInletVelocityFvPatchVectorField ...@@ -75,7 +75,7 @@ cylindricalInletVelocityFvPatchVectorField
) )
: :
fixedValueFvPatchField<vector>(p, iF, dict), fixedValueFvPatchField<vector>(p, iF, dict),
centre_(dict.lookup("centre")), origin_(dict.lookup("origin")),
axis_(dict.lookup("axis")), axis_(dict.lookup("axis")),
axialVelocity_(Function1<scalar>::New("axialVelocity", dict)), axialVelocity_(Function1<scalar>::New("axialVelocity", dict)),
radialVelocity_(Function1<scalar>::New("radialVelocity", dict)), radialVelocity_(Function1<scalar>::New("radialVelocity", dict)),
...@@ -90,7 +90,7 @@ cylindricalInletVelocityFvPatchVectorField ...@@ -90,7 +90,7 @@ cylindricalInletVelocityFvPatchVectorField
) )
: :
fixedValueFvPatchField<vector>(ptf), fixedValueFvPatchField<vector>(ptf),
centre_(ptf.centre_), origin_(ptf.origin_),
axis_(ptf.axis_), axis_(ptf.axis_),
axialVelocity_(ptf.axialVelocity_.clone()), axialVelocity_(ptf.axialVelocity_.clone()),
radialVelocity_(ptf.radialVelocity_.clone()), radialVelocity_(ptf.radialVelocity_.clone()),
...@@ -106,7 +106,7 @@ cylindricalInletVelocityFvPatchVectorField ...@@ -106,7 +106,7 @@ cylindricalInletVelocityFvPatchVectorField
) )
: :
fixedValueFvPatchField<vector>(ptf, iF), fixedValueFvPatchField<vector>(ptf, iF),
centre_(ptf.centre_), origin_(ptf.origin_),
axis_(ptf.axis_), axis_(ptf.axis_),
axialVelocity_(ptf.axialVelocity_.clone()), axialVelocity_(ptf.axialVelocity_.clone()),
radialVelocity_(ptf.radialVelocity_.clone()), radialVelocity_(ptf.radialVelocity_.clone()),
...@@ -128,17 +128,17 @@ void Foam::cylindricalInletVelocityFvPatchVectorField::updateCoeffs() ...@@ -128,17 +128,17 @@ void Foam::cylindricalInletVelocityFvPatchVectorField::updateCoeffs()
const scalar radialVelocity = radialVelocity_->value(t); const scalar radialVelocity = radialVelocity_->value(t);
const scalar rpm = rpm_->value(t); const scalar rpm = rpm_->value(t);
vector hatAxis = axis_/mag(axis_); const vector axisHat = axis_/mag(axis_);
const vectorField r(patch().Cf() - centre_); const vectorField r(patch().Cf() - origin_);
const vectorField d(r - (hatAxis & r)*hatAxis); const vectorField d(r - (axisHat & r)*axisHat);
tmp<vectorField> tangVel tmp<vectorField> tangVel
( (
(rpm*constant::mathematical::pi/30.0)*(hatAxis) ^ d (rpm*constant::mathematical::pi/30.0)*(axisHat) ^ d
); );
operator==(tangVel + hatAxis*axialVelocity + radialVelocity*d/mag(d)); operator==(tangVel + axisHat*axialVelocity + radialVelocity*d/mag(d));
fixedValueFvPatchField<vector>::updateCoeffs(); fixedValueFvPatchField<vector>::updateCoeffs();
} }
...@@ -147,7 +147,7 @@ void Foam::cylindricalInletVelocityFvPatchVectorField::updateCoeffs() ...@@ -147,7 +147,7 @@ void Foam::cylindricalInletVelocityFvPatchVectorField::updateCoeffs()
void Foam::cylindricalInletVelocityFvPatchVectorField::write(Ostream& os) const void Foam::cylindricalInletVelocityFvPatchVectorField::write(Ostream& os) const
{ {
fvPatchField<vector>::write(os); fvPatchField<vector>::write(os);
os.writeEntry("centre", centre_); os.writeEntry("origin", origin_);
os.writeEntry("axis", axis_); os.writeEntry("axis", axis_);
axialVelocity_->writeData(os); axialVelocity_->writeData(os);
radialVelocity_->writeData(os); radialVelocity_->writeData(os);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
...@@ -36,7 +36,7 @@ Usage ...@@ -36,7 +36,7 @@ Usage
\table \table
Property | Description | Required | Default value Property | Description | Required | Default value
axis | axis of rotation | yes | axis | axis of rotation | yes |
centre | centre of rotation | yes | origin | origin of rotation | yes |
axialVelocity | axial velocity profile [m/s] | yes | axialVelocity | axial velocity profile [m/s] | yes |
radialVelocity | radial velocity profile [m/s] | yes | radialVelocity | radial velocity profile [m/s] | yes |
rpm | rotational speed (revolutions per minute) | yes| rpm | rotational speed (revolutions per minute) | yes|
...@@ -48,7 +48,7 @@ Usage ...@@ -48,7 +48,7 @@ Usage
{ {
type cylindricalInletVelocity; type cylindricalInletVelocity;
axis (0 0 1); axis (0 0 1);
centre (0 0 0); origin (0 0 0);
axialVelocity constant 30; axialVelocity constant 30;
radialVelocity constant -10; radialVelocity constant -10;
rpm constant 100; rpm constant 100;
...@@ -89,10 +89,10 @@ class cylindricalInletVelocityFvPatchVectorField ...@@ -89,10 +89,10 @@ class cylindricalInletVelocityFvPatchVectorField
{ {
// Private data // Private data
//- Central point //- Origin of the rotation
const vector centre_; const vector origin_;
//- Axis //- Axis of the rotation
const vector axis_; const vector axis_;
//- Axial velocity //- Axial velocity
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment