Plugins
turbulent_viscosity_fv1.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013-2015: G-CSC, Goethe University Frankfurt
3  * Author: Christian Wehner
4  *
5  * This file is part of UG4.
6  *
7  * UG4 is free software: you can redistribute it and/or modify it under the
8  * terms of the GNU Lesser General Public License version 3 (as published by the
9  * Free Software Foundation) with the following additional attribution
10  * requirements (according to LGPL/GPL v3 §7):
11  *
12  * (1) The following notice must be displayed in the Appropriate Legal Notices
13  * of covered and combined works: "Based on UG4 (www.ug4.org/license)".
14  *
15  * (2) The following notice must be displayed at a prominent place in the
16  * terminal output of covered works: "Based on UG4 (www.ug4.org/license)".
17  *
18  * (3) The following bibliography is recommended for citation and must be
19  * preserved in all covered files:
20  * "Reiter, S., Vogel, A., Heppner, I., Rupp, M., and Wittum, G. A massively
21  * parallel geometric multigrid solver on hierarchically distributed grids.
22  * Computing and visualization in science 16, 4 (2013), 151-164"
23  * "Vogel, A., Reiter, S., Rupp, M., Nägel, A., and Wittum, G. UG4 -- a novel
24  * flexible software system for simulating pde based models on high performance
25  * computers. Computing and visualization in science 16, 4 (2013), 165-179"
26  *
27  * This program is distributed in the hope that it will be useful,
28  * but WITHOUT ANY WARRANTY; without even the implied warranty of
29  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30  * GNU Lesser General Public License for more details.
31  */
32 
33 #ifndef __H__UG__NAVIER_STOKES__INCOMPRESSIBLE__FV1__TURBULENT_VISCOSITY_DATA_FV1__
34 #define __H__UG__NAVIER_STOKES__INCOMPRESSIBLE__FV1__TURBULENT_VISCOSITY_DATA_FV1__
35 
36 #include "common/common.h"
37 
48 
49 #ifdef UG_FOR_LUA
51 #endif
52 
53 namespace ug{
54 namespace NavierStokes{
55 
59 template <typename TData, int dim, typename TImpl,typename TGridFunction>
61  : public StdUserData<StdTurbulentViscosityDataFV1<TData,dim,TImpl,TGridFunction>, TData,dim>
62 {
64  typedef typename TGridFunction::domain_type domain_type;
65 
67  typedef typename TGridFunction::algebra_type algebra_type;
68 
71 
74 
76  typedef typename TGridFunction::template dim_traits<dim>::grid_base_object elem_type;
77 
79  typedef typename TGridFunction::template dim_traits<dim>::const_iterator ElemIterator;
80 
82  typedef typename TGridFunction::template traits<Vertex>::const_iterator VertexIterator;
83 
87 
90 
94  public:
96  // one value
98  virtual void operator() (TData& value,
99  const MathVector<dim>& globIP,
100  number time, int si) const
101  {
102  UG_THROW("StdTurbulentViscosityDataFV1: Need element.");
103  }
104 
105  virtual void operator() (TData vValue[],
106  const MathVector<dim> vGlobIP[],
107  number time, int si, const size_t nip) const
108  {
109  UG_THROW("StdTurbulentViscosityDataFV1: Need element.");
110  }
111 
112  template <int refDim>
113  void evaluate(TData vValue[],
114  const MathVector<dim> vGlobIP[],
115  number time, int si,
116  GridObject* elem,
117  const MathVector<dim> vCornerCoords[],
118  const MathVector<refDim> vLocIP[],
119  const size_t nip,
120  LocalVector* u,
121  const MathMatrix<refDim, dim>* vJT = NULL) const
122  {
123  getImpl().template evaluate<refDim>(vValue,vGlobIP,time,si,elem,
124  vCornerCoords,vLocIP,nip,u,vJT);
125  }
126 
127  virtual void compute(LocalVector* u, GridObject* elem,
128  const MathVector<dim> vCornerCoords[], bool bDeriv = false)
129  {
130  const int si = this->subset();
131  for(size_t s = 0; s < this->num_series(); ++s)
132  getImpl().template evaluate<dim>(this->values(s), this->ips(s), this->time(s), si,
133  elem, vCornerCoords, this->template local_ips<dim>(s),
134  this->num_ip(s), u);
135  }
136 
137  virtual void compute(LocalVectorTimeSeries* u, GridObject* elem,
138  const MathVector<dim> vCornerCoords[], bool bDeriv = false)
139  {
140  const int si = this->subset();
141  for(size_t s = 0; s < this->num_series(); ++s)
142  getImpl().template evaluate<dim>(this->values(s), this->ips(s), this->time(s), si,
143  elem, vCornerCoords, this->template local_ips<dim>(s),
144  this->num_ip(s), &(u->solution(this->time_point(s))));
145  }
146 
148  virtual bool continuous() const {return false;}
149 
151  virtual bool requires_grid_fct() const {return true;}
152 
155 
157 
158  void addUiUjTerm(aVertexTensor& aaDefTensor,const number factor,aVertexDimVector aaU);
159  void addUiUjTerm(aVertexTensor& aaDefTensor,const number factor,SmartPtr<TGridFunction> u);
160 
161  template <typename VType>
163 
165 
166  template <typename VType>
168 
170 
172 
173  void transferToLowerLevels(aVertexNumber& aaData,ApproximationSpace<domain_type>& approximationSpace);
174 
175  void scaleTensorByNorm(aVertexTensor& aaTensor);
176 
177  // set non-periodic boundaries so that viscosity can be set to zero there
178  void setTurbulenceZeroBoundaries(const char* subsets){
179  try{
180  m_turbZeroSg = m_uInfo->subset_grp_by_name(subsets);
181  }UG_CATCH_THROW("ERROR while parsing Subsets.");
182  }
183 
184  protected:
186  TImpl& getImpl() {return static_cast<TImpl&>(*this);}
187 
189  const TImpl& getImpl() const {return static_cast<const TImpl&>(*this);}
190 
191  // grid function
193 
194  // subset group
196 };
197 
198 
199 template <typename TGridFunction>
201  : public StdTurbulentViscosityDataFV1<number, TGridFunction::dim,
202  FV1SmagorinskyTurbViscData<TGridFunction>,TGridFunction >, virtual public INewtonUpdate
203 {
205  typedef typename TGridFunction::domain_type domain_type;
206 
208  typedef typename TGridFunction::algebra_type algebra_type;
209 
212 
214  static const int dim = domain_type::dim;
215 
218 
220  typedef typename TGridFunction::template dim_traits<dim>::grid_base_object elem_type;
221 
223  typedef typename TGridFunction::template dim_traits<dim>::const_iterator ElemIterator;
224 
226  typedef typename TGridFunction::template traits<Vertex>::const_iterator VertexIterator;
227 
231 
234 
235  public:
243  m_imKinViscosity = user;
244  }
247  }
248  #ifdef UG_FOR_LUA
249  void set_kinematic_viscosity(const char* fctName){
251  }
252  #endif
254 
255  private:
258 
259  private:
260  // grid function
262 
264 
265  // turbulent viscosity attachment
268 
269  // volume attachment
272 
273  // deformation tensor attachment
276 
277  // Smagorinsky model parameter, typical values [0.01 0.1]
279 
280  // approximation space for level and surface grid
282 
283  // periodic boundary manager
285 
286  public:
289  m_c = c;
290  m_u = spGridFct;
291  this->m_uInfo = m_u;
292  m_spApproxSpace = approxSpace;
293  domain_type& domain = *m_u->domain().get();
294  grid_type& grid = *domain.grid();
295  m_grid = &grid;
296  m_pbm = m_grid->periodic_boundary_manager();
297  // attachments
298  grid.template attach_to<Vertex>(m_aTurbulentViscosity);
299  grid.template attach_to<Vertex>(m_aVolume);
300  grid.template attach_to<Vertex>(m_aDeformation);
301  // accessors
305 
306  }
307 
309  domain_type& domain = *m_u->domain().get();
310  grid_type& grid = *domain.grid();
311  grid.template detach_from<Vertex>(m_aTurbulentViscosity);
312  grid.template detach_from<Vertex>(m_aVolume);
313  grid.template detach_from<Vertex>(m_aDeformation);
314  };
315 
317  m_c = c;
318  }
319 
320  template <int refDim>
321  inline void evaluate(number vValue[],
322  const MathVector<dim> vGlobIP[],
323  number time, int si,
324  GridObject* elem,
325  const MathVector<dim> vCornerCoords[],
326  const MathVector<refDim> vLocIP[],
327  const size_t nip,
328  LocalVector* u,
329  const MathMatrix<refDim, dim>* vJT = NULL) const
330  {
331  // reference object id
332  ReferenceObjectID roid = elem->reference_object_id();
333  elem_type* element = static_cast<elem_type*>(elem);
334 
335  UG_ASSERT(dynamic_cast<elem_type*>(elem) != NULL, "Unsupported element type");
336 
337  size_t noc=element->num_vertices();
338 
339  // get trial space
340  try{
341  const LocalShapeFunctionSet<refDim>& rTrialSpace =
342  LocalFiniteElementProvider::get<refDim>(roid, LFEID(LFEID::LAGRANGE, refDim, 1));
343 
344  // memory for shapes
345  std::vector<number> vShape;
346 
347  // loop ips
348  for(size_t ip = 0; ip < nip; ++ip)
349  {
350  // evaluate shapes at ip
351  rTrialSpace.shapes(vShape, vLocIP[ip]);
352 
353  // compute solution at integration point
354  vValue[ip] = 0.0;
355  for(size_t sh = 0; sh < noc; ++sh)
356  {
357  vValue[ip] += vShape[sh] * m_acTurbulentViscosity[element->vertex(sh)];
358  }
359  }
360 
361  }
362  UG_CATCH_THROW("TurbulentViscosityData: trial space missing, Reference Object: "
363  <<roid<<", Trial Space: LAGRANGE 1, refDim="<<refDim);
364 
365  number kinViscValues[max_number_of_ips];
366  (*m_imKinViscosity)(kinViscValues,
367  vGlobIP,
368  time, si,
369  elem,
370  vCornerCoords,
371  vLocIP,
372  nip,
373  u,
374  vJT);
375  for (size_t ip=0;ip < nip;ip++){
376  // UG_LOG("turbVis(" << ip << ")=" << vValue[ip] << "+" << kinViscValues[ip] << "\n");
377  vValue[ip] += kinViscValues[ip];
378  }
379  }
380 
381  static const size_t max_number_of_ips = 20;
382 
383  void update();
384 
385 };
386 
387 template <typename TGridFunction>
389  : public StdTurbulentViscosityDataFV1<number, TGridFunction::dim,
390  FV1DynamicTurbViscData<TGridFunction>,TGridFunction >, virtual public INewtonUpdate
391 {
393  typedef typename TGridFunction::domain_type domain_type;
394 
396  typedef typename TGridFunction::algebra_type algebra_type;
397 
400 
402  static const int dim = domain_type::dim;
403 
406 
408  typedef typename TGridFunction::template dim_traits<dim>::grid_base_object elem_type;
409 
411  typedef typename TGridFunction::template dim_traits<dim>::const_iterator ElemIterator;
412 
414  typedef typename TGridFunction::template traits<Vertex>::const_iterator VertexIterator;
415 
419 
422 
426 
427  public:
435  m_imKinViscosity = user;
436  }
438  m_viscosityNumber = val;
440  }
441  #ifdef UG_FOR_LUA
442  void set_kinematic_viscosity(const char* fctName){
444  }
445  #endif
447 
448  private:
451 
453 
454  static const number m_small;
455 
456  private:
457  // grid function
459 
461 
462  // turbulent viscosity attachment
465 
466  // turbulent model parameter attachment
469 
470  // volume attachment
473 
474  // coarser grid volume attachment
477 
478  // filtered u attachment
481 
482  // deformation tensor attachment
485 
486  // coarser grid deformation tensor attachment
489 
490  // Leonard tensor attachment
493 
494  // Mij tensor attachment
497 
498  // approximation space for level and surface grid
500 
501  // periodic boundary manager
503 
504  public:
507  m_u = spGridFct;
508  this->m_uInfo = m_u;
509  m_spApproxSpace = approxSpace;
510  domain_type& domain = *m_u->domain().get();
511  grid_type& grid = *domain.grid();
512  m_grid = &grid;
513  m_pbm = m_grid->periodic_boundary_manager();
514  // attachments
515  grid.template attach_to<Vertex>(m_aTurbulentViscosity);
516  grid.template attach_to<Vertex>(m_aTurbulentC);
517  grid.template attach_to<Vertex>(m_aVolume);
518  grid.template attach_to<Vertex>(m_aVolumeHat);
519  grid.template attach_to<Vertex>(m_aUHat);
520  grid.template attach_to<Vertex>(m_aDeformation);
521  grid.template attach_to<Vertex>(m_aDeformationHat);
522  grid.template attach_to<Vertex>(m_aLij);
523  grid.template attach_to<Vertex>(m_aMij);
524  // accessors
534  // default setting for filtering of model constant c
535  m_spaceFilter=true;
536  m_timeFilter=false;
537  m_timeFilterEps=1;
538  }
539 
541  domain_type& domain = *m_u->domain().get();
542  grid_type& grid = *domain.grid();
543  grid.template detach_from<Vertex>(m_aTurbulentViscosity);
544  grid.template detach_from<Vertex>(m_aTurbulentC);
545  grid.template detach_from<Vertex>(m_aVolume);
546  grid.template detach_from<Vertex>(m_aVolumeHat);
547  grid.template detach_from<Vertex>(m_aUHat);
548  grid.template detach_from<Vertex>(m_aDeformation);
549  grid.template detach_from<Vertex>(m_aDeformationHat);
550  grid.template detach_from<Vertex>(m_aLij);
551  grid.template detach_from<Vertex>(m_aMij);
552  };
553 
554  template <int refDim>
555  inline void evaluate(number vValue[],
556  const MathVector<dim> vGlobIP[],
557  number time, int si,
558  GridObject* elem,
559  const MathVector<dim> vCornerCoords[],
560  const MathVector<refDim> vLocIP[],
561  const size_t nip,
562  LocalVector* u,
563  const MathMatrix<refDim, dim>* vJT = NULL) const
564  {
565  // reference object id
566  ReferenceObjectID roid = elem->reference_object_id();
567 
568  UG_ASSERT(dynamic_cast<elem_type*>(elem) != NULL, "Unsupported element type");
569  elem_type* element = static_cast<elem_type*>(elem);
570 
571  size_t noc=element->num_vertices();
572 
573  // get trial space
574  try{
575  const LocalShapeFunctionSet<refDim>& rTrialSpace =
576  LocalFiniteElementProvider::get<refDim>(roid, LFEID(LFEID::LAGRANGE, refDim, 1));
577 
578  // memory for shapes
579  std::vector<number> vShape;
580 
581  // loop ips
582  for(size_t ip = 0; ip < nip; ++ip)
583  {
584  // evaluate shapes at ip
585  rTrialSpace.shapes(vShape, vLocIP[ip]);
586 
587  // compute solution at integration point
588  vValue[ip] = 0.0;
589  for(size_t sh = 0; sh < noc; ++sh)
590  {
591  vValue[ip] += vShape[sh] * m_acTurbulentViscosity[element->vertex(sh)];
592  }
593  }
594 
595  }
596  UG_CATCH_THROW("TurbulentViscosityData: trial space missing, Reference Object: "
597  <<roid<<", Trial Space: LAGRANGE 1, refDim="<<refDim);
598 
599  number kinViscValues[max_number_of_ips];
600  (*m_imKinViscosity)(kinViscValues,
601  vGlobIP,
602  time, si,
603  elem,
604  vCornerCoords,
605  vLocIP,
606  nip,
607  u,
608  vJT);
609  for (size_t ip=0;ip < nip;ip++){
610  // UG_LOG("turbVis(" << ip << ")=" << vValue[ip] << "+" << kinViscValues[ip] << "\n");
611  vValue[ip] += kinViscValues[ip];
612  }
613  }
614 
615  static const size_t max_number_of_ips = 20;
616 
620 
621  void update();
622 
623  void set_space_filter(bool b){
624  m_spaceFilter=b;
625  }
626  void set_time_filter(bool b){
627  m_timeFilter=b;
628  m_timeFilterEps=0.001;
629  }
631  if (eps!=1)
632  m_timeFilter=true;
633  else
634  m_timeFilter=false;
635  m_timeFilterEps=eps;
636  }
637 };
638 
639 
640 template <typename TGridFunction>
642 
643 } // namespace NavierStokes
644 } // end namespace ug
645 
646 // include implementation
648 
649 #endif /* __H__UG__NAVIER_STOKES__INCOMPRESSIBLE__FV1__TURBULENT_VISCOSITY_DATA_FV1__ */
function NavierStokes(fcts, subsets, discType)
TGridFunction * get()
TData & value(size_t s, size_t ip)
size_t num_ip(size_t s) const
virtual ReferenceObjectID reference_object_id() const=0
const MathVector< dim > & ip(size_t s, size_t ip) const
int subset() const
number time() 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
SmartPtr< TGrid > grid()
static const int dim
TGrid grid_type
StringTable s
#define UG_ASSERT(expr, msg)
#define UG_CATCH_THROW(msg)
#define UG_THROW(msg)
double number
ReferenceObjectID
SmartPtr< T, FreePolicy > make_sp(T *inst)
geometry_traits< TElem >::const_iterator const_iterator