diff --git a/src/OpenFOAM/interpolations/interpolateSplineXY/interpolateSplineXY.C b/src/OpenFOAM/interpolations/interpolateSplineXY/interpolateSplineXY.C
index 2fa74142cd..a11dbdd41c 100644
--- a/src/OpenFOAM/interpolations/interpolateSplineXY/interpolateSplineXY.C
+++ b/src/OpenFOAM/interpolations/interpolateSplineXY/interpolateSplineXY.C
@@ -8,10 +8,10 @@
License
This file is part of OpenFOAM.
- OpenFOAM is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; either version 2 of the License, or (at your
- option) any later version.
+ OpenFOAM is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@@ -19,8 +19,7 @@ License
for more details.
You should have received a copy of the GNU General Public License
- along with OpenFOAM; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ along with OpenFOAM. If not, see .
\*---------------------------------------------------------------------------*/
diff --git a/src/OpenFOAM/interpolations/interpolateSplineXY/interpolateSplineXY.H b/src/OpenFOAM/interpolations/interpolateSplineXY/interpolateSplineXY.H
index 7d06169ea8..0f9e28b73b 100644
--- a/src/OpenFOAM/interpolations/interpolateSplineXY/interpolateSplineXY.H
+++ b/src/OpenFOAM/interpolations/interpolateSplineXY/interpolateSplineXY.H
@@ -8,10 +8,10 @@
License
This file is part of OpenFOAM.
- OpenFOAM is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; either version 2 of the License, or (at your
- option) any later version.
+ OpenFOAM is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@@ -19,8 +19,7 @@ License
for more details.
You should have received a copy of the GNU General Public License
- along with OpenFOAM; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ along with OpenFOAM. If not, see .
InNamespace
Foam
diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files
index 2d1b6effb0..b3aad246a1 100644
--- a/src/finiteVolume/Make/files
+++ b/src/finiteVolume/Make/files
@@ -150,7 +150,7 @@ $(derivedFvPatchFields)/turbulentIntensityKineticEnergyInlet/turbulentIntensityK
$(derivedFvPatchFields)/uniformFixedValue/uniformFixedValueFvPatchFields.C
$(derivedFvPatchFields)/waveTransmissive/waveTransmissiveFvPatchFields.C
$(derivedFvPatchFields)/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.C
-$(derivedFvPatchFields)/swirlMassFlowRateInletVelocity/swirlMassFlowRateInletVelocityFvPatchVectorField.C
+$(derivedFvPatchFields)/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C
fvsPatchFields = fields/fvsPatchFields
$(fvsPatchFields)/fvsPatchField/fvsPatchFields.C
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C
index 489b82927f..a0684b9618 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C
@@ -118,9 +118,9 @@ void Foam::flowRateInletVelocityFvPatchVectorField::updateCoeffs()
}
// a simpler way of doing this would be nice
- scalar avgU = -flowRate_/gSum(patch().magSf());
+ const scalar avgU = -flowRate_/gSum(patch().magSf());
- vectorField n = patch().nf();
+ tmp n = patch().nf();
const surfaceScalarField& phi =
db().lookupObject(phiName_);
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.H
index f86fdbe29a..690c7160b0 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.H
+++ b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.H
@@ -37,9 +37,9 @@ Description
@verbatim
inlet
{
- type flowRateInletVelocity;
- flowRate 0.2; // Volumetric/mass flow rate [m3/s or kg/s]
- value uniform (0 0 0); // placeholder
+ type flowRateInletVelocity;
+ flowRate 0.2; // Volumetric/mass flow rate [m3/s or kg/s]
+ value uniform (0 0 0); // placeholder
}
@endverbatim
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/swirlMassFlowRateInletVelocity/swirlMassFlowRateInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C
similarity index 64%
rename from src/finiteVolume/fields/fvPatchFields/derived/swirlMassFlowRateInletVelocity/swirlMassFlowRateInletVelocityFvPatchVectorField.C
rename to src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C
index c08dbde495..7114dc1d26 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/swirlMassFlowRateInletVelocity/swirlMassFlowRateInletVelocityFvPatchVectorField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C
@@ -2,16 +2,16 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
- \\ / A nd | Copyright (C) 2006-2009 OpenCFD Ltd.
+ \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
- OpenFOAM is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; either version 2 of the License, or (at your
- option) any later version.
+ OpenFOAM is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@@ -19,12 +19,11 @@ License
for more details.
You should have received a copy of the GNU General Public License
- along with OpenFOAM; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ along with OpenFOAM. If not, see .
\*---------------------------------------------------------------------------*/
-#include "swirlMassFlowRateInletVelocityFvPatchVectorField.H"
+#include "swirlFlowRateInletVelocityFvPatchVectorField.H"
#include "volFields.H"
#include "addToRunTimeSelectionTable.H"
#include "fvPatchFieldMapper.H"
@@ -34,8 +33,8 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::
-swirlMassFlowRateInletVelocityFvPatchVectorField::
-swirlMassFlowRateInletVelocityFvPatchVectorField
+swirlFlowRateInletVelocityFvPatchVectorField::
+swirlFlowRateInletVelocityFvPatchVectorField
(
const fvPatch& p,
const DimensionedField& iF
@@ -50,10 +49,10 @@ swirlMassFlowRateInletVelocityFvPatchVectorField
Foam::
-swirlMassFlowRateInletVelocityFvPatchVectorField::
-swirlMassFlowRateInletVelocityFvPatchVectorField
+swirlFlowRateInletVelocityFvPatchVectorField::
+swirlFlowRateInletVelocityFvPatchVectorField
(
- const swirlMassFlowRateInletVelocityFvPatchVectorField& ptf,
+ const swirlFlowRateInletVelocityFvPatchVectorField& ptf,
const fvPatch& p,
const DimensionedField& iF,
const fvPatchFieldMapper& mapper
@@ -67,8 +66,8 @@ swirlMassFlowRateInletVelocityFvPatchVectorField
Foam::
-swirlMassFlowRateInletVelocityFvPatchVectorField::
-swirlMassFlowRateInletVelocityFvPatchVectorField
+swirlFlowRateInletVelocityFvPatchVectorField::
+swirlFlowRateInletVelocityFvPatchVectorField
(
const fvPatch& p,
const DimensionedField& iF,
@@ -84,10 +83,10 @@ swirlMassFlowRateInletVelocityFvPatchVectorField
Foam::
-swirlMassFlowRateInletVelocityFvPatchVectorField::
-swirlMassFlowRateInletVelocityFvPatchVectorField
+swirlFlowRateInletVelocityFvPatchVectorField::
+swirlFlowRateInletVelocityFvPatchVectorField
(
- const swirlMassFlowRateInletVelocityFvPatchVectorField& ptf
+ const swirlFlowRateInletVelocityFvPatchVectorField& ptf
)
:
fixedValueFvPatchField(ptf),
@@ -99,10 +98,10 @@ swirlMassFlowRateInletVelocityFvPatchVectorField
Foam::
-swirlMassFlowRateInletVelocityFvPatchVectorField::
-swirlMassFlowRateInletVelocityFvPatchVectorField
+swirlFlowRateInletVelocityFvPatchVectorField::
+swirlFlowRateInletVelocityFvPatchVectorField
(
- const swirlMassFlowRateInletVelocityFvPatchVectorField& ptf,
+ const swirlFlowRateInletVelocityFvPatchVectorField& ptf,
const DimensionedField& iF
)
:
@@ -116,25 +115,28 @@ swirlMassFlowRateInletVelocityFvPatchVectorField
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
-void Foam::swirlMassFlowRateInletVelocityFvPatchVectorField::updateCoeffs()
+void Foam::swirlFlowRateInletVelocityFvPatchVectorField::updateCoeffs()
{
if (updated())
{
return;
}
- scalar totArea = gSum(patch().magSf());
+ const scalar totArea = gSum(patch().magSf());
// a simpler way of doing this would be nice
- scalar avgU = -flowRate_/totArea;
+ const scalar avgU = -flowRate_/totArea;
- vector center = gSum(patch().Cf()*patch().magSf())/totArea;
- vector normal = gSum(patch().nf()*patch().magSf())/totArea;
+ const vector avgCenter = gSum(patch().Cf()*patch().magSf())/totArea;
+ const vector avgNormal = gSum(patch().Sf())/totArea;
- vectorField tangVelo =
+ // Update angular velocity - convert [rpm] to [rad/s]
+ vectorField tangentialVelocity =
+ (
(rpm_*constant::mathematical::pi/30.0)
- *(patch().Cf() - center) ^ normal;
+ * (patch().Cf() - avgCenter) ^ avgNormal
+ );
- vectorField n = patch().nf();
+ tmp n = patch().nf();
const surfaceScalarField& phi =
db().lookupObject(phiName_);
@@ -142,7 +144,7 @@ void Foam::swirlMassFlowRateInletVelocityFvPatchVectorField::updateCoeffs()
if (phi.dimensions() == dimVelocity*dimArea)
{
// volumetric flow-rate
- operator==(tangVelo + n*avgU);
+ operator==(tangentialVelocity + n*avgU);
}
else if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
{
@@ -150,13 +152,13 @@ void Foam::swirlMassFlowRateInletVelocityFvPatchVectorField::updateCoeffs()
patch().lookupPatchField(rhoName_);
// mass flow-rate
- operator==(tangVelo + n*avgU/rhop);
+ operator==(tangentialVelocity + n*avgU/rhop);
}
else
{
FatalErrorIn
(
- "swirlMassFlowRateInletVelocityFvPatchVectorField::updateCoeffs()"
+ "swirlFlowRateInletVelocityFvPatchVectorField::updateCoeffs()"
) << "dimensions of " << phiName_ << " are incorrect" << nl
<< " on patch " << this->patch().name()
<< " of field " << this->dimensionedInternalField().name()
@@ -168,18 +170,15 @@ void Foam::swirlMassFlowRateInletVelocityFvPatchVectorField::updateCoeffs()
}
-void Foam::swirlMassFlowRateInletVelocityFvPatchVectorField::write(Ostream& os) const
+void Foam::swirlFlowRateInletVelocityFvPatchVectorField::write
+(
+ Ostream& os
+) const
{
fvPatchField::write(os);
os.writeKeyword("flowRate") << flowRate_ << token::END_STATEMENT << nl;
- if (phiName_ != "phi")
- {
- os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl;
- }
- if (rhoName_ != "rho")
- {
- os.writeKeyword("rho") << rhoName_ << token::END_STATEMENT << nl;
- }
+ writeEntryIfDifferent(os, "phi", "phi", phiName_);
+ writeEntryIfDifferent(os, "rho", "rho", rhoName_);
os.writeKeyword("rpm") << rpm_ << token::END_STATEMENT << nl;
writeEntry("value", os);
}
@@ -192,7 +191,7 @@ namespace Foam
makePatchTypeField
(
fvPatchVectorField,
- swirlMassFlowRateInletVelocityFvPatchVectorField
+ swirlFlowRateInletVelocityFvPatchVectorField
);
}
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/swirlMassFlowRateInletVelocity/swirlMassFlowRateInletVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.H
similarity index 66%
rename from src/finiteVolume/fields/fvPatchFields/derived/swirlMassFlowRateInletVelocity/swirlMassFlowRateInletVelocityFvPatchVectorField.H
rename to src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.H
index bef41d4655..4576f39c6c 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/swirlMassFlowRateInletVelocity/swirlMassFlowRateInletVelocityFvPatchVectorField.H
+++ b/src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.H
@@ -8,10 +8,10 @@
License
This file is part of OpenFOAM.
- OpenFOAM is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; either version 2 of the License, or (at your
- option) any later version.
+ OpenFOAM is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@@ -19,15 +19,14 @@ License
for more details.
You should have received a copy of the GNU General Public License
- along with OpenFOAM; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ along with OpenFOAM. If not, see .
Class
- Foam::swirlMassFlowRateInletVelocityFvPatchVectorField
+ Foam::swirlFlowRateInletVelocityFvPatchVectorField
Description
Describes a volumetric/mass flow normal vector boundary condition by its
- magnitude as an integral over its area with a swirl component determined
+ magnitude as an integral over its area, with a swirl component determined
by the RPM
The basis of the patch (volumetric or mass) is determined by the
@@ -39,22 +38,30 @@ Description
@verbatim
inlet
{
- type swirlMassFlowRateInletVelocity;
- flowRate 0.2; // Volumetric/mass flow rate [m3/s or kg/s]
- rpm 100;
+ type swirlFlowRateInletVelocity;
+ flowRate 0.2; // Volumetric/mass flow rate [m3/s or kg/s]
+ rpm 100;
+ value uniform (0 0 0); // placeholder
}
@endverbatim
Note
- The value is positive inwards
+ - May not work correctly for transonic inlets
+ - Swirl is defined in RPM about the patch centre-axis according
+ to a right-hand rule (inwards axis).
+ - Primarily useful for planar patches.
+
+See Also
+ Foam::flowRateInletVelocityFvPatchVectorField
SourceFiles
- swirlMassFlowRateInletVelocityFvPatchVectorField.C
+ swirlFlowRateInletVelocityFvPatchVectorField.C
\*---------------------------------------------------------------------------*/
-#ifndef swirlMassFlowRateInletVelocityFvPatchVectorField_H
-#define swirlMassFlowRateInletVelocityFvPatchVectorField_H
+#ifndef swirlFlowRateInletVelocityFvPatchVectorField_H
+#define swirlFlowRateInletVelocityFvPatchVectorField_H
#include "fixedValueFvPatchFields.H"
@@ -63,10 +70,10 @@ SourceFiles
namespace Foam
{
/*---------------------------------------------------------------------------*\
- Class swirlMassFlowRateInletVelocityFvPatchVectorField Declaration
+ Class swirlFlowRateInletVelocityFvPatchVectorField Declaration
\*---------------------------------------------------------------------------*/
-class swirlMassFlowRateInletVelocityFvPatchVectorField
+class swirlFlowRateInletVelocityFvPatchVectorField
:
public fixedValueFvPatchVectorField
{
@@ -81,27 +88,27 @@ class swirlMassFlowRateInletVelocityFvPatchVectorField
//- Name of the density field used to normalize the mass flux
word rhoName_;
- //- RPM
+ //- Swirl rate [rpm]
scalar rpm_;
public:
//- Runtime type information
- TypeName("swirlMassFlowRateInletVelocity");
+ TypeName("swirlFlowRateInletVelocity");
// Constructors
//- Construct from patch and internal field
- swirlMassFlowRateInletVelocityFvPatchVectorField
+ swirlFlowRateInletVelocityFvPatchVectorField
(
const fvPatch&,
const DimensionedField&
);
//- Construct from patch, internal field and dictionary
- swirlMassFlowRateInletVelocityFvPatchVectorField
+ swirlFlowRateInletVelocityFvPatchVectorField
(
const fvPatch&,
const DimensionedField&,
@@ -111,18 +118,18 @@ public:
//- Construct by mapping given
// flowRateInletVelocityFvPatchVectorField
// onto a new patch
- swirlMassFlowRateInletVelocityFvPatchVectorField
+ swirlFlowRateInletVelocityFvPatchVectorField
(
- const swirlMassFlowRateInletVelocityFvPatchVectorField&,
+ const swirlFlowRateInletVelocityFvPatchVectorField&,
const fvPatch&,
const DimensionedField&,
const fvPatchFieldMapper&
);
//- Construct as copy
- swirlMassFlowRateInletVelocityFvPatchVectorField
+ swirlFlowRateInletVelocityFvPatchVectorField
(
- const swirlMassFlowRateInletVelocityFvPatchVectorField&
+ const swirlFlowRateInletVelocityFvPatchVectorField&
);
//- Construct and return a clone
@@ -130,14 +137,14 @@ public:
{
return tmp
(
- new swirlMassFlowRateInletVelocityFvPatchVectorField(*this)
+ new swirlFlowRateInletVelocityFvPatchVectorField(*this)
);
}
//- Construct as copy setting internal field reference
- swirlMassFlowRateInletVelocityFvPatchVectorField
+ swirlFlowRateInletVelocityFvPatchVectorField
(
- const swirlMassFlowRateInletVelocityFvPatchVectorField&,
+ const swirlFlowRateInletVelocityFvPatchVectorField&,
const DimensionedField&
);
@@ -149,7 +156,7 @@ public:
{
return tmp
(
- new swirlMassFlowRateInletVelocityFvPatchVectorField(*this, iF)
+ new swirlFlowRateInletVelocityFvPatchVectorField(*this, iF)
);
}
@@ -170,6 +177,18 @@ public:
return flowRate_;
}
+ //- Return the swirl rpm
+ scalar rpm() const
+ {
+ return rpm_;
+ }
+
+ //- Return reference to the swirl rpm to allow adjustment
+ scalar& rpm()
+ {
+ return rpm_;
+ }
+
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();