Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev
This commit is contained in:
20
etc/caseDicts/functions/fields/cylindrical
Normal file
20
etc/caseDicts/functions/fields/cylindrical
Normal file
@ -0,0 +1,20 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Version: dev
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Description
|
||||
Transforms a vector field into cylindrical coordinates
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#includeEtc "caseDicts/functions/fields/cylindrical.cfg"
|
||||
|
||||
field <fieldName>;
|
||||
|
||||
origin <origin>;
|
||||
axis <axis>;
|
||||
|
||||
// ************************************************************************* //
|
||||
15
etc/caseDicts/functions/fields/cylindrical.cfg
Normal file
15
etc/caseDicts/functions/fields/cylindrical.cfg
Normal file
@ -0,0 +1,15 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Version: dev
|
||||
\\/ M anipulation |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
type cylindrical;
|
||||
libs ("libfieldFunctionObjects.so");
|
||||
|
||||
executeControl writeTime;
|
||||
writeControl writeTime;
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2020 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2020-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -49,13 +49,12 @@ namespace functionObjects
|
||||
|
||||
Foam::tensor Foam::functionObjects::cylindrical::R(const vector& p) const
|
||||
{
|
||||
vector dir = p - origin_;
|
||||
dir /= mag(dir) + vSmall;
|
||||
const vector dir = normalised(p - origin_);
|
||||
|
||||
const vector axis = axis_/mag(axis_);
|
||||
const vector axis = normalised(axis_);
|
||||
const vector r = dir - (dir & axis)*axis;
|
||||
|
||||
return tensor(r, axis^r, axis);
|
||||
return tensor(normalised(r), normalised(axis^r), axis);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -53,12 +53,8 @@ Foam::tensor Foam::cylindrical::R(const vector& p) const
|
||||
// If the point is on the axis choose any radial direction
|
||||
return axesRotation(axis, perpendicular(axis)).R();
|
||||
}
|
||||
else
|
||||
{
|
||||
return axesRotation(axis, dir).R();
|
||||
}
|
||||
|
||||
return tensor(r, axis^r, axis);
|
||||
return axesRotation(axis, dir).R();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -43,6 +43,8 @@ fieldsFunctions
|
||||
|
||||
#includeFunc CourantNo
|
||||
|
||||
#includeFunc cylindrical(origin=(0 0 0), axis=(0 0 1), U)
|
||||
|
||||
#includeFunc ddt(p)
|
||||
|
||||
#includeFunc div(phi)
|
||||
|
||||
Reference in New Issue
Block a user