mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Introduced the new file unitConversion.H to hold degToRad, radToDeg
and other unit conversion functions as they are required e.g. slug <-> kg.
This commit is contained in:
@ -53,7 +53,7 @@ Description
|
||||
#include "removePoints.H"
|
||||
#include "polyMesh.H"
|
||||
#include "mapPolyMesh.H"
|
||||
#include "mathematicalConstants.H"
|
||||
#include "unitConversion.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
|
||||
@ -49,7 +49,7 @@ Description
|
||||
#include "cellSet.H"
|
||||
#include "cellModeller.H"
|
||||
#include "meshCutter.H"
|
||||
#include "mathematicalConstants.H"
|
||||
#include "unitConversion.H"
|
||||
#include "geomCellLooper.H"
|
||||
#include "plane.H"
|
||||
#include "edgeVertex.H"
|
||||
|
||||
@ -43,7 +43,7 @@ Description
|
||||
#include "symmetryPolyPatch.H"
|
||||
#include "wedgePolyPatch.H"
|
||||
#include "cyclicPolyPatch.H"
|
||||
#include "mathematicalConstants.H"
|
||||
#include "unitConversion.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
|
||||
@ -59,7 +59,7 @@ Usage
|
||||
#include "Time.H"
|
||||
#include "timeSelector.H"
|
||||
#include "fvMesh.H"
|
||||
#include "mathematicalConstants.H"
|
||||
#include "unitConversion.H"
|
||||
#include "polyTopoChange.H"
|
||||
#include "mapPolyMesh.H"
|
||||
#include "PackedBoolList.H"
|
||||
|
||||
@ -33,7 +33,7 @@ Description
|
||||
#include "IOmanip.H"
|
||||
#include "boundBox.H"
|
||||
#include "Map.H"
|
||||
#include "mathematicalConstants.H"
|
||||
#include "unitConversion.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ License
|
||||
|
||||
#include "wedge.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "mathematicalConstants.H"
|
||||
#include "unitConversion.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -33,7 +33,7 @@ Description
|
||||
#include "Time.H"
|
||||
#include "boundaryMesh.H"
|
||||
#include "repatchPolyTopoChanger.H"
|
||||
#include "mathematicalConstants.H"
|
||||
#include "unitConversion.H"
|
||||
#include "OFstream.H"
|
||||
#include "ListOps.H"
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ Namespace
|
||||
Foam::constant::mathematical
|
||||
|
||||
Description
|
||||
mathematical constants and conversion functions
|
||||
mathematical constants.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -60,20 +60,6 @@ namespace mathematical
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
//- Conversion from degrees to radians
|
||||
inline scalar degToRad(const scalar& deg)
|
||||
{
|
||||
return (deg*constant::mathematical::pi/180.0);
|
||||
}
|
||||
|
||||
//- Conversion from radians to degrees
|
||||
inline scalar radToDeg(const scalar& rad)
|
||||
{
|
||||
return (rad*180.0/constant::mathematical::pi);
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
67
src/OpenFOAM/global/unitConversion/unitConversion.H
Normal file
67
src/OpenFOAM/global/unitConversion/unitConversion.H
Normal file
@ -0,0 +1,67 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2009-2009 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 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Namespace
|
||||
Foam
|
||||
|
||||
Description
|
||||
Unit conversion functions
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef unitConversion_H
|
||||
#define unitConversion_H
|
||||
|
||||
#include "mathematicalConstants.H"
|
||||
|
||||
using namespace Foam::constant::mathematical;
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
//- Conversion from degrees to radians
|
||||
inline scalar degToRad(const scalar& deg)
|
||||
{
|
||||
return (deg*pi/180.0);
|
||||
}
|
||||
|
||||
//- Conversion from radians to degrees
|
||||
inline scalar radToDeg(const scalar& rad)
|
||||
{
|
||||
return (rad*180.0/pi);
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -27,7 +27,7 @@ License
|
||||
#include "primitiveMesh.H"
|
||||
#include "pyramidPointFaceRef.H"
|
||||
#include "ListOps.H"
|
||||
#include "mathematicalConstants.H"
|
||||
#include "unitConversion.H"
|
||||
#include "SortableList.H"
|
||||
|
||||
|
||||
|
||||
@ -31,10 +31,7 @@ Description
|
||||
#include "primitiveMesh.H"
|
||||
#include "pyramidPointFaceRef.H"
|
||||
#include "cell.H"
|
||||
#include "mathematicalConstants.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "unitConversion.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -27,7 +27,7 @@ License
|
||||
#include "topoCellLooper.H"
|
||||
#include "cellFeatures.H"
|
||||
#include "polyMesh.H"
|
||||
#include "mathematicalConstants.H"
|
||||
#include "unitConversion.H"
|
||||
#include "DynamicList.H"
|
||||
#include "ListOps.H"
|
||||
#include "meshTools.H"
|
||||
|
||||
@ -32,7 +32,7 @@ License
|
||||
#include "cellCuts.H"
|
||||
#include "splitCell.H"
|
||||
#include "mapPolyMesh.H"
|
||||
#include "mathematicalConstants.H"
|
||||
#include "unitConversion.H"
|
||||
#include "meshTools.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -27,7 +27,7 @@ License
|
||||
#include "polyMeshGeometry.H"
|
||||
#include "pyramidPointFaceRef.H"
|
||||
#include "syncTools.H"
|
||||
#include "mathematicalConstants.H"
|
||||
#include "unitConversion.H"
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
@ -25,7 +25,7 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "engineTime.H"
|
||||
#include "mathematicalConstants.H"
|
||||
#include "unitConversion.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@ Description
|
||||
#include "surfaceFields.H"
|
||||
#include "demandDrivenData.H"
|
||||
#include "coupledFvPatch.H"
|
||||
#include "mathematicalConstants.H"
|
||||
#include "unitConversion.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -27,7 +27,7 @@ License
|
||||
#include "multiHoleInjector.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "Random.H"
|
||||
#include "mathematicalConstants.H"
|
||||
#include "unitConversion.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
namespace Foam
|
||||
|
||||
@ -41,7 +41,7 @@ License
|
||||
#include "symmetryPolyPatch.H"
|
||||
#include "wedgePolyPatch.H"
|
||||
|
||||
#include "mathematicalConstants.H"
|
||||
#include "unitConversion.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ License
|
||||
|
||||
#include "blobsSwirlInjector.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "mathematicalConstants.H"
|
||||
#include "unitConversion.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -34,7 +34,7 @@ Description
|
||||
#include "removePoints.H"
|
||||
#include "pointFields.H"
|
||||
#include "motionSmoother.H"
|
||||
#include "mathematicalConstants.H"
|
||||
#include "unitConversion.H"
|
||||
#include "pointSet.H"
|
||||
#include "faceSet.H"
|
||||
#include "cellSet.H"
|
||||
|
||||
@ -35,6 +35,7 @@ License
|
||||
#include "refinementSurfaces.H"
|
||||
#include "shellSurfaces.H"
|
||||
#include "mapDistributePolyMesh.H"
|
||||
#include "unitConversion.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ License
|
||||
|
||||
#include "layerParameters.H"
|
||||
#include "polyBoundaryMesh.H"
|
||||
#include "mathematicalConstants.H"
|
||||
#include "unitConversion.H"
|
||||
#include "refinementSurfaces.H"
|
||||
#include "searchableSurfaces.H"
|
||||
#include "regExp.H"
|
||||
|
||||
@ -25,7 +25,7 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "refinementParameters.H"
|
||||
#include "mathematicalConstants.H"
|
||||
#include "unitConversion.H"
|
||||
#include "polyMesh.H"
|
||||
#include "globalIndex.H"
|
||||
|
||||
|
||||
@ -37,7 +37,7 @@ License
|
||||
#include "searchableSurfaces.H"
|
||||
#include "polyMeshGeometry.H"
|
||||
#include "IOmanip.H"
|
||||
#include "mathematicalConstants.H"
|
||||
#include "unitConversion.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -25,7 +25,7 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "arcEdge.H"
|
||||
#include "mathematicalConstants.H"
|
||||
#include "unitConversion.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -26,11 +26,10 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "cellQuality.H"
|
||||
#include "mathematicalConstants.H"
|
||||
#include "unitConversion.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
// Construct from mesh
|
||||
Foam::cellQuality::cellQuality(const polyMesh& mesh)
|
||||
:
|
||||
mesh_(mesh)
|
||||
|
||||
@ -26,7 +26,7 @@ License
|
||||
|
||||
#include "toroidalCS.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "mathematicalConstants.H"
|
||||
#include "unitConversion.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ License
|
||||
|
||||
#include "primitiveMeshGeometry.H"
|
||||
#include "pyramidPointFaceRef.H"
|
||||
#include "mathematicalConstants.H"
|
||||
#include "unitConversion.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ License
|
||||
|
||||
#include "shapeToCell.H"
|
||||
#include "polyMesh.H"
|
||||
#include "mathematicalConstants.H"
|
||||
#include "unitConversion.H"
|
||||
#include "hexMatcher.H"
|
||||
#include "cellFeatures.H"
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@ License
|
||||
#include "meshTools.H"
|
||||
#include "plane.H"
|
||||
#include "Random.H"
|
||||
#include "mathematicalConstants.H"
|
||||
#include "unitConversion.H"
|
||||
#include "treeBoundBox.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -33,7 +33,7 @@ License
|
||||
#include "linePointRef.H"
|
||||
#include "OFstream.H"
|
||||
#include "IFstream.H"
|
||||
#include "mathematicalConstants.H"
|
||||
#include "unitConversion.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -43,7 +43,7 @@ Description
|
||||
#include "cellShape.H"
|
||||
#include "cellModeller.H"
|
||||
#include "mergePoints.H"
|
||||
#include "mathematicalConstants.H"
|
||||
#include "unitConversion.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user