diff --git a/src/OpenFOAM/Make/files b/src/OpenFOAM/Make/files
index 192a2fbae3..3ed7092461 100644
--- a/src/OpenFOAM/Make/files
+++ b/src/OpenFOAM/Make/files
@@ -101,6 +101,7 @@ primitives/functions/Function1/squarePulse/squarePulse.C
primitives/functions/Function1/Table/tableBase.C
primitives/functions/Function1/Table/TableReader/makeTableReaders.C
primitives/functions/Function1/unknownTypeFunction1/unknownTypeFunction1.C
+primitives/functions/Function1/omega/omega.C
primitives/functions/Function2/makeFunction2s.C
diff --git a/src/OpenFOAM/primitives/functions/Function1/omega/omega.C b/src/OpenFOAM/primitives/functions/Function1/omega/omega.C
new file mode 100644
index 0000000000..0b80d846ee
--- /dev/null
+++ b/src/OpenFOAM/primitives/functions/Function1/omega/omega.C
@@ -0,0 +1,91 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Copyright (C) 2022 OpenFOAM Foundation
+ \\/ 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 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
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with OpenFOAM. If not, see .
+
+\*---------------------------------------------------------------------------*/
+
+#include "omega.H"
+#include "mathematicalConstants.H"
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+Foam::Function1s::omega::omega()
+:
+ rpm_(false),
+ omegaFactor_(1)
+{}
+
+
+Foam::Function1s::omega::omega(const dictionary& dict)
+:
+ rpm_(dict.found("rpm")),
+ omegaFactor_(rpm_ ? constant::mathematical::pi/30.0 : 1),
+ omega_
+ (
+ rpm_
+ ? Function1::New("rpm", dict)
+ : Function1::New("omega", dict)
+ )
+{}
+
+
+Foam::Function1s::omega::omega(const omega& o)
+:
+ rpm_(o.rpm_),
+ omegaFactor_(o.omegaFactor_),
+ omega_(o.omega_, false)
+{}
+
+
+// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+
+bool Foam::Function1s::omega::read(const dictionary& dict)
+{
+ rpm_ = dict.found("rpm");
+ omegaFactor_ = rpm_ ? constant::mathematical::pi/30.0 : 1;
+
+ omega_.reset
+ (
+ rpm_
+ ? Function1::New("rpm", dict).ptr()
+ : Function1::New("omega", dict).ptr()
+ );
+
+ return true;
+}
+
+
+void Foam::Function1s::omega::write(Ostream& os) const
+{
+ writeEntry(os, omega_());
+}
+
+
+// * * * * * * * * * * * * * * * IOstream Functions * * * * * * * * * * * * //
+
+void Foam::Function1s::writeEntry(Ostream& os, const omega& o)
+{
+ o.write(os);
+}
+
+
+// ************************************************************************* //
diff --git a/src/OpenFOAM/primitives/functions/Function1/omega/omega.H b/src/OpenFOAM/primitives/functions/Function1/omega/omega.H
new file mode 100644
index 0000000000..468a4f109d
--- /dev/null
+++ b/src/OpenFOAM/primitives/functions/Function1/omega/omega.H
@@ -0,0 +1,178 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Copyright (C) 2022 OpenFOAM Foundation
+ \\/ 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 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
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with OpenFOAM. If not, see .
+
+Class
+ Foam::Function1s::omega
+
+Description
+ User convenience class to handle the input of time-varying rotational speed
+ in rad/s if \c omega is specified or rpm if \c rpm is specified.
+
+Usage
+ For specifying the rotational speed in rpm of an MRF zone:
+ \verbatim
+ MRF
+ {
+ cellZone rotor;
+
+ origin (0 0 0);
+ axis (0 0 1);
+
+ rpm 60;
+ }
+ \endverbatim
+ or the equivalent specified in rad/s:
+ \verbatim
+ MRF
+ {
+ cellZone rotor;
+
+ origin (0 0 0);
+ axis (0 0 1);
+
+ rpm 6.28319;
+ }
+ \endverbatim
+ or for a tabulated ramped rotational speed of a solid body:
+ \verbatim
+ mover
+ {
+ type motionSolver;
+
+ libs ("libfvMeshMovers.so" "libfvMotionSolvers.so");
+
+ motionSolver solidBody;
+
+ cellZone innerCylinder;
+
+ solidBodyMotionFunction rotatingMotion;
+
+ origin (0 0 0);
+ axis (0 1 0);
+
+ rpm table
+ (
+ (0 0)
+ (0.01 6000)
+ (0.022 6000)
+ (0.03 4000)
+ (100 4000)
+ );
+ }
+ \endverbatim
+
+See also
+ Foam::Function1s
+
+SourceFiles
+ omega.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef omega_H
+#define omega_H
+
+#include "Function1.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+namespace Function1s
+{
+
+/*---------------------------------------------------------------------------*\
+ Class omega Declaration
+\*---------------------------------------------------------------------------*/
+
+class omega
+{
+ // Private Data
+
+ //- True if the input specification is rpm rather than omega
+ bool rpm_;
+
+ //- 1 for omega, pi/30 for rpm
+ scalar omegaFactor_;
+
+ //- The omega function
+ autoPtr> omega_;
+
+
+public:
+
+ // Constructors
+
+ //- Construct null
+ omega();
+
+ //- Construct from dictionary
+ omega(const dictionary& dict);
+
+ //- Copy constructor
+ omega(const omega&);
+
+
+ // Member Functions
+
+ //- Update omega function from given dictionary
+ bool read(const dictionary& dict);
+
+ //- Return value for time t
+ inline scalar value(const scalar t) const;
+
+ //- Return the integral between times t1 and t2
+ inline scalar integral
+ (
+ const scalar t1,
+ const scalar t2
+ ) const;
+
+ //- Write data to dictionary stream
+ void write(Ostream& os) const;
+
+
+ // Member Operators
+
+ //- Disallow default bitwise assignment
+ void operator=(const omega&) = delete;
+};
+
+
+void writeEntry(Ostream& os, const omega& a);
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Function1s
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#include "omegaI.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/OpenFOAM/primitives/functions/Function1/omega/omegaI.H b/src/OpenFOAM/primitives/functions/Function1/omega/omegaI.H
new file mode 100644
index 0000000000..b60f407d41
--- /dev/null
+++ b/src/OpenFOAM/primitives/functions/Function1/omega/omegaI.H
@@ -0,0 +1,44 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Copyright (C) 2022 OpenFOAM Foundation
+ \\/ 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 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
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with OpenFOAM. If not, see .
+
+\*---------------------------------------------------------------------------*/
+
+// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+
+inline Foam::scalar Foam::Function1s::omega::value(const scalar t) const
+{
+ return omegaFactor_*omega_->value(t);
+}
+
+
+inline Foam::scalar Foam::Function1s::omega::integral
+(
+ const scalar t1,
+ const scalar t2
+) const
+{
+ return omegaFactor_*omega_->integral(t1, t2);
+}
+
+
+// ************************************************************************* //
diff --git a/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/rotatingMotion/rotatingMotion.C b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/rotatingMotion/rotatingMotion.C
index 77d0b260fb..dc6f1d4ef7 100644
--- a/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/rotatingMotion/rotatingMotion.C
+++ b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/rotatingMotion/rotatingMotion.C
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
- \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
+ \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@@ -57,7 +57,7 @@ Foam::solidBodyMotionFunctions::rotatingMotion::rotatingMotion
solidBodyMotionFunction(SBMFCoeffs, runTime),
origin_(SBMFCoeffs_.lookup("origin")),
axis_(SBMFCoeffs_.lookup("axis")),
- omega_(Function1::New("omega", SBMFCoeffs_))
+ omega_(SBMFCoeffs_)
{}
@@ -72,13 +72,13 @@ Foam::solidBodyMotionFunctions::rotatingMotion::~rotatingMotion()
Foam::septernion
Foam::solidBodyMotionFunctions::rotatingMotion::transformation() const
{
- scalar t = time_.value();
+ const scalar t = time_.value();
// Rotation around axis
- scalar angle = omega_->integral(0, t);
+ const scalar angle = omega_.integral(0, t);
- quaternion R(axis_, angle);
- septernion TR(septernion(-origin_)*R*septernion(origin_));
+ const quaternion R(axis_, angle);
+ const septernion TR(septernion(-origin_)*R*septernion(origin_));
DebugInFunction << "Time = " << t << " transformation: " << TR << endl;
@@ -93,10 +93,7 @@ bool Foam::solidBodyMotionFunctions::rotatingMotion::read
{
solidBodyMotionFunction::read(SBMFCoeffs);
- omega_.reset
- (
- Function1::New("omega", SBMFCoeffs_).ptr()
- );
+ omega_.read(SBMFCoeffs);
return true;
}
diff --git a/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/rotatingMotion/rotatingMotion.H b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/rotatingMotion/rotatingMotion.H
index 0d4c853ecb..205454e1c6 100644
--- a/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/rotatingMotion/rotatingMotion.H
+++ b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/rotatingMotion/rotatingMotion.H
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
- \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
+ \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@@ -40,9 +40,7 @@ SourceFiles
#include "solidBodyMotionFunction.H"
#include "primitiveFields.H"
-#include "point.H"
-#include "Function1.H"
-#include "autoPtr.H"
+#include "omega.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -68,7 +66,7 @@ class rotatingMotion
const vector axis_;
//- Angular velocity (rad/sec)
- autoPtr> omega_;
+ Function1s::omega omega_;
public:
diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZone.C b/src/finiteVolume/cfdTools/general/MRF/MRFZone.C
index 29b1c82e1b..6b04123969 100644
--- a/src/finiteVolume/cfdTools/general/MRF/MRFZone.C
+++ b/src/finiteVolume/cfdTools/general/MRF/MRFZone.C
@@ -29,7 +29,6 @@ License
#include "volFields.H"
#include "fvMatrices.H"
#include "geometricOneField.H"
-#include "Scale.H"
#include "faceSet.H"
#include "syncTools.H"
@@ -226,25 +225,7 @@ Foam::MRFZone::MRFZone
cellSet_(mesh, coeffs_, fvCellSet::selectionModeType::cellZone),
origin_(coeffs_.lookup("origin")),
axis_(coeffs_.lookup("axis")),
- omega_
- (
- coeffs_.found("omega")
- ? Function1::New("omega", coeffs_)
- : autoPtr>
- (
- new Function1s::Scale
- (
- "omega",
- Function1s::Constant
- (
- "piby30",
- constant::mathematical::pi/30.0
- ),
- Function1s::Constant("1", 1),
- Function1::New("rpm", coeffs_)()
- )
- )
- )
+ omega_(coeffs_)
{
axis_ = axis_/mag(axis_);
setMRFFaces();
@@ -255,7 +236,7 @@ Foam::MRFZone::MRFZone
Foam::vector Foam::MRFZone::Omega() const
{
- return omega_->value(mesh_.time().userTimeValue())*axis_;
+ return omega_.value(mesh_.time().userTimeValue())*axis_;
}
diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZone.H b/src/finiteVolume/cfdTools/general/MRF/MRFZone.H
index de84707771..ab5399cf76 100644
--- a/src/finiteVolume/cfdTools/general/MRF/MRFZone.H
+++ b/src/finiteVolume/cfdTools/general/MRF/MRFZone.H
@@ -42,7 +42,7 @@ SourceFiles
#include "fvCellSet.H"
#include "volFieldsFwd.H"
#include "surfaceFields.H"
-#include "Function1.H"
+#include "omega.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -82,7 +82,7 @@ class MRFZone
vector axis_;
//- Angular velocity (rad/sec or rpm)
- autoPtr> omega_;
+ Function1s::omega omega_;
// Private Member Functions
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.C
index f9d11cf46e..b953482605 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.C
@@ -24,9 +24,9 @@ License
\*---------------------------------------------------------------------------*/
#include "rotatingPressureInletOutletVelocityFvPatchVectorField.H"
-#include "addToRunTimeSelectionTable.H"
#include "volFields.H"
#include "surfaceFields.H"
+#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@@ -34,7 +34,7 @@ void Foam::rotatingPressureInletOutletVelocityFvPatchVectorField::
calcTangentialVelocity()
{
const scalar t = this->db().time().userTimeValue();
- const scalar omega = omega_->value(t);
+ const scalar omega = omega_.value(t);
const vectorField tangentialVelocity
(
@@ -58,8 +58,7 @@ rotatingPressureInletOutletVelocityFvPatchVectorField
:
pressureInletOutletVelocityFvPatchVectorField(p, iF),
origin_(),
- axis_(Zero),
- omega_()
+ axis_(Zero)
{}
@@ -74,7 +73,7 @@ rotatingPressureInletOutletVelocityFvPatchVectorField
pressureInletOutletVelocityFvPatchVectorField(p, iF, dict),
origin_(dict.lookup("origin")),
axis_(dict.lookup("axis")),
- omega_(Function1::New("omega", dict))
+ omega_(dict)
{
calcTangentialVelocity();
}
@@ -92,7 +91,7 @@ rotatingPressureInletOutletVelocityFvPatchVectorField
pressureInletOutletVelocityFvPatchVectorField(pvf, p, iF, mapper),
origin_(pvf.origin_),
axis_(pvf.axis_),
- omega_(pvf.omega_, false)
+ omega_(pvf.omega_)
{
calcTangentialVelocity();
}
@@ -108,7 +107,7 @@ rotatingPressureInletOutletVelocityFvPatchVectorField
pressureInletOutletVelocityFvPatchVectorField(pvf, iF),
origin_(pvf.origin_),
axis_(pvf.axis_),
- omega_(pvf.omega_, false)
+ omega_(pvf.omega_)
{
calcTangentialVelocity();
}
@@ -125,7 +124,7 @@ void Foam::rotatingPressureInletOutletVelocityFvPatchVectorField::write
writeEntry(os, "phi", phiName());
writeEntry(os, "origin", origin_);
writeEntry(os, "axis", axis_);
- writeEntry(os, omega_());
+ writeEntry(os, omega_);
writeEntry(os, "value", *this);
}
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.H
index 4691a971ec..01673d5d73 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.H
+++ b/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.H
@@ -37,7 +37,8 @@ Usage
tangentialVelocity | tangential velocity field | no |
origin | origin of rotation in Cartesian co-ordinates | yes|
axis | axis of rotation | yes |
- omega | angular velocity of the frame [rad/s] | yes |
+ omega | angular velocity of the frame [rad/s] | no |
+ rpm | angular velocity of the frame [rpm] | no |
\endtable
Example of the boundary condition specification:
@@ -49,12 +50,11 @@ Usage
tangentialVelocity uniform (0 0 0);
origin (0 0 0);
axis (0 0 1);
- omega 100;
+ rpm 100;
}
\endverbatim
- The \c omega entry is a Function1 type, able to describe time varying
- functions.
+ The \c omega or \c rpm entries are Function1 of time, see Foam::Function1s.
Note:
Sign conventions:
@@ -76,7 +76,7 @@ SourceFiles
#include "fvPatchFields.H"
#include "pressureInletOutletVelocityFvPatchVectorField.H"
-#include "Function1.H"
+#include "omega.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -99,8 +99,8 @@ class rotatingPressureInletOutletVelocityFvPatchVectorField
//- Axis of the rotation
vector axis_;
- //- Angular velocity of the frame
- autoPtr> omega_;
+ //- Angular velocity of the frame (rad/sec)
+ Function1s::omega omega_;
// Private Member Functions
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/rotatingTotalPressure/rotatingTotalPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/rotatingTotalPressure/rotatingTotalPressureFvPatchScalarField.C
index 333c109b77..37bac5c639 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/rotatingTotalPressure/rotatingTotalPressureFvPatchScalarField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/rotatingTotalPressure/rotatingTotalPressureFvPatchScalarField.C
@@ -40,8 +40,7 @@ rotatingTotalPressureFvPatchScalarField
:
totalPressureFvPatchScalarField(p, iF),
origin_(),
- axis_(Zero),
- omega_()
+ axis_(Zero)
{}
@@ -56,7 +55,7 @@ rotatingTotalPressureFvPatchScalarField
totalPressureFvPatchScalarField(p, iF, dict),
origin_(dict.lookup("origin")),
axis_(dict.lookup("axis")),
- omega_(Function1::New("omega", dict))
+ omega_(dict)
{}
@@ -72,7 +71,7 @@ rotatingTotalPressureFvPatchScalarField
totalPressureFvPatchScalarField(psf, p, iF, mapper),
origin_(psf.origin_),
axis_(psf.axis_),
- omega_(psf.omega_, false)
+ omega_(psf.omega_)
{}
@@ -86,7 +85,7 @@ rotatingTotalPressureFvPatchScalarField
totalPressureFvPatchScalarField(psf, iF),
origin_(psf.origin_),
axis_(psf.axis_),
- omega_(psf.omega_, false)
+ omega_(psf.omega_)
{}
@@ -100,7 +99,7 @@ void Foam::rotatingTotalPressureFvPatchScalarField::updateCoeffs()
}
const scalar t = this->db().time().userTimeValue();
- const scalar omega = omega_->value(t);
+ const scalar omega = omega_.value(t);
const fvsPatchField& phip =
patch().lookupPatchField(phiName_);
@@ -124,7 +123,7 @@ void Foam::rotatingTotalPressureFvPatchScalarField::write(Ostream& os) const
totalPressureFvPatchScalarField::write(os);
writeEntry(os, "origin", origin_);
writeEntry(os, "axis", axis_);
- writeEntry(os, omega_());
+ writeEntry(os, omega_);
}
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/rotatingTotalPressure/rotatingTotalPressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/rotatingTotalPressure/rotatingTotalPressureFvPatchScalarField.H
index 84a95a9360..388d0224d6 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/rotatingTotalPressure/rotatingTotalPressureFvPatchScalarField.H
+++ b/src/finiteVolume/fields/fvPatchFields/derived/rotatingTotalPressure/rotatingTotalPressureFvPatchScalarField.H
@@ -39,7 +39,8 @@ Usage
p0 | static pressure reference | yes |
origin | origin of rotation in Cartesian co-ordinates | yes|
axis | axis of rotation | yes |
- omega | angular velocity of the frame [rad/s] | yes |
+ omega | angular velocity of the frame [rad/s] | no |
+ rpm | angular velocity of the frame [rpm] | no |
\endtable
Example of the boundary condition specification:
@@ -55,12 +56,11 @@ Usage
p0 uniform 1e5;
origin (0 0 0);
axis (0 0 1);
- omega 100;
+ rpm 100;
}
\endverbatim
- The \c omega entry is a Function1 type, able to describe time varying
- functions.
+ The \c omega or \c rpm entries are Function1 of time, see Foam::Function1s.
See also
Foam::totalPressureFvPatchScalarField
@@ -75,7 +75,7 @@ SourceFiles
#define rotatingTotalPressureFvPatchScalarField_H
#include "totalPressureFvPatchScalarField.H"
-#include "Function1.H"
+#include "omega.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -98,8 +98,8 @@ class rotatingTotalPressureFvPatchScalarField
//- Axis of the rotation
vector axis_;
- //- Angular velocity of the frame
- const autoPtr> omega_;
+ //- Angular velocity of the frame (rad/sec)
+ Function1s::omega omega_;
public:
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C
index 924c1f9a4d..5e33a8d8c6 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C
@@ -39,8 +39,7 @@ rotatingWallVelocityFvPatchVectorField
:
fixedValueFvPatchField(p, iF),
origin_(),
- axis_(Zero),
- omega_(0)
+ axis_(Zero)
{}
@@ -55,7 +54,7 @@ rotatingWallVelocityFvPatchVectorField
fixedValueFvPatchField(p, iF, dict, false),
origin_(dict.lookup("origin")),
axis_(dict.lookup("axis")),
- omega_(Function1::New("omega", dict))
+ omega_(dict)
{
if (dict.found("value"))
{
@@ -84,7 +83,7 @@ rotatingWallVelocityFvPatchVectorField
fixedValueFvPatchField(pvf, p, iF, mapper),
origin_(pvf.origin_),
axis_(pvf.axis_),
- omega_(pvf.omega_, false)
+ omega_(pvf.omega_)
{}
@@ -98,7 +97,7 @@ rotatingWallVelocityFvPatchVectorField
fixedValueFvPatchField(pvf, iF),
origin_(pvf.origin_),
axis_(pvf.axis_),
- omega_(pvf.omega_, false)
+ omega_(pvf.omega_)
{}
@@ -112,7 +111,7 @@ void Foam::rotatingWallVelocityFvPatchVectorField::updateCoeffs()
}
const scalar t = this->db().time().userTimeValue();
- const scalar omega = omega_->value(t);
+ const scalar omega = omega_.value(t);
// Calculate the rotating wall velocity from the specification of the motion
const vectorField Up
@@ -134,7 +133,7 @@ void Foam::rotatingWallVelocityFvPatchVectorField::write(Ostream& os) const
fvPatchVectorField::write(os);
writeEntry(os, "origin", origin_);
writeEntry(os, "axis", axis_);
- writeEntry(os, omega_());
+ writeEntry(os, omega_);
writeEntry(os, "value", *this);
}
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.H
index ee2cbff1ee..03bf37c576 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.H
+++ b/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.H
@@ -35,7 +35,8 @@ Usage
Property | Description | Required | Default value
origin | origin of rotation in Cartesian co-ordinates | yes|
axis | axis of rotation | yes |
- omega | angular velocity of the frame [rad/s] | yes |
+ omega | angular velocity of the frame [rad/s] | no |
+ rpm | angular velocity of the frame [rpm] | no |
\endtable
Example of the boundary condition specification:
@@ -45,11 +46,11 @@ Usage
type rotatingWallVelocity;
origin (0 0 0);
axis (0 0 1);
- omega 100;
+ rpm 100;
}
\endverbatim
- The \c omega entry is a Function1 of time, see Foam::Function1s.
+ The \c omega or \c rpm entries are Function1 of time, see Foam::Function1s.
See also
Foam::fixedValueFvPatchField
@@ -64,7 +65,7 @@ SourceFiles
#define rotatingWallVelocityFvPatchVectorField_H
#include "fixedValueFvPatchFields.H"
-#include "Function1.H"
+#include "omega.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -88,7 +89,7 @@ class rotatingWallVelocityFvPatchVectorField
vector axis_;
//- Rotational speed
- autoPtr> omega_;
+ Function1s::omega omega_;
public:
diff --git a/tutorials/lagrangian/particleFoam/mixerVessel2D/constant/dynamicMeshDict b/tutorials/lagrangian/particleFoam/mixerVessel2D/constant/dynamicMeshDict
index dc77e9cc32..283577048d 100644
--- a/tutorials/lagrangian/particleFoam/mixerVessel2D/constant/dynamicMeshDict
+++ b/tutorials/lagrangian/particleFoam/mixerVessel2D/constant/dynamicMeshDict
@@ -34,7 +34,8 @@ mover
origin (0 0 0);
axis (0 0 1);
- omega 6.2832; // rad/s
+
+ rpm 60;
}
stator
@@ -47,7 +48,8 @@ mover
origin (0 0 0);
axis (0 0 -1);
- omega 6.2832; // rad/s
+
+ rpm 60;
}
};
}
diff --git a/tutorials/modules/incompressibleFluid/impeller/constant/dynamicMeshDict b/tutorials/modules/incompressibleFluid/impeller/constant/dynamicMeshDict
index 952fda1671..5b1354caf0 100644
--- a/tutorials/modules/incompressibleFluid/impeller/constant/dynamicMeshDict
+++ b/tutorials/modules/incompressibleFluid/impeller/constant/dynamicMeshDict
@@ -28,7 +28,8 @@ mover
origin (0 0 0);
axis (1 0 0);
- omega 6.2832;
+
+ rpm 60;
}
diff --git a/tutorials/modules/incompressibleFluid/propeller/constant/dynamicMeshDict b/tutorials/modules/incompressibleFluid/propeller/constant/dynamicMeshDict
index af46ba7ab7..272b447faf 100644
--- a/tutorials/modules/incompressibleFluid/propeller/constant/dynamicMeshDict
+++ b/tutorials/modules/incompressibleFluid/propeller/constant/dynamicMeshDict
@@ -28,7 +28,8 @@ mover
origin (0 0 0);
axis (0 1 0);
- omega 158; // rad/s
+
+ rpm 1500;
}
diff --git a/tutorials/modules/incompressibleFluid/rotor2DRotating/constant/dynamicMeshDict b/tutorials/modules/incompressibleFluid/rotor2DRotating/constant/dynamicMeshDict
index 572f202a53..aa71d8bc95 100644
--- a/tutorials/modules/incompressibleFluid/rotor2DRotating/constant/dynamicMeshDict
+++ b/tutorials/modules/incompressibleFluid/rotor2DRotating/constant/dynamicMeshDict
@@ -26,7 +26,8 @@ mover
origin (0 0 0);
axis (0 0 1);
- omega 6.2832; // rad/s
+
+ rpm 60;
}
diff --git a/tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/0/U b/tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/0/U
index 9d728aeec4..7d67152792 100644
--- a/tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/0/U
+++ b/tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/0/U
@@ -25,9 +25,10 @@ boundaryField
type rotatingWallVelocity;
axis (0 1 0);
origin (0 0 0);
- omega constant 13.2; // 2.1 rev/s
+ rpm 126;
value uniform (0 0 0);
}
+
vessel
{
type noSlip;
diff --git a/tutorials/multiphase/interFoam/RAS/mixerVessel/0/U b/tutorials/multiphase/interFoam/RAS/mixerVessel/0/U
index 72bb5d5cbc..604b88ebbd 100644
--- a/tutorials/multiphase/interFoam/RAS/mixerVessel/0/U
+++ b/tutorials/multiphase/interFoam/RAS/mixerVessel/0/U
@@ -50,7 +50,7 @@ boundaryField
type rotatingWallVelocity;
origin (0 0 0);
axis (0 0 1);
- omega constant -5;
+ rpm -50;
value $internalField;
}
diff --git a/tutorials/multiphase/interFoam/RAS/mixerVessel/constant/dynamicMeshDict b/tutorials/multiphase/interFoam/RAS/mixerVessel/constant/dynamicMeshDict
index 3caa2616d2..7ebc17b241 100644
--- a/tutorials/multiphase/interFoam/RAS/mixerVessel/constant/dynamicMeshDict
+++ b/tutorials/multiphase/interFoam/RAS/mixerVessel/constant/dynamicMeshDict
@@ -28,7 +28,8 @@ mover
origin (0 0 0);
axis (0 0 1);
- omega -5; // 5 rad/s
+
+ rpm -50;
}
diff --git a/tutorials/multiphase/interFoam/RAS/propeller/constant/dynamicMeshDict b/tutorials/multiphase/interFoam/RAS/propeller/constant/dynamicMeshDict
index b7b2540122..911a7c69af 100644
--- a/tutorials/multiphase/interFoam/RAS/propeller/constant/dynamicMeshDict
+++ b/tutorials/multiphase/interFoam/RAS/propeller/constant/dynamicMeshDict
@@ -28,13 +28,14 @@ mover
origin (0 0 0);
axis (0 1 0);
- omega table
+
+ rpm table
(
(0 0)
- (0.01 628)
- (0.022 628)
- (0.03 419)
- (100 419)
+ (0.01 6000)
+ (0.022 6000)
+ (0.03 4000)
+ (100 4000)
);
}
diff --git a/tutorials/multiphase/interFoam/laminar/climbingRod/0/U b/tutorials/multiphase/interFoam/laminar/climbingRod/0/U
index 9d728aeec4..b7a1f4ee1a 100644
--- a/tutorials/multiphase/interFoam/laminar/climbingRod/0/U
+++ b/tutorials/multiphase/interFoam/laminar/climbingRod/0/U
@@ -25,7 +25,7 @@ boundaryField
type rotatingWallVelocity;
axis (0 1 0);
origin (0 0 0);
- omega constant 13.2; // 2.1 rev/s
+ rpm 126;
value uniform (0 0 0);
}
vessel
diff --git a/tutorials/multiphase/interFoam/laminar/mixerVessel2D/constant/dynamicMeshDict b/tutorials/multiphase/interFoam/laminar/mixerVessel2D/constant/dynamicMeshDict
index dc77e9cc32..283577048d 100644
--- a/tutorials/multiphase/interFoam/laminar/mixerVessel2D/constant/dynamicMeshDict
+++ b/tutorials/multiphase/interFoam/laminar/mixerVessel2D/constant/dynamicMeshDict
@@ -34,7 +34,8 @@ mover
origin (0 0 0);
axis (0 0 1);
- omega 6.2832; // rad/s
+
+ rpm 60;
}
stator
@@ -47,7 +48,8 @@ mover
origin (0 0 0);
axis (0 0 -1);
- omega 6.2832; // rad/s
+
+ rpm 60;
}
};
}
diff --git a/tutorials/multiphase/interFoam/laminar/sloshingCylinder/constant/dynamicMeshDict b/tutorials/multiphase/interFoam/laminar/sloshingCylinder/constant/dynamicMeshDict
index cc2b8231a4..13a6b92908 100644
--- a/tutorials/multiphase/interFoam/laminar/sloshingCylinder/constant/dynamicMeshDict
+++ b/tutorials/multiphase/interFoam/laminar/sloshingCylinder/constant/dynamicMeshDict
@@ -41,7 +41,7 @@ mover
{
origin (0 0.02 0);
axis (0 0 1);
- omega 18.8945578;
+ rpm 180;
}
}
}
diff --git a/tutorials/multiphase/interFoam/laminar/testTubeMixer/constant/dynamicMeshDict b/tutorials/multiphase/interFoam/laminar/testTubeMixer/constant/dynamicMeshDict
index 8025344ad2..4aa1d4d177 100644
--- a/tutorials/multiphase/interFoam/laminar/testTubeMixer/constant/dynamicMeshDict
+++ b/tutorials/multiphase/interFoam/laminar/testTubeMixer/constant/dynamicMeshDict
@@ -32,22 +32,10 @@ mover
{
origin (0 0.1 0);
axis (0 0 1);
- omega 6.2832; // rad/s
+ rpm 60;
}
}
- //// Box rotates on rotating table
- //rotatingBox
- //{
- // solidBodyMotionFunction rotatingMotion;
- // rotatingMotionCoeffs
- // {
- // origin (0 0 0);
- // axis (1 0 0);
- // omega 12.5664; // rad/s
- // }
- //}
-
// Tube rocking on rotating table
rotatingBox
{
@@ -55,8 +43,8 @@ mover
oscillatingRotatingMotionCoeffs
{
origin (0 0 0);
- omega 40; // rad/s
amplitude (45 0 0); // 45 degrees max tilt
+ omega 40; // rad/s
}
}
}
diff --git a/tutorials/multiphase/multiphaseEulerFoam/laminar/mixerVessel2D/constant/dynamicMeshDict b/tutorials/multiphase/multiphaseEulerFoam/laminar/mixerVessel2D/constant/dynamicMeshDict
index 14d80b3ad7..55c31c7405 100644
--- a/tutorials/multiphase/multiphaseEulerFoam/laminar/mixerVessel2D/constant/dynamicMeshDict
+++ b/tutorials/multiphase/multiphaseEulerFoam/laminar/mixerVessel2D/constant/dynamicMeshDict
@@ -28,7 +28,8 @@ mover
origin (0 0 0);
axis (0 0 1);
- omega 6.2832; // rad/s
+
+ rpm 60;
}