33 #ifndef __H__UG__PLUGINS__NAVIER_STOKES__INCOMPRESSIBLE__FVCR__TURBULENT_VISCOSITY_DATA__
34 #define __H__UG__PLUGINS__NAVIER_STOKES__INCOMPRESSIBLE__FVCR__TURBULENT_VISCOSITY_DATA__
60 template <
typename TData,
int dim,
typename TImpl,
typename TGr
idFunction>
62 :
public StdUserData<StdTurbulentViscosityData<TData,dim,TImpl,TGridFunction>, TData,dim>
77 typedef typename TGridFunction::template dim_traits<dim>::grid_base_object
elem_type;
83 typedef typename TGridFunction::template dim_traits<dim>::const_iterator
ElemIterator;
86 typedef typename TGridFunction::template traits<side_type>::const_iterator
SideIterator;
105 UG_THROW(
"StdTurbulentViscosityData: Need element.");
112 UG_THROW(
"StdTurbulentViscosityData: Need element.");
131 template <
int refDim>
145 typename grid_type::template traits<side_type>::secure_container sides;
149 m_grid->associated_elements_sorted(sides,
static_cast<elem_type*
>(elem) );
157 std::vector<number> vShape;
160 for(
size_t ip = 0;
ip < nip; ++
ip)
163 rTrialSpace.
shapes(vShape, vLocIP[
ip]);
167 for(
size_t sh = 0; sh < vShape.size(); ++sh)
170 vValue[
ip] += valSH * vShape[sh];
176 UG_CATCH_THROW(
"TurbulentViscosityData: trial space missing, Reference Object: "
177 <<roid<<
", Trial Space: CROUZEIX_RAVIART, refDim="<<refDim);
180 (*m_imKinViscosity)(kinViscValues,
189 for (
size_t ip=0;
ip < nip;
ip++){
191 vValue[
ip] += kinViscValues[
ip];
198 const int si = this->
subset();
201 elem, NULL, this->
template local_ips<dim>(
s),
208 const int si = this->
subset();
211 elem, NULL, this->
template local_ips<dim>(
s),
225 template <
typename VType>
228 template <
typename VType>
246 TImpl&
getImpl() {
return static_cast<TImpl&
>(*this);}
249 const TImpl&
getImpl()
const {
return static_cast<const TImpl&
>(*this);}
289 template <
typename TGr
idFunction>
292 CRSmagorinskyTurbViscData<TGridFunction>,TGridFunction >,
virtual public INewtonUpdate
316 typedef typename TGridFunction::template dim_traits<dim>::grid_base_object
elem_type;
322 typedef typename TGridFunction::template dim_traits<dim>::const_iterator
ElemIterator;
325 typedef typename TGridFunction::template traits<side_type>::const_iterator
SideIterator;
406 template <
typename TGr
idFunction>
409 CRDynamicTurbViscData<TGridFunction>,TGridFunction >,
virtual public INewtonUpdate
433 typedef typename TGridFunction::template dim_traits<dim>::grid_base_object
elem_type;
439 typedef typename TGridFunction::template dim_traits<dim>::const_iterator
ElemIterator;
442 typedef typename TGridFunction::template traits<side_type>::const_iterator
SideIterator;
550 init(approxSpace,spGridFct,
true,1,
true);
554 init(approxSpace,spGridFct,spaceFilter,timeFilter,
true);
558 init(approxSpace,spGridFct,spaceFilter,1,
true);
609 template <
typename TGr
idFunction>
611 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_fvcr.h:410
static const number m_small
Definition: turbulent_viscosity_fvcr.h:457
ANumber m_aVolumeHat
Definition: turbulent_viscosity_fvcr.h:487
virtual ~CRDynamicTurbViscData()
Definition: turbulent_viscosity_fvcr.h:562
ATensor m_aLij
Definition: turbulent_viscosity_fvcr.h:499
void set_space_filter(bool b)
Definition: turbulent_viscosity_fvcr.h:589
MathVector< dim > vecDim
Definition: turbulent_viscosity_fvcr.h:448
TGridFunction::domain_type domain_type
domain type
Definition: turbulent_viscosity_fvcr.h:418
static const number m_kappa
Definition: turbulent_viscosity_fvcr.h:583
TGridFunction::algebra_type algebra_type
algebra type
Definition: turbulent_viscosity_fvcr.h:421
bool m_bAdaptive
Definition: turbulent_viscosity_fvcr.h:585
TGridFunction::template dim_traits< dim >::const_iterator ElemIterator
element iterator
Definition: turbulent_viscosity_fvcr.h:439
ATensor m_aMij
Definition: turbulent_viscosity_fvcr.h:503
SmartPtr< ApproximationSpace< domain_type > > m_spApproxSpace
Definition: turbulent_viscosity_fvcr.h:506
aSideTensor m_acDeformationHat
Definition: turbulent_viscosity_fvcr.h:494
Attachment< vecDim > AMathVectorDim
Definition: turbulent_viscosity_fvcr.h:449
aSideNumber m_acTurbulentCNew
Definition: turbulent_viscosity_fvcr.h:482
aSideTensor m_acMij
Definition: turbulent_viscosity_fvcr.h:502
domain_type::position_accessor_type position_accessor_type
position accessor type
Definition: turbulent_viscosity_fvcr.h:424
PeriodicBoundaryManager * m_pbm
Definition: turbulent_viscosity_fvcr.h:509
number m_timeFilterEps
Definition: turbulent_viscosity_fvcr.h:578
ANumber m_aTurbulentCNew
Definition: turbulent_viscosity_fvcr.h:483
domain_type::grid_type grid_type
grid type
Definition: turbulent_viscosity_fvcr.h:430
bool m_fixedRatio
Definition: turbulent_viscosity_fvcr.h:581
PeriodicAttachmentAccessor< side_type, ATensor > aSideTensor
Definition: turbulent_viscosity_fvcr.h:452
static const int dim
world dimension
Definition: turbulent_viscosity_fvcr.h:427
elem_type::side side_type
side type
Definition: turbulent_viscosity_fvcr.h:436
CRDynamicTurbViscData(SmartPtr< ApproximationSpace< domain_type > > approxSpace, SmartPtr< TGridFunction > spGridFct, bool spaceFilter, number timeFilter)
Definition: turbulent_viscosity_fvcr.h:553
CRDynamicTurbViscData< TGridFunction > this_type
own type
Definition: turbulent_viscosity_fvcr.h:412
aSideNumber m_acVolumeHat
Definition: turbulent_viscosity_fvcr.h:486
bool m_timeFilter
Definition: turbulent_viscosity_fvcr.h:577
CRDynamicTurbViscData(SmartPtr< ApproximationSpace< domain_type > > approxSpace, SmartPtr< TGridFunction > spGridFct, bool spaceFilter, bool timeFilter)
Definition: turbulent_viscosity_fvcr.h:557
AMathVectorDim m_aUHat
Definition: turbulent_viscosity_fvcr.h:491
Attachment< dimMat > ATensor
Definition: turbulent_viscosity_fvcr.h:446
aSideDimVector m_acUHat
Definition: turbulent_viscosity_fvcr.h:490
PeriodicAttachmentAccessor< side_type, AMathVectorDim > aSideDimVector
Definition: turbulent_viscosity_fvcr.h:453
aSideTensor m_acLij
Definition: turbulent_viscosity_fvcr.h:498
void set_time_filter(bool b)
Definition: turbulent_viscosity_fvcr.h:592
SmartPtr< TGridFunction > m_u
Definition: turbulent_viscosity_fvcr.h:461
void init(SmartPtr< ApproximationSpace< domain_type > > approxSpace, SmartPtr< TGridFunction > spGridFct, bool spaceFilter, number timeFilterEps, bool bFixedRatio)
Definition: turbulent_viscosity_fvcr.h:512
TGridFunction::template dim_traits< dim >::grid_base_object elem_type
element type
Definition: turbulent_viscosity_fvcr.h:433
ANumber m_aTurbulentC
Definition: turbulent_viscosity_fvcr.h:479
TGridFunction::template traits< side_type >::const_iterator SideIterator
side iterator
Definition: turbulent_viscosity_fvcr.h:442
void set_time_filter_eps(number eps)
Definition: turbulent_viscosity_fvcr.h:596
StdTurbulentViscosityData< number, TGridFunction::dim, this_type, TGridFunction > base_type
base class type
Definition: turbulent_viscosity_fvcr.h:415
void update()
Definition: turbulent_viscosity_fvcr_impl.h:679
PeriodicAttachmentAccessor< side_type, ANumber > aSideNumber
Definition: turbulent_viscosity_fvcr.h:451
MathSymmetricMatrix< dim > dimMat
attachment accessor types
Definition: turbulent_viscosity_fvcr.h:445
aSideNumber m_acTurbulentC
Definition: turbulent_viscosity_fvcr.h:478
bool m_spaceFilter
Definition: turbulent_viscosity_fvcr.h:574
ATensor m_aDeformationHat
Definition: turbulent_viscosity_fvcr.h:495
CRDynamicTurbViscData(SmartPtr< ApproximationSpace< domain_type > > approxSpace, SmartPtr< TGridFunction > spGridFct)
constructor
Definition: turbulent_viscosity_fvcr.h:548
Definition: turbulent_viscosity_fvcr.h:293
CRSmagorinskyTurbViscData< TGridFunction > this_type
own type
Definition: turbulent_viscosity_fvcr.h:295
number m_c
Definition: turbulent_viscosity_fvcr.h:353
domain_type::position_accessor_type position_accessor_type
position accessor type
Definition: turbulent_viscosity_fvcr.h:307
TGridFunction::domain_type domain_type
domain type
Definition: turbulent_viscosity_fvcr.h:301
TGridFunction::template dim_traits< dim >::const_iterator ElemIterator
element iterator
Definition: turbulent_viscosity_fvcr.h:322
PeriodicAttachmentAccessor< side_type, ATensor > aSideTensor
Definition: turbulent_viscosity_fvcr.h:332
TGridFunction::template traits< side_type >::const_iterator SideIterator
side iterator
Definition: turbulent_viscosity_fvcr.h:325
bool m_bAdaptive
Definition: turbulent_viscosity_fvcr.h:395
void update()
Definition: turbulent_viscosity_fvcr_impl.h:639
virtual ~CRSmagorinskyTurbViscData()
Definition: turbulent_viscosity_fvcr.h:383
domain_type::grid_type grid_type
grid type
Definition: turbulent_viscosity_fvcr.h:313
elem_type::side side_type
side type
Definition: turbulent_viscosity_fvcr.h:319
void set_model_parameter(number c)
Definition: turbulent_viscosity_fvcr.h:391
SmartPtr< TGridFunction > m_u
Definition: turbulent_viscosity_fvcr.h:336
SmartPtr< ApproximationSpace< domain_type > > m_spApproxSpace
Definition: turbulent_viscosity_fvcr.h:356
CRSmagorinskyTurbViscData(SmartPtr< ApproximationSpace< domain_type > > approxSpace, SmartPtr< TGridFunction > spGridFct, number c=0.05)
constructor
Definition: turbulent_viscosity_fvcr.h:363
StdTurbulentViscosityData< number, TGridFunction::dim, this_type, TGridFunction > base_type
base class type
Definition: turbulent_viscosity_fvcr.h:298
MathSymmetricMatrix< dim > dimMat
attachment accessor types
Definition: turbulent_viscosity_fvcr.h:328
static const int dim
world dimension
Definition: turbulent_viscosity_fvcr.h:310
TGridFunction::algebra_type algebra_type
algebra type
Definition: turbulent_viscosity_fvcr.h:304
Attachment< dimMat > ATensor
Definition: turbulent_viscosity_fvcr.h:329
PeriodicBoundaryManager * m_pbm
Definition: turbulent_viscosity_fvcr.h:359
PeriodicAttachmentAccessor< side_type, ANumber > aSideNumber
Definition: turbulent_viscosity_fvcr.h:331
TGridFunction::template dim_traits< dim >::grid_base_object elem_type
element type
Definition: turbulent_viscosity_fvcr.h:316
Definition: turbulent_viscosity_fvcr.h:63
TGridFunction::algebra_type algebra_type
algebra type
Definition: turbulent_viscosity_fvcr.h:68
TImpl & getImpl()
access to implementation
Definition: turbulent_viscosity_fvcr.h:246
ANumber m_aTurbulentViscosity
Definition: turbulent_viscosity_fvcr.h:119
TGridFunction::template traits< side_type >::const_iterator SideIterator
side iterator
Definition: turbulent_viscosity_fvcr.h:86
TGridFunction::domain_type domain_type
domain type
Definition: turbulent_viscosity_fvcr.h:65
Attachment< dimMat > ATensor
Definition: turbulent_viscosity_fvcr.h:90
ATensor m_aDeformation
Definition: turbulent_viscosity_fvcr.h:127
void transferToLowerLevels(aSideNumber &aaData, ApproximationSpace< domain_type > &approximationSpace)
Definition: turbulent_viscosity_fvcr_impl.h:40
static const size_t max_number_of_ips
Definition: turbulent_viscosity_fvcr.h:129
SubsetGroup m_turbZeroSg
Definition: turbulent_viscosity_fvcr.h:255
aSideNumber m_acTurbulentViscosity
Definition: turbulent_viscosity_fvcr.h:118
TGridFunction::template dim_traits< dim >::const_iterator ElemIterator
element iterator
Definition: turbulent_viscosity_fvcr.h:83
virtual bool requires_grid_fct() const
returns if grid function is needed for evaluation
Definition: turbulent_viscosity_fvcr.h:219
void addUiUjTerm(aSideTensor &aaDefTensor, const number factor, SmartPtr< TGridFunction > u, aSideDimVector *aaU)
Definition: turbulent_viscosity_fvcr_impl.h:598
MathSymmetricMatrix< dim > dimMat
attachment accessor types
Definition: turbulent_viscosity_fvcr.h:89
aSideTensor m_acDeformation
Definition: turbulent_viscosity_fvcr.h:126
SmartPtr< TGridFunction > m_uInfo
Definition: turbulent_viscosity_fvcr.h:252
elem_type::side side_type
side type
Definition: turbulent_viscosity_fvcr.h:80
void set_kinematic_viscosity(SmartPtr< CplUserData< number, dim > > user)
Definition: turbulent_viscosity_fvcr.h:266
bool m_bAdaptive
Definition: turbulent_viscosity_fvcr.h:257
void elementFilter(PeriodicAttachmentAccessor< side_type, Attachment< VType > > &aaUHat, aSideNumber &aaVol, SmartPtr< TGridFunction > u, PeriodicAttachmentAccessor< side_type, Attachment< VType > > *aaU)
Definition: turbulent_viscosity_fvcr_impl.h:109
void scaleTensorByNorm(aSideTensor &aaTensor)
Definition: turbulent_viscosity_fvcr_impl.h:575
PeriodicAttachmentAccessor< side_type, AMathVectorDim > aSideDimVector
Definition: turbulent_viscosity_fvcr.h:97
void fillAttachment(aSideDimVector &aaU, SmartPtr< TGridFunction > u)
Definition: turbulent_viscosity_fvcr_impl.h:66
void setTurbulenceZeroBoundaries(const char *subsets)
Definition: turbulent_viscosity_fvcr.h:238
number m_viscosityNumber
Definition: turbulent_viscosity_fvcr.h:284
void set_kinematic_viscosity(number val)
Definition: turbulent_viscosity_fvcr.h:269
SmartPtr< CplUserData< number, dim > > m_imKinViscosity
Data import for kinematic viscosity.
Definition: turbulent_viscosity_fvcr.h:282
virtual void compute(LocalVector *u, GridObject *elem, const MathVector< dim > vCornerCoords[], bool bDeriv=false)
Definition: turbulent_viscosity_fvcr.h:195
grid_type * m_grid
Definition: turbulent_viscosity_fvcr.h:115
PeriodicAttachmentAccessor< side_type, ATensor > aSideTensor
Definition: turbulent_viscosity_fvcr.h:96
void scvFilter(PeriodicAttachmentAccessor< side_type, Attachment< VType > > &aaUHat, aSideNumber &aaVol, SmartPtr< TGridFunction > u, PeriodicAttachmentAccessor< side_type, Attachment< VType > > *aaU)
Definition: turbulent_viscosity_fvcr_impl.h:262
const TImpl & getImpl() const
const access to implementation
Definition: turbulent_viscosity_fvcr.h:249
aSideNumber m_acVolume
Definition: turbulent_viscosity_fvcr.h:122
domain_type::grid_type grid_type
grid type
Definition: turbulent_viscosity_fvcr.h:74
MathVector< dim > vecDim
Definition: turbulent_viscosity_fvcr.h:92
virtual void compute(LocalVectorTimeSeries *u, GridObject *elem, const MathVector< dim > vCornerCoords[], bool bDeriv=false)
Definition: turbulent_viscosity_fvcr.h:205
void assembleDeformationTensor(aSideTensor &aaDefTensor, aSideNumber &aaVol, SmartPtr< TGridFunction > u, aSideDimVector *aaU)
Definition: turbulent_viscosity_fvcr_impl.h:406
domain_type::position_accessor_type position_accessor_type
position accessor type
Definition: turbulent_viscosity_fvcr.h:71
TGridFunction::template dim_traits< dim >::grid_base_object elem_type
element type
Definition: turbulent_viscosity_fvcr.h:77
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_fvcr.h:132
Attachment< vecDim > AMathVectorDim
Definition: turbulent_viscosity_fvcr.h:93
virtual void operator()(TData &value, const MathVector< dim > &globIP, number time, int si) const
Definition: turbulent_viscosity_fvcr.h:101
PeriodicAttachmentAccessor< side_type, ANumber > aSideNumber
Definition: turbulent_viscosity_fvcr.h:95
virtual bool continuous() const
returns if provided data is continuous over geometric object boundaries
Definition: turbulent_viscosity_fvcr.h:216
ANumber m_aVolume
Definition: turbulent_viscosity_fvcr.h:123
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)