33 #ifndef __H__UG__NAVIER_STOKES__INCOMPRESSIBLE__FV1__TURBULENT_VISCOSITY_DATA_FV1__
34 #define __H__UG__NAVIER_STOKES__INCOMPRESSIBLE__FV1__TURBULENT_VISCOSITY_DATA_FV1__
59 template <
typename TData,
int dim,
typename TImpl,
typename TGr
idFunction>
61 :
public StdUserData<StdTurbulentViscosityDataFV1<TData,dim,TImpl,TGridFunction>, TData,dim>
76 typedef typename TGridFunction::template dim_traits<dim>::grid_base_object
elem_type;
79 typedef typename TGridFunction::template dim_traits<dim>::const_iterator
ElemIterator;
102 UG_THROW(
"StdTurbulentViscosityDataFV1: Need element.");
109 UG_THROW(
"StdTurbulentViscosityDataFV1: Need element.");
112 template <
int refDim>
123 getImpl().template evaluate<refDim>(vValue,vGlobIP,
time,si,elem,
124 vCornerCoords,vLocIP,nip,u,vJT);
130 const int si = this->
subset();
133 elem, vCornerCoords, this->
template local_ips<dim>(
s),
140 const int si = this->
subset();
143 elem, vCornerCoords, this->
template local_ips<dim>(
s),
161 template <
typename VType>
166 template <
typename VType>
186 TImpl&
getImpl() {
return static_cast<TImpl&
>(*this);}
189 const TImpl&
getImpl()
const {
return static_cast<const TImpl&
>(*this);}
199 template <
typename TGr
idFunction>
202 FV1SmagorinskyTurbViscData<TGridFunction>,TGridFunction >,
virtual public INewtonUpdate
220 typedef typename TGridFunction::template dim_traits<dim>::grid_base_object
elem_type;
223 typedef typename TGridFunction::template dim_traits<dim>::const_iterator
ElemIterator;
292 m_spApproxSpace = approxSpace;
320 template <
int refDim>
337 size_t noc=element->num_vertices();
345 std::vector<number> vShape;
348 for(
size_t ip = 0;
ip < nip; ++
ip)
351 rTrialSpace.
shapes(vShape, vLocIP[
ip]);
355 for(
size_t sh = 0; sh < noc; ++sh)
362 UG_CATCH_THROW(
"TurbulentViscosityData: trial space missing, Reference Object: "
363 <<roid<<
", Trial Space: LAGRANGE 1, refDim="<<refDim);
366 (*m_imKinViscosity)(kinViscValues,
375 for (
size_t ip=0;
ip < nip;
ip++){
377 vValue[
ip] += kinViscValues[
ip];
387 template <
typename TGr
idFunction>
390 FV1DynamicTurbViscData<TGridFunction>,TGridFunction >,
virtual public INewtonUpdate
408 typedef typename TGridFunction::template dim_traits<dim>::grid_base_object
elem_type;
411 typedef typename TGridFunction::template dim_traits<dim>::const_iterator
ElemIterator;
509 m_spApproxSpace = approxSpace;
554 template <
int refDim>
571 size_t noc=element->num_vertices();
579 std::vector<number> vShape;
582 for(
size_t ip = 0;
ip < nip; ++
ip)
585 rTrialSpace.
shapes(vShape, vLocIP[
ip]);
589 for(
size_t sh = 0; sh < noc; ++sh)
596 UG_CATCH_THROW(
"TurbulentViscosityData: trial space missing, Reference Object: "
597 <<roid<<
", Trial Space: LAGRANGE 1, refDim="<<refDim);
600 (*m_imKinViscosity)(kinViscValues,
609 for (
size_t ip=0;
ip < nip;
ip++){
611 vValue[
ip] += kinViscValues[
ip];
640 template <
typename TGr
idFunction>
function NavierStokes(fcts, subsets, discType)
TData & value(size_t s, size_t ip)
size_t num_ip(size_t s) const
size_t num_series() const
virtual ReferenceObjectID reference_object_id() const=0
const MathVector< dim > & ip(size_t s, size_t ip) const
const MathVector< dim > * ips(size_t s) const
virtual void shapes(std::vector< std::vector< shape_type > > &vvShape, const std::vector< MathVector< dim > > &vLocPos) const=0
LocalVector & solution(size_t i)
Definition: turbulent_viscosity_fv1.h:391
ANumber m_aVolume
Definition: turbulent_viscosity_fv1.h:472
virtual ~FV1DynamicTurbViscData()
Definition: turbulent_viscosity_fv1.h:540
aVertexTensor m_acMij
Definition: turbulent_viscosity_fv1.h:495
bool m_timeFilter
Definition: turbulent_viscosity_fv1.h:618
TGridFunction::template dim_traits< dim >::grid_base_object elem_type
element type
Definition: turbulent_viscosity_fv1.h:408
AMathVectorDim m_aUHat
Definition: turbulent_viscosity_fv1.h:480
MathMatrix< dim, dim > dimMat
attachment accessor types
Definition: turbulent_viscosity_fv1.h:417
SmartPtr< CplUserData< number, dim > > m_imKinViscosity
Data import for kinematic viscosity.
Definition: turbulent_viscosity_fv1.h:450
aVertexTensor m_acDeformationHat
Definition: turbulent_viscosity_fv1.h:487
MathVector< dim > vecDim
Definition: turbulent_viscosity_fv1.h:420
Attachment< dimMat > ATensor
Definition: turbulent_viscosity_fv1.h:418
PeriodicAttachmentAccessor< Vertex, ATensor > aVertexTensor
Definition: turbulent_viscosity_fv1.h:424
void set_kinematic_viscosity(number val)
Definition: turbulent_viscosity_fv1.h:437
grid_type * m_grid
Definition: turbulent_viscosity_fv1.h:460
TGridFunction::algebra_type algebra_type
algebra type
Definition: turbulent_viscosity_fv1.h:396
PeriodicAttachmentAccessor< Vertex, AMathVectorDim > aVertexDimVector
Definition: turbulent_viscosity_fv1.h:425
SmartPtr< TGridFunction > m_u
Definition: turbulent_viscosity_fv1.h:458
void set_time_filter_eps(number eps)
Definition: turbulent_viscosity_fv1.h:630
ANumber m_aVolumeHat
Definition: turbulent_viscosity_fv1.h:476
ATensor m_aLij
Definition: turbulent_viscosity_fv1.h:492
ATensor m_aMij
Definition: turbulent_viscosity_fv1.h:496
domain_type::grid_type grid_type
grid type
Definition: turbulent_viscosity_fv1.h:405
aVertexNumber m_acVolume
Definition: turbulent_viscosity_fv1.h:471
void update()
Definition: turbulent_viscosity_fv1_impl.h:855
aVertexNumber m_acTurbulentViscosity
Definition: turbulent_viscosity_fv1.h:463
ANumber m_aTurbulentC
Definition: turbulent_viscosity_fv1.h:468
void evaluate(number vValue[], const MathVector< dim > vGlobIP[], number time, int si, GridObject *elem, const MathVector< dim > vCornerCoords[], const MathVector< refDim > vLocIP[], const size_t nip, LocalVector *u, const MathMatrix< refDim, dim > *vJT=NULL) const
Definition: turbulent_viscosity_fv1.h:555
void set_kinematic_viscosity(SmartPtr< CplUserData< number, dim > > user)
Definition: turbulent_viscosity_fv1.h:434
aVertexTensor m_acLij
Definition: turbulent_viscosity_fv1.h:491
SmartPtr< ApproximationSpace< domain_type > > m_spApproxSpace
Definition: turbulent_viscosity_fv1.h:499
FV1DynamicTurbViscData(SmartPtr< ApproximationSpace< domain_type > > approxSpace, SmartPtr< TGridFunction > spGridFct)
constructor
Definition: turbulent_viscosity_fv1.h:506
aVertexDimVector m_acUHat
Definition: turbulent_viscosity_fv1.h:479
TGridFunction::domain_type domain_type
domain type
Definition: turbulent_viscosity_fv1.h:393
TGridFunction::template dim_traits< dim >::const_iterator ElemIterator
element iterator
Definition: turbulent_viscosity_fv1.h:411
PeriodicBoundaryManager * m_pbm
Definition: turbulent_viscosity_fv1.h:502
ATensor m_aDeformationHat
Definition: turbulent_viscosity_fv1.h:488
bool m_spaceFilter
Definition: turbulent_viscosity_fv1.h:617
void set_space_filter(bool b)
Definition: turbulent_viscosity_fv1.h:623
aVertexNumber m_acVolumeHat
Definition: turbulent_viscosity_fv1.h:475
static const int dim
world dimension
Definition: turbulent_viscosity_fv1.h:402
ANumber m_aTurbulentViscosity
Definition: turbulent_viscosity_fv1.h:464
void set_time_filter(bool b)
Definition: turbulent_viscosity_fv1.h:626
static const size_t max_number_of_ips
Definition: turbulent_viscosity_fv1.h:615
number m_timeFilterEps
Definition: turbulent_viscosity_fv1.h:619
aVertexTensor m_acDeformation
Definition: turbulent_viscosity_fv1.h:483
TGridFunction::template traits< Vertex >::const_iterator VertexIterator
vertex iterator
Definition: turbulent_viscosity_fv1.h:414
static const number m_small
Definition: turbulent_viscosity_fv1.h:454
ATensor m_aDeformation
Definition: turbulent_viscosity_fv1.h:484
PeriodicAttachmentAccessor< Vertex, ANumber > aVertexNumber
Definition: turbulent_viscosity_fv1.h:423
domain_type::position_accessor_type position_accessor_type
position accessor type
Definition: turbulent_viscosity_fv1.h:399
Attachment< vecDim > AMathVectorDim
Definition: turbulent_viscosity_fv1.h:421
aVertexNumber m_acTurbulentC
Definition: turbulent_viscosity_fv1.h:467
number m_viscosityNumber
Definition: turbulent_viscosity_fv1.h:452
Definition: turbulent_viscosity_fv1.h:203
Attachment< dimMat > ATensor
Definition: turbulent_viscosity_fv1.h:230
aVertexNumber m_acTurbulentViscosity
Definition: turbulent_viscosity_fv1.h:266
void evaluate(number vValue[], const MathVector< dim > vGlobIP[], number time, int si, GridObject *elem, const MathVector< dim > vCornerCoords[], const MathVector< refDim > vLocIP[], const size_t nip, LocalVector *u, const MathMatrix< refDim, dim > *vJT=NULL) const
Definition: turbulent_viscosity_fv1.h:321
MathMatrix< dim, dim > dimMat
attachment accessor types
Definition: turbulent_viscosity_fv1.h:229
ANumber m_aVolume
Definition: turbulent_viscosity_fv1.h:271
aVertexTensor m_acDeformation
Definition: turbulent_viscosity_fv1.h:274
TGridFunction::domain_type domain_type
domain type
Definition: turbulent_viscosity_fv1.h:205
number m_c
Definition: turbulent_viscosity_fv1.h:278
static const int dim
world dimension
Definition: turbulent_viscosity_fv1.h:214
PeriodicAttachmentAccessor< Vertex, ANumber > aVertexNumber
Definition: turbulent_viscosity_fv1.h:232
grid_type * m_grid
Definition: turbulent_viscosity_fv1.h:263
virtual ~FV1SmagorinskyTurbViscData()
Definition: turbulent_viscosity_fv1.h:308
SmartPtr< TGridFunction > m_u
Definition: turbulent_viscosity_fv1.h:261
domain_type::position_accessor_type position_accessor_type
position accessor type
Definition: turbulent_viscosity_fv1.h:211
SmartPtr< CplUserData< number, dim > > m_imKinViscosity
Data import for kinematic viscosity.
Definition: turbulent_viscosity_fv1.h:257
domain_type::grid_type grid_type
grid type
Definition: turbulent_viscosity_fv1.h:217
void update()
Definition: turbulent_viscosity_fv1_impl.h:819
void set_kinematic_viscosity(SmartPtr< CplUserData< number, dim > > user)
Definition: turbulent_viscosity_fv1.h:242
void set_kinematic_viscosity(number val)
Definition: turbulent_viscosity_fv1.h:245
TGridFunction::template dim_traits< dim >::grid_base_object elem_type
element type
Definition: turbulent_viscosity_fv1.h:220
PeriodicBoundaryManager * m_pbm
Definition: turbulent_viscosity_fv1.h:284
ANumber m_aTurbulentViscosity
Definition: turbulent_viscosity_fv1.h:267
aVertexNumber m_acVolume
Definition: turbulent_viscosity_fv1.h:270
TGridFunction::template traits< Vertex >::const_iterator VertexIterator
vertex iterator
Definition: turbulent_viscosity_fv1.h:226
SmartPtr< ApproximationSpace< domain_type > > m_spApproxSpace
Definition: turbulent_viscosity_fv1.h:281
TGridFunction::algebra_type algebra_type
algebra type
Definition: turbulent_viscosity_fv1.h:208
FV1SmagorinskyTurbViscData(SmartPtr< ApproximationSpace< domain_type > > approxSpace, SmartPtr< TGridFunction > spGridFct, number c=0.05)
constructor
Definition: turbulent_viscosity_fv1.h:288
static const size_t max_number_of_ips
Definition: turbulent_viscosity_fv1.h:381
void set_model_parameter(number c)
Definition: turbulent_viscosity_fv1.h:316
PeriodicAttachmentAccessor< Vertex, ATensor > aVertexTensor
Definition: turbulent_viscosity_fv1.h:233
ATensor m_aDeformation
Definition: turbulent_viscosity_fv1.h:275
TGridFunction::template dim_traits< dim >::const_iterator ElemIterator
element iterator
Definition: turbulent_viscosity_fv1.h:223
Definition: turbulent_viscosity_fv1.h:62
Attachment< dimMat > ATensor
Definition: turbulent_viscosity_fv1.h:86
virtual void operator()(TData &value, const MathVector< dim > &globIP, number time, int si) const
Definition: turbulent_viscosity_fv1.h:98
domain_type::position_accessor_type position_accessor_type
position accessor type
Definition: turbulent_viscosity_fv1.h:70
void fillAttachment(aVertexDimVector &aaU, SmartPtr< TGridFunction > u)
Definition: turbulent_viscosity_fv1_impl.h:63
virtual bool continuous() const
returns if provided data is continuous over geometric object boundaries
Definition: turbulent_viscosity_fv1.h:148
virtual void compute(LocalVector *u, GridObject *elem, const MathVector< dim > vCornerCoords[], bool bDeriv=false)
Definition: turbulent_viscosity_fv1.h:127
MathVector< dim > vecDim
Definition: turbulent_viscosity_fv1.h:88
virtual void compute(LocalVectorTimeSeries *u, GridObject *elem, const MathVector< dim > vCornerCoords[], bool bDeriv=false)
Definition: turbulent_viscosity_fv1.h:137
const TImpl & getImpl() const
const access to implementation
Definition: turbulent_viscosity_fv1.h:189
domain_type::grid_type grid_type
grid type
Definition: turbulent_viscosity_fv1.h:73
void addUiUjTerm(aVertexTensor &aaDefTensor, const number factor, aVertexDimVector aaU)
Definition: turbulent_viscosity_fv1_impl.h:765
TImpl & getImpl()
access to implementation
Definition: turbulent_viscosity_fv1.h:186
void transferToLowerLevels(aVertexNumber &aaData, ApproximationSpace< domain_type > &approximationSpace)
Definition: turbulent_viscosity_fv1_impl.h:43
void assembleDeformationTensor(aVertexTensor &aaDefTensor, aVertexNumber &aaVol, SmartPtr< TGridFunction > u)
Definition: turbulent_viscosity_fv1_impl.h:504
number FNorm(MathMatrix< dim, dim > M)
Definition: turbulent_viscosity_fv1_impl.h:755
TGridFunction::domain_type domain_type
domain type
Definition: turbulent_viscosity_fv1.h:64
void elementFilter(PeriodicAttachmentAccessor< Vertex, Attachment< VType > > &aaUHat, aVertexNumber &aaVol, const PeriodicAttachmentAccessor< Vertex, Attachment< VType > > &aaU)
Definition: turbulent_viscosity_fv1_impl.h:85
void scaleTensorByNorm(aVertexTensor &aaTensor)
Definition: turbulent_viscosity_fv1_impl.h:619
void evaluate(TData vValue[], const MathVector< dim > vGlobIP[], number time, int si, GridObject *elem, const MathVector< dim > vCornerCoords[], const MathVector< refDim > vLocIP[], const size_t nip, LocalVector *u, const MathMatrix< refDim, dim > *vJT=NULL) const
Definition: turbulent_viscosity_fv1.h:113
SmartPtr< TGridFunction > m_uInfo
Definition: turbulent_viscosity_fv1.h:192
virtual bool requires_grid_fct() const
returns if grid function is needed for evaluation
Definition: turbulent_viscosity_fv1.h:151
SubsetGroup m_turbZeroSg
Definition: turbulent_viscosity_fv1.h:195
Attachment< vecDim > AMathVectorDim
Definition: turbulent_viscosity_fv1.h:89
TGridFunction::algebra_type algebra_type
algebra type
Definition: turbulent_viscosity_fv1.h:67
void scvFilter(PeriodicAttachmentAccessor< Vertex, Attachment< VType > > &aaUHat, aVertexNumber &aaVol, const PeriodicAttachmentAccessor< Vertex, Attachment< VType > > &aaU)
Definition: turbulent_viscosity_fv1_impl.h:292
TGridFunction::template dim_traits< dim >::const_iterator ElemIterator
element iterator
Definition: turbulent_viscosity_fv1.h:79
PeriodicAttachmentAccessor< Vertex, AMathVectorDim > aVertexDimVector
Definition: turbulent_viscosity_fv1.h:93
TGridFunction::template dim_traits< dim >::grid_base_object elem_type
element type
Definition: turbulent_viscosity_fv1.h:76
PeriodicAttachmentAccessor< Vertex, ATensor > aVertexTensor
Definition: turbulent_viscosity_fv1.h:92
PeriodicAttachmentAccessor< Vertex, ANumber > aVertexNumber
Definition: turbulent_viscosity_fv1.h:91
MathMatrix< dim, dim > dimMat
attachment accessor types
Definition: turbulent_viscosity_fv1.h:85
TGridFunction::template traits< Vertex >::const_iterator VertexIterator
vertex iterator
Definition: turbulent_viscosity_fv1.h:82
void setTurbulenceZeroBoundaries(const char *subsets)
Definition: turbulent_viscosity_fv1.h:178
bool access(Grid &g, TAttachment &a)
Grid::VertexAttachmentAccessor< position_attachment_type > position_accessor_type
#define UG_ASSERT(expr, msg)
#define UG_CATCH_THROW(msg)
SmartPtr< T, FreePolicy > make_sp(T *inst)
geometry_traits< TElem >::const_iterator const_iterator