42 <<
typeName <<
" interpolation is only defined for vector fields"
56 using namespace constant::mathematical;
65 "volPointInterpolateWallModified(" +
psi.name() +
')',
90 psi.name() +
"Extrapolated",
97 psiExtrapolated.correctBoundaryConditions();
116 const face&
f = patch[patchFacei];
117 const vector&
n = patch.faceNormals()[patchFacei];
121 pointNormals[
f[i]] +=
n;
122 pointCount[
f[i]] += 1;
127 syncTools::syncPointList
135 syncTools::syncPointList
143 pointNormals /=
max(pointCount, small);
149 scalar maxVHatDotN = - vGreat;
153 if (isA<wallPolyPatch>(patch))
157 const label facei = patch.start() + patchFacei;
158 const face&
f = patch[patchFacei];
160 for (
label i = 1; i <
f.size() - 1; ++ i)
172 const label pointi = tri[triPointI];
174 const vector& v = psip[pointi];
177 maxVHatDotN =
max(maxVHatDotN, vHatDotN);
182 const scalar
C = v &
n,
S = (v ^ a) &
n;
184 const scalar theta =
atan2(
C, -
S);
186 theta0[pointi] =
max(theta0[pointi], theta);
187 theta1[pointi] =
min(theta1[pointi], theta +
pi);
196 reduce(maxVHatDotN, maxOp<scalar>());
197 Info<<
typeName <<
": Maximum in-to-wall dot product before = "
198 << maxVHatDotN <<
endl;
201 syncTools::syncPointList
209 syncTools::syncPointList
226 if (isA<wallPolyPatch>(patch))
228 forAll(patch.meshPoints(), patchPointi)
230 const label pointi = patch.meshPoints()[patchPointi];
234 if (theta0[pointi] <= 0 && theta1[pointi] >= 0)
239 if (theta0[pointi] >= theta1[pointi])
246 theta0[pointi] > 0 ? theta0[pointi] : theta1[pointi];
248 const scalar
c =
cos(theta),
s =
sin(theta);
250 const scalar scale =
max(
c, 0);
256 theta0[pointi] = theta1[pointi] = 0;
264 maxVHatDotN = - vGreat;
269 if (isA<wallPolyPatch>(patch))
273 const label facei = patch.start() + patchFacei;
274 const face&
f = patch[patchFacei];
276 for (
label i = 1; i <
f.size() - 1; ++ i)
288 const label pointi = tri[triPointI];
290 const vector& v = psip[pointi];
293 maxVHatDotN =
max(maxVHatDotN, vHatDotN);
300 reduce(maxVHatDotN, maxOp<scalar>());
301 Info<<
typeName <<
": Maximum in-to-wall dot product after = "
302 << maxVHatDotN <<
endl;
#define forAll(list, i)
Loop across all elements in list.
static volPointInterpolation & New(const word &name, const fvMesh &mesh)
Construct and return the named DemandDrivenMeshObject.
Generic GeometricField class.
const word & name() const
Return name.
Generic dimensioned Type class.
const word & name() const
Return const reference to name.
Mesh data needed to do the Finite Volume discretisation.
const Time & time() const
Return the top-level database.
const polyMesh & poly() const
Return reference to polyMesh.
As interpolations::cellPoint, but with the point field modified on wall faces.
cellPointWallModified(const VolField< Type > &psi)
Construct from components.
Piecewise-linear interpolation method. Uses volPointInterpolation to create values on the points....
const polyBoundaryMesh & boundary() const
Return boundary mesh.
virtual const labelList & faceOwner() const
Return face owner.
virtual const pointField & points() const
Return raw points.
virtual bool write(const bool write=true) const
Write using setting from DB.
A class for managing temporary objects.
Template function which returns the un-mangled name of a given type. Useful for types which do not ha...
tmp< PointField< Type > > interpolate(const VolField< Type > &) const
Interpolate volField using inverse distance weighting.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
volScalarField scalarField(fieldObject, mesh)
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.name(), lagrangian::cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
const volScalarField & psi
const dimensionedScalar c
Speed of light in a vacuum.
tmp< fvMatrix< Type > > S(const Pair< tmp< volScalarField::Internal >> &, const VolField< Type > &)
static const coefficient C("C", dimTemperature, 234.5)
errorManipArg< error, int > exit(error &err, const int errNo=1)
VolField< vector > volVectorField
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
String typeName(const std::type_info &info)
Return the un-mangled name given the standard type info.
dimensionedScalar sin(const dimensionedScalar &ds)
vectorField pointField
pointField is a vectorField.
static const Identity< scalar > I
tmp< DimensionedField< typename outerProduct< Type, Type >::type, GeoMesh, Field >> sqr(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
Vector< scalar > vector
A scalar version of the templated Vector.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
dimensionSet normalised(const dimensionSet &)
dimensioned< Type > min(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
PointField< vector > pointVectorField
tmp< DimensionedField< scalar, GeoMesh, Field > > atan2(const DimensionedField< scalar, GeoMesh, PrimitiveField1 > &dsf1, const DimensionedField< scalar, GeoMesh, PrimitiveField2 > &dsf2)
tmp< DimensionedField< TypeR, GeoMesh, Field > > New(const tmp< DimensionedField< TypeR, GeoMesh, Field >> &tdf1, const word &name, const dimensionSet &dimensions)
dimensionedScalar cos(const dimensionedScalar &ds)
dimensioned< Type > max(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
wordList patchTypes(nPatches)