OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | List of all members
olb::BlockLatticePhysHeatFluxBoundary3D< T, DESCRIPTOR, TDESCRIPTOR > Class Template Referencefinal

functor returns pointwise phys heat flux on a boundary with a given material on local lattice More...

#include <latticePhysHeatFluxBoundary3D.h>

+ Inheritance diagram for olb::BlockLatticePhysHeatFluxBoundary3D< T, DESCRIPTOR, TDESCRIPTOR >:
+ Collaboration diagram for olb::BlockLatticePhysHeatFluxBoundary3D< T, DESCRIPTOR, TDESCRIPTOR >:

Public Member Functions

 BlockLatticePhysHeatFluxBoundary3D (BlockLattice< T, TDESCRIPTOR > &blockLattice, BlockGeometry< T, 3 > &blockGeometry, int material, const ThermalUnitConverter< T, DESCRIPTOR, TDESCRIPTOR > &converter, IndicatorF3D< T > &indicator)
 
bool operator() (T output[], const int input[]) override
 has to be implemented for 'every' derived class
 
- Public Member Functions inherited from olb::BlockLatticeF3D< T, TDESCRIPTOR >
BlockLattice< T, TDESCRIPTOR > & getBlock ()
 Copy Constructor.
 
- Public Member Functions inherited from olb::BlockF3D< T >
 ~BlockF3D () override
 virtual destructor for defined behaviour
 
virtual BlockStructureD< 3 > & getBlockStructure () const
 
BlockF3D< T > & operator- (BlockF3D< T > &rhs)
 
BlockF3D< T > & operator+ (BlockF3D< T > &rhs)
 
BlockF3D< T > & operator* (BlockF3D< T > &rhs)
 
BlockF3D< T > & operator/ (BlockF3D< T > &rhs)
 
- Public Member Functions inherited from olb::GenericF< T, int >
virtual ~GenericF ()=default
 
int getSourceDim () const
 read only access to member variable _m
 
int getTargetDim () const
 read only access to member variable _n
 
std::string & getName ()
 read and write access to name
 
std::string const & getName () const
 read only access to name
 
bool operator() (T output[])
 wrapper that call the pure virtual operator() (T output[], const S input[]) from above
 
bool operator() (T output[], int input0)
 
bool operator() (T output[], int input0, int input1)
 
bool operator() (T output[], int input0, int input1, int input2)
 
bool operator() (T output[], int input0, int input1, int input2, int input3)
 

Additional Inherited Members

- Public Types inherited from olb::GenericF< T, int >
using targetType
 
using sourceType
 
- Public Attributes inherited from olb::GenericF< T, int >
std::shared_ptr< GenericF< T, int > > _ptrCalcC
 memory management, frees resouces (calcClass)
 
- Protected Member Functions inherited from olb::BlockLatticeThermalPhysF3D< T, DESCRIPTOR, TDESCRIPTOR >
 BlockLatticeThermalPhysF3D (BlockLattice< T, TDESCRIPTOR > &blockLattice, const ThermalUnitConverter< T, DESCRIPTOR, TDESCRIPTOR > &converter, int targetDim)
 
- Protected Member Functions inherited from olb::BlockLatticeF3D< T, TDESCRIPTOR >
 BlockLatticeF3D (BlockLattice< T, TDESCRIPTOR > &blockLattice, int targetDim)
 
- Protected Member Functions inherited from olb::BlockF3D< T >
 BlockF3D (BlockStructureD< 3 > &blockStructure, int targetDim)
 
- Protected Member Functions inherited from olb::GenericF< T, int >
 GenericF (int targetDim, int sourceDim)
 
- Protected Attributes inherited from olb::BlockLatticeThermalPhysF3D< T, DESCRIPTOR, TDESCRIPTOR >
const ThermalUnitConverter< T, DESCRIPTOR, TDESCRIPTOR > & _converter
 
- Protected Attributes inherited from olb::BlockLatticeF3D< T, TDESCRIPTOR >
BlockLattice< T, TDESCRIPTOR > & _blockLattice
 
- Protected Attributes inherited from olb::BlockF3D< T >
BlockStructureD< 3 > & _blockStructure
 

Detailed Description

template<typename T, typename DESCRIPTOR, typename TDESCRIPTOR>
class olb::BlockLatticePhysHeatFluxBoundary3D< T, DESCRIPTOR, TDESCRIPTOR >

functor returns pointwise phys heat flux on a boundary with a given material on local lattice

Definition at line 64 of file latticePhysHeatFluxBoundary3D.h.

Constructor & Destructor Documentation

◆ BlockLatticePhysHeatFluxBoundary3D()

template<typename T , typename DESCRIPTOR , typename TDESCRIPTOR >
olb::BlockLatticePhysHeatFluxBoundary3D< T, DESCRIPTOR, TDESCRIPTOR >::BlockLatticePhysHeatFluxBoundary3D ( BlockLattice< T, TDESCRIPTOR > & blockLattice,
BlockGeometry< T, 3 > & blockGeometry,
int material,
const ThermalUnitConverter< T, DESCRIPTOR, TDESCRIPTOR > & converter,
IndicatorF3D< T > & indicator )

Definition at line 69 of file latticePhysHeatFluxBoundary3D.hh.

75 : BlockLatticeThermalPhysF3D<T,DESCRIPTOR,TDESCRIPTOR>(blockLattice,converter,1),
76 _blockGeometry(blockGeometry),
77 _material(material)
78{
79 this->getName() = "physHeatFluxBoundary";
80 const T scaling = this->_converter.getConversionFactorLength() * 0.1;
81 std::vector<int> discreteNormalOutwards(4, 0);
82
83 for (int iX = 1 ; iX < _blockGeometry.getNx() - 1; iX++) {
84 _discreteNormal.resize(_blockGeometry.getNx() - 2);
85 _normal.resize(_blockGeometry.getNx() - 2);
86
87 for (int iY = 1; iY < _blockGeometry.getNy() - 1; iY++) {
88 _discreteNormal[iX-1].resize(_blockGeometry.getNy() - 2);
89 _normal[iX-1].resize(_blockGeometry.getNy() - 2);
90
91 for (int iZ = 1; iZ < _blockGeometry.getNz() - 1; iZ++) {
92 _discreteNormal[iX-1][iY-1].resize(_blockGeometry.getNz() - 2);
93 _normal[iX-1][iY-1].resize(_blockGeometry.getNz() - 2);
94
95 if (_blockGeometry.get({iX, iY, iZ}) == _material) {
96 discreteNormalOutwards = _blockGeometry.getStatistics().getType(iX, iY, iZ);
97 _discreteNormal[iX - 1][iY - 1][iZ - 1].resize(3);
98 _normal[iX - 1][iY - 1][iZ - 1].resize(3);
99
100 _discreteNormal[iX - 1][iY- 1][iZ- 1][0] = -discreteNormalOutwards[1];
101 _discreteNormal[iX- 1][iY- 1][iZ- 1][1] = -discreteNormalOutwards[2];
102 _discreteNormal[iX- 1][iY- 1][iZ- 1][2] = -discreteNormalOutwards[3];
103
104 T physR[3];
105 _blockGeometry.getPhysR(physR,{iX, iY, iZ});
106 Vector<T,3> origin(physR[0],physR[1],physR[2]);
107 Vector<T,3> direction(-_discreteNormal[iX- 1][iY- 1][iZ- 1][0] * scaling,
108 -_discreteNormal[iX- 1][iY- 1][iZ- 1][1] * scaling,
109 -_discreteNormal[iX- 1][iY- 1][iZ- 1][2] * scaling);
110 Vector<T,3> normal(0.,0.,0.);
111 origin[0] = physR[0];
112 origin[1] = physR[1];
113 origin[2] = physR[2];
114
115 indicator.normal(normal, origin, direction);
116 normalize(normal);
117
118 _normal[iX- 1][iY- 1][iZ- 1][0] = normal[0];
119 _normal[iX- 1][iY- 1][iZ- 1][1] = normal[1];
120 _normal[iX- 1][iY- 1][iZ- 1][2] = normal[2];
121 }
122 }
123 }
124 }
125}
const BlockGeometryStatistics< T, D > & getStatistics() const
Read only access to the associated block statistic.
Vector< T, D > getPhysR(LatticeR< D > latticeR)
std::enable_if_t< sizeof...(L)==D, int > get(L... latticeR) const
Read-only access to a material number.
const ThermalUnitConverter< T, DESCRIPTOR, TDESCRIPTOR > & _converter
int getNy() const
Read only access to block height.
int getNx() const
Read only access to block width.
int getNz() const
Read only access to block height.
std::string & getName()
read and write access to name
Definition genericF.hh:51
virtual bool normal(Vector< S, 3 > &normal, const Vector< S, 3 > &origin, const Vector< S, 3 > &direction, int iC=-1)
returns true and the normal if there was one found for an given origin and direction
constexpr T getConversionFactorLength() const
access (read-only) to private member variable
constexpr Vector< T, D > normalize(const ScalarVector< T, D, IMPL > &a, T scale=T{1})
Definition vector.h:245

References olb::BlockLatticeThermalPhysF3D< T, DESCRIPTOR, TDESCRIPTOR >::_converter, olb::BlockGeometry< T, D >::get(), olb::UnitConverter< T, DESCRIPTOR >::getConversionFactorLength(), olb::GenericF< T, int >::getName(), olb::BlockStructureD< D >::getNx(), olb::BlockStructureD< D >::getNy(), olb::BlockStructureD< D >::getNz(), olb::BlockGeometry< T, D >::getPhysR(), olb::BlockGeometry< T, D >::getStatistics(), olb::IndicatorF3D< S >::normal(), and olb::normalize().

+ Here is the call graph for this function:

Member Function Documentation

◆ operator()()

template<typename T , typename DESCRIPTOR , typename TDESCRIPTOR >
bool olb::BlockLatticePhysHeatFluxBoundary3D< T, DESCRIPTOR, TDESCRIPTOR >::operator() ( T output[],
const int input[] )
overridevirtual

has to be implemented for 'every' derived class

Implements olb::GenericF< T, int >.

Definition at line 129 of file latticePhysHeatFluxBoundary3D.hh.

130{
131 output[0] = T();
132
133 if (this->_blockLattice.getNeighborhoodRadius(input) < 1) {
134#ifdef OLB_DEBUG
135 std::cout << "Input address not mapped by _discreteNormal, overlap too small" << std::endl;
136#endif
137 return true;
138 }
139
140 if (_blockGeometry.get(input) == _material) {
141
142 // lattice temperature next to the boundary in the direction of the normal
143 T temp1 = this->_blockLattice.get(
144 input[0] + _discreteNormal[input[0]-1][input[1]-1][input[2]-1][0],
145 input[1] + _discreteNormal[input[0]-1][input[1]-1][input[2]-1][1],
146 input[2] + _discreteNormal[input[0]-1][input[1]-1][input[2]-1][2]).computeRho();
147
148 // second lattice temperature in the direction of the normal
149 T temp2 = this->_blockLattice.get(
150 input[0] + 2*_discreteNormal[input[0]-1][input[1]-1][input[2]-1][0],
151 input[1] + 2*_discreteNormal[input[0]-1][input[1]-1][input[2]-1][1],
152 input[2] + 2*_discreteNormal[input[0]-1][input[1]-1][input[2]-1][2]).computeRho();
153
154 // calculation of deltaX with the normal, yields higher accuracy for deltaX
155 T deltaX = util::sqrt( _normal[input[0]-1][input[1]-1][input[2]-1][0] *
156 _normal[input[0]-1][input[1]-1][input[2]-1][0] +
157 _normal[input[0]-1][input[1]-1][input[2]-1][1] *
158 _normal[input[0]-1][input[1]-1][input[2]-1][1] +
159 _normal[input[0]-1][input[1]-1][input[2]-1][2] *
160 _normal[input[0]-1][input[1]-1][input[2]-1][2] );
161
162 // lattice temperature on the boundary
163 // ATTENTION: here the temperature is hardcoded as the characteristic high temperature
164 T temp0 = 1.5;
165
166 //return of specific heat flux in direction of the normal
167 output[0] = this->_converter.getThermalConductivity() *
169 (1.5 * temp0 - 2.0 * temp1 + 0.5 * temp2) /
170 this->_converter.getPhysLength(deltaX);
171
172 return true;
173 }
174 else {
175 return true;
176 }
177}
BlockLattice< T, TDESCRIPTOR > & _blockLattice
Cell< T, DESCRIPTOR > get(CellID iCell)
Get Cell interface for index iCell.
CellDistance getNeighborhoodRadius(LatticeR< D > latticeR) const
Return maximum valid neighborhood sphere radius w.r.t. latticeR.
constexpr T getThermalConductivity() const
return thermal conductivity in physical units
constexpr T getCharPhysTemperatureDifference() const
return characteristic temperature difference in physical units
constexpr T getPhysLength(int latticeLength) const
conversion from lattice to physical length
cpu::simd::Pack< T > sqrt(cpu::simd::Pack< T > value)
Definition pack.h:100

References olb::util::sqrt().

+ Here is the call graph for this function:

The documentation for this class was generated from the following files: