Commit d6a278f2 authored by henry's avatar henry
Browse files

Introduced the new file unitConversion.H to hold degToRad, radToDeg

and other unit conversion functions as they are required e.g. slug <-> kg.
parent 942d3344
......@@ -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
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
/*---------------------------------------------------------------------------*\
========= |
\\ / 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"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment