34 template<
class Sol
idThermophysicalTransportModel>
39 if (!zoneCoordinateSystems_.size())
return;
47 zonesPatchFaces_.
setSize(zoneCoordinateSystems_.size());
52 PtrDictionary<coordinateSystem>,
53 zoneCoordinateSystems_,
57 zonesPatchFaces_[zonei].setSize(
patches.size());
66 cellInZone[zoneCells[i]] =
true;
73 zonesPatchFaces_[zonei][
patchi].setSize(pp.size());
75 label nZonePatchFaces = 0;
79 const label facei = pp.start() + patchFacei;
81 if (cellInZone[own[facei]])
83 zonesPatchFaces_[zonei][
patchi][nZonePatchFaces++] =
88 zonesPatchFaces_[zonei][
patchi].setSize(nZonePatchFaces);
98 template<
class Sol
idThermophysicalTransportModel>
115 this->typeDict(
type).template lookupOrDefault<
Switch>
125 const dictionary& zonesDict(this->typeDict(
type).subDict(
"zones"));
127 Info<<
" Reading coordinate system for zones:" <<
endl;
133 const word& zoneName = iter().keyword();
138 zoneCoordinateSystems_.
insert
147 setZonesPatchFaces();
167 const scalar alignmentFactor =
171 *
mag(nKappa -
n*(nKappa &
n))
174 if (alignmentFactor > 1
e-3)
179 Info<<
" Kappa is not aligned with patch "
181 <<
" by an alignment factor of " << alignmentFactor
182 <<
" (0=aligned, 1=unaligned)" <<
nl
183 <<
" heat-flux correction will be applied." <<
endl;
188 if (!aligned && boundaryAligned_)
194 " boundaryAligned is set true, "
195 "boundary alignment of kappa will be enforced." <<
endl;
213 template<
class Sol
idThermophysicalTransportModel>
222 template<
class Sol
idThermophysicalTransportModel>
244 coordinateSystem_.R(
mesh.
C()).transformDiagTensor(materialKappa);
258 zoneCoordinateSystems_,
269 const label celli = zoneCells[i];
290 const label patchFacei =
291 zonesPatchFaces_[zonei][
patchi][zonePatchFacei];
293 KappaPf[patchFacei] =
297 materialKappaPf[patchFacei]
309 template<
class Sol
idThermophysicalTransportModel>
322 tmp<symmTensorField> tKappa
324 coordinateSystem_.R(CPf).transformDiagTensor(materialKappaPf)
332 PtrDictionary<coordinateSystem>,
333 zoneCoordinateSystems_,
337 const coordinateSystem& cs = iter();
341 const label patchFacei =
342 zonesPatchFaces_[zonei][
patchi][zonePatchFacei];
344 KappaPf[patchFacei] =
345 cs.R().transformDiagTensor
348 materialKappaPf[patchFacei]
359 template<
class Sol
idThermophysicalTransportModel>
369 template<
class Sol
idThermophysicalTransportModel>
382 template<
class Sol
idThermophysicalTransportModel>
398 template<
class Sol
idThermophysicalTransportModel>
408 template<
class Sol
idThermophysicalTransportModel>
426 *((nKappa -
n*(nKappa &
n)) & gradT().boundaryField()[
patchi])
436 template<
class Sol
idThermophysicalTransportModel>
462 template<
class Sol
idThermophysicalTransportModel>
466 SolidThermophysicalTransportModel::predict();
470 if (!zonesPatchFaces_.size())
472 setZonesPatchFaces();
477 template<
class Sol
idThermophysicalTransportModel>
485 template<
class Sol
idThermophysicalTransportModel>
493 zonesPatchFaces_.clear();
497 template<
class Sol
idThermophysicalTransportModel>
505 zonesPatchFaces_.clear();
509 template<
class Sol
idThermophysicalTransportModel>
517 zonesPatchFaces_.clear();
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
Macros for easy insertion into run-time selection tables.
void insert(const word &, T *)
Add at head of dictionary.
const dimensionSet & dimensions() const
Return dimensions.
Generic GeometricField class.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
Internal::FieldType & primitiveFieldRef()
Return a reference to the primitive field.
Boundary & boundaryFieldRef()
Return a reference to the boundary field.
static tmp< GeometricField< Type, GeoMesh, PrimitiveField > > New(const word &name, const Internal &, const PtrList< Patch > &, const HashPtrTable< Source > &=HashPtrTable< Source >())
Return a temporary field constructed from name,.
void setSize(const label)
Reset size of List.
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
virtual symmTensor transformDiagTensor(const vector &p, const vector &v) const =0
Transform diagTensor masquerading as a vector using transformation.
Base class for other coordinate system specifications.
static autoPtr< coordinateSystem > New(const objectRegistry &obr, const dictionary &dict)
Select constructed from dictionary and objectRegistry.
const coordinateRotation & R() const
Return const reference to co-ordinate rotation.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Mesh data needed to do the Finite Volume discretisation.
const volVectorField & C() const
Return cell centres.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
const fvSchemes & schemes() const
Return the fvSchemes.
const fvSolution & solution() const
Return the fvSolution.
const surfaceScalarField & magSf() const
Return cell face area magnitudes.
void setFluxRequired(const word &name) const
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
const cellZoneList & cellZones() const
Return cell zones.
virtual const labelList & faceOwner() const
Return face owner.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Base-class for solid thermodynamic properties.
Solid thermophysical transport model for anisotropic thermal conductivity.
virtual bool movePoints()
Update for mesh motion.
anisotropic(const alphaField &alpha, const solidThermo &thermo, const word &type=typeName)
Construct from solid thermophysical properties.
SolidThermophysicalTransportModel::alphaField alphaField
virtual tmp< scalarField > qCorr(const label patchi) const
Return the patch heat flux correction [W/m^2].
virtual void predict()
Correct the anisotropic viscosity.
virtual void mapMesh(const polyMeshMap &map)
Update from another mesh using the given map.
virtual void distribute(const polyDistributionMap &map)
Redistribute or update using the given distribution map.
virtual tmp< volScalarField > kappa() const
Thermal conductivity [W/m/K].
virtual tmp< surfaceScalarField > q() const
Return the heat flux [W/m^2].
virtual void topoChange(const polyTopoChangeMap &map)
Update topology using the given map.
virtual bool read()
Read thermophysicalTransport dictionary.
virtual tmp< fvScalarMatrix > divq(volScalarField &he) const
Return the source term for the energy equation.
void enableCache(const word &name) const
Enable caching of the given field.
A class for managing temporary objects.
A class for handling words, derived from string.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Calculate the laplacian of the given field.
Calculate the snGrad of the given volField.
Calculate the matrix for the laplacian of the field.
const polyBoundaryMesh & bMesh
const fvPatchList & patches
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
static tmp< SurfaceField< Type > > interpolate(const VolField< Type > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
tmp< VolField< Type > > laplacian(const VolField< Type > &vf, const word &name)
tmp< VolField< typename outerProduct< vector, Type >::type > > grad(const SurfaceField< Type > &ssf)
tmp< fvMatrix< Type > > laplacian(const VolField< Type > &vf, const word &name)
tmp< fvMatrix< Type > > laplacianCorrection(const VolField< scalar > &gamma, const VolField< Type > &vf)
List< label > labelList
A List of labels.
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.
List< bool > boolList
Bool container classes.
Type gSum(const UList< Type > &f, const label comm)
tmp< DimensionedField< typename outerProduct< Type, Type >::type, GeoMesh, Field >> sqr(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
dimensioned< symmTensor > dimensionedSymmTensor
Dimensioned tensor obtained from generic dimensioned type.
Field< vector > vectorField
Specialisation of Field<T> for vector.
Field< symmTensor > symmTensorField
Specialisation of Field<T> for symmTensor.
tmp< DimensionedField< scalar, GeoMesh, Field > > mag(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
tmp< DimensionedField< TypeR, GeoMesh, Field > > New(const tmp< DimensionedField< TypeR, GeoMesh, Field >> &tdf1, const word &name, const dimensionSet &dimensions)
void T(GeometricField< Type, GeoMesh, PrimitiveField1 > &gf, const GeometricField< Type, GeoMesh, PrimitiveField2 > &gf1)
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
faceListList boundary(nPatches)
fluidMulticomponentThermo & thermo