43 << typeName <<
" interpolation is only defined for vector fields"
57 using namespace constant::mathematical;
67 "volPointInterpolateWallModified(" +
psi.name() +
')',
93 psi.name() +
"Extrapolated",
100 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);
150 scalar maxVHatDotN = - vGreat;
154 if (isA<wallPolyPatch>(patch))
158 const label facei = patch.start() + patchFacei;
159 const face&
f = patch[patchFacei];
161 for (
label i = 1; i <
f.size() - 1; ++ i)
165 tetIndices(mesh.
faceOwner()[facei], facei, i)
173 const label pointi = tri[triPointI];
175 const vector& v = psip[pointi];
178 maxVHatDotN =
max(maxVHatDotN, vHatDotN);
183 const scalar
C = v &
n,
S = (v ^ a) &
n;
185 const scalar theta =
atan2(
C, -
S);
187 theta0[pointi] =
max(theta0[pointi], theta);
188 theta1[pointi] =
min(theta1[pointi], theta +
pi);
197 reduce(maxVHatDotN, maxOp<scalar>());
198 Info<< typeName <<
": Maximum in-to-wall dot product before = "
199 << maxVHatDotN <<
endl;
202 syncTools::syncPointList
210 syncTools::syncPointList
229 if (isA<wallPolyPatch>(patch))
231 forAll(patch.meshPoints(), patchPointi)
233 const label pointi = patch.meshPoints()[patchPointi];
237 if (theta0[pointi] <= 0 && theta1[pointi] >= 0)
242 if (theta0[pointi] >= theta1[pointi])
249 theta0[pointi] > 0 ? theta0[pointi] : theta1[pointi];
251 const scalar
c =
cos(theta),
s =
sin(theta);
253 const scalar scale =
max(
c, 0);
259 theta0[pointi] = theta1[pointi] = 0;
268 maxVHatDotN = - vGreat;
273 if (isA<wallPolyPatch>(patch))
277 const label facei = patch.start() + patchFacei;
278 const face&
f = patch[patchFacei];
280 for (
label i = 1; i <
f.size() - 1; ++ i)
284 tetIndices(mesh.
faceOwner()[facei], facei, i)
292 const label pointi = tri[triPointI];
294 const vector& v = psip[pointi];
297 maxVHatDotN =
max(maxVHatDotN, vHatDotN);
304 reduce(maxVHatDotN, maxOp<scalar>());
305 Info<< typeName <<
": Maximum in-to-wall dot product after = "
306 << maxVHatDotN <<
endl;
static const Foam::dimensionedScalar C("C", Foam::dimTemperature, 234.5)
#define forAll(list, i)
Loop across all elements in list.
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.
As interpolationCellPoint, but with the point field modified on wall faces.
interpolationCellPointWallModified(const VolField< Type > &psi)
Construct from components.
Given cell centre values and point (vertex) values decompose into tetrahedra and linear interpolate w...
virtual const labelList & faceOwner() const
Return face owner.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
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.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
volScalarField scalarField(fieldObject, mesh)
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.name(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
const volScalarField & psi
autoPtr< CompressibleMomentumTransportModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const viscosity &viscosity)
const dimensionedScalar c
Speed of light in a vacuum.
tmp< fvMatrix< Type > > S(const Pair< tmp< volScalarField::Internal >> &, const VolField< Type > &)
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.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensionedScalar sin(const dimensionedScalar &ds)
vectorField pointField
pointField is a vectorField.
static const Identity< scalar > I
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
dimensionedScalar atan2(const dimensionedScalar &x, const dimensionedScalar &y)
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 &)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
PointField< vector > pointVectorField
dimensionedScalar cos(const dimensionedScalar &ds)
wordList patchTypes(nPatches)