36 namespace functionObjects
42 fieldCoordinateSystemTransform,
51 Foam::functionObjects::fieldCoordinateSystemTransform::
52 fieldCoordinateSystemTransform
56 const dictionary&
dict 63 coordinateSystem::
New(mesh_,
dict, coordinateSystem::typeName)
69 <<
" Applying " << (csysPtr_->uniform() ?
"" :
"non-")
70 <<
"uniform transformation from global Cartesian to local " 71 << *csysPtr_ <<
nl <<
endl;
78 Foam::functionObjects::fieldCoordinateSystemTransform::transformFieldName
88 Foam::functionObjects::fieldCoordinateSystemTransform::srotTensor()
const 93 if (!rotTensorSurface_)
95 tensorField rotations(csysPtr_->R(mesh_.faceCentres()));
97 rotTensorSurface_.reset
104 mesh_.objectRegistry::instance(),
105 mesh_.objectRegistry::db(),
117 auto& rot = *rotTensorSurface_;
120 BoundaryType& bf =
const_cast<BoundaryType&
>(rot.boundaryField());
124 bf[patchi] = csysPtr_->R(bf[patchi].
patch().
patch().faceCentres());
128 return *rotTensorSurface_;
133 Foam::functionObjects::fieldCoordinateSystemTransform::vrotTensor()
const 138 if (!rotTensorVolume_)
140 tensorField rotations(csysPtr_->R(mesh_.cellCentres()));
142 rotTensorVolume_.reset
149 mesh_.objectRegistry::instance(),
150 mesh_.objectRegistry::db(),
162 auto& rot = *rotTensorVolume_;
165 BoundaryType& bf =
const_cast<BoundaryType&
>(rot.boundaryField());
169 bf[patchi] = csysPtr_->R(bf[patchi].
patch().
patch().faceCentres());
173 return *rotTensorVolume_;
179 const dictionary&
dict 184 fieldSet_.read(
dict);
192 bool Foam::functionObjects::fieldCoordinateSystemTransform::execute()
194 fieldSet_.updateSelection();
196 for (
const word& fieldName : fieldSet_.selectionNames())
198 transform<scalar>(fieldName);
199 transform<vector>(fieldName);
200 transform<sphericalTensor>(fieldName);
201 transform<symmTensor>(fieldName);
202 transform<tensor>(fieldName);
206 rotTensorSurface_.clear();
207 rotTensorVolume_.clear();
215 for (
const word& fieldName : fieldSet_.selectionNames())
217 writeObject(transformFieldName(fieldName));
defineTypeNameAndDebug(ObukhovLength, 0)
virtual bool read(const dictionary &)
Read the field average data.
GeometricField< tensor, fvPatchField, volMesh > volTensorField
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Generic GeometricField class.
GeometricBoundaryField< Type, PatchField, GeoMesh > Boundary
Type of boundary fields.
Ignore writing from objectRegistry::writeObject()
const dimensionSet dimless
Dimensionless.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
Macros for easy insertion into run-time selection tables.
const word & name() const noexcept
Return the name of this functionObject.
#define forAll(list, i)
Loop across all elements in list.
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
static word scopedName(const std::string &scope, const word &name)
Create scope:name or scope_name string.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
A class for handling words, derived from Foam::string.
virtual const word & type() const =0
Runtime type information.
GeometricField< tensor, fvsPatchField, surfaceMesh > surfaceTensorField
addToRunTimeSelectionTable(functionObject, ObukhovLength, dictionary)
Field< tensor > tensorField
Specialisation of Field<T> for tensor.
const std::string patch
OpenFOAM patch number as a std::string.
messageStream Info
Information stream (stdout output on master, null elsewhere)
virtual bool read(const dictionary &dict)
Read optional controls.