33 #ifndef __H__UG__PLUGINS__NAVIER_STOKES__INCOMPRESSIBLE__FV1__STABILIZATION__
34 #define __H__UG__PLUGINS__NAVIER_STOKES__INCOMPRESSIBLE__FV1__STABILIZATION__
38 #define UG_NSSTAB_ASSERT(cond, exp) UG_ASSERT((cond), (exp))
40 #include "../../upwind_interface.h"
104 template <
typename TFVGeom>
108 size_t id = GetUniqueFVGeomID<TFVGeom>();
111 UG_THROW(
"No update function registered for Geometry "<<
id);
130 template <
typename TFVGeom>
139 template <
typename TFVGeom>
200 bStokes, kinVisco, density, pSource,
201 pvCornerValueOldTime, dt);}
288 template <
typename TFVGeom,
typename TAssFunc>
398 template <
typename TFVGeom>
437 static const int dim = TDim;
469 template <
typename TElem>
482 template <
typename TElem>
486 typedef void (
this_type::*TFunc)(
const TGeom* geo,
495 this->
template register_update_func<TGeom, TFunc>(&this_type::template update<TElem>);
519 static const int dim = TDim;
523 using base_type::register_update_func;
524 using base_type::set_vel_comp_connected;
525 using base_type::diff_length_sq_inv;
526 using base_type::stab_shape_vel;
527 using base_type::stab_shape_p;
528 using base_type::stab_vel;
531 using base_type::upwind_conv_length;
532 using base_type::downwind_conv_length;
533 using base_type::upwind_shape_sh;
534 using base_type::downwind_shape_sh;
535 using base_type::non_zero_shape_ip;
536 using base_type::upwind_shape_ip;
537 using base_type::downwind_shape_ip;
544 set_vel_comp_connected(
true);
551 template <
typename TElem>
564 template <
typename TElem>
568 typedef void (
this_type::*TFunc)(
const TGeom* geo,
577 this->
template register_update_func<TGeom, TFunc>(&this_type::template update<TElem>);
597 static const int dim = TDim;
601 using base_type::register_update_func;
602 using base_type::set_vel_comp_connected;
603 using base_type::stab_shape_vel;
604 using base_type::stab_shape_p;
605 using base_type::stab_vel;
612 set_vel_comp_connected(
false);
619 template <
typename TElem>
632 template <
typename TElem>
636 typedef void (
this_type::*TFunc)(
const TGeom* geo,
645 this->
template register_update_func<TGeom, TFunc>(&this_type::template update<TElem>);
function NavierStokes(fcts, subsets, discType)
Definition: stabilization.h:62
MathVector< dim > m_vStabVel[maxNumSCVF]
values of stabilized velocity at ip
Definition: stabilization.h:252
number m_vvvStabShapePressure[maxNumSCVF][dim][maxNumSH]
stab shapes w.r.t pressure
Definition: stabilization.h:261
number m_vvvvStabShapeVel[maxNumSCVF][dim][dim][maxNumSH]
stab shapes w.r.t vel
Definition: stabilization.h:258
static const size_t maxNumSCV
number of SubControlVolumes
Definition: stabilization.h:69
const ConstSmartPtr< INavierStokesUpwind< dim > > & upwind() const
returns the upwind
Definition: stabilization.h:98
void set_vel_comp_connected(bool bVelCompConnected)
sets the vel comp connected flag
Definition: stabilization.h:217
void update(const FVGeometryBase *geo, const LocalVector &vCornerValue, const MathVector< dim > vStdVel[], const bool bStokes, const DataImport< number, dim > &kinVisco, const DataImport< number, dim > &density, const DataImport< MathVector< dim >, dim > *pSource, const LocalVector *pvCornerValueOldTime, number dt)
compute values for new geometry and corner velocities
Definition: stabilization.h:191
number stab_shape_vel(size_t scvf, size_t compOut, size_t compIn, size_t sh) const
Definition: stabilization.h:171
void set_geometry_type()
set the FV1 Geometry type to use for next updates
Definition: stabilization.h:105
size_t num_ip() const
number of integration points
Definition: stabilization.h:154
ConstSmartPtr< INavierStokesUpwind< dim > > m_spConstUpwind
Upwind object (if set), the same as m_spUpwind, but as a const.
Definition: stabilization.h:269
INavierStokesFV1Stabilization()
constructor
Definition: stabilization.h:83
size_t num_sh() const
number of shapes (corners)
Definition: stabilization.h:157
bool vel_comp_connected() const
returns if stab velocity comp depends on other vel components
Definition: stabilization.h:167
size_t m_numSh
number of current shape functions (usually in corners)
Definition: stabilization.h:249
int m_id
id of current geometry type
Definition: stabilization.h:264
size_t m_numScvf
number of current scvf
Definition: stabilization.h:246
number & stab_shape_vel(size_t scvf, size_t compOut, size_t compIn, size_t sh)
Definition: stabilization.h:221
bool m_bVelCompConnected
flag if velocity components are interconnected
Definition: stabilization.h:255
void set_upwind(SmartPtr< INavierStokesUpwind< dim > > spUpwind)
sets the upwind method
Definition: stabilization.h:91
bool upwind_valid() const
returns if the upwind pointer is valid
Definition: stabilization.h:101
void(this_type::* UpdateFunc)(const FVGeometryBase *geo, const LocalVector &vCornerValue, const MathVector< dim > vStdVel[], const bool bStokes, const DataImport< number, dim > &kinVisco, const DataImport< number, dim > &density, const DataImport< MathVector< dim >, dim > *pSource, const LocalVector *pvCornerValueOldTime, number dt)
type of update function
Definition: stabilization.h:277
void compute_downwind(const TFVGeom &geo, const MathVector< dim > vStdVel[])
computes the downwind shapes
Definition: stabilization.h:140
std::vector< UpdateFunc > m_vUpdateFunc
Vector holding all update functions.
Definition: stabilization.h:293
number stab_shape_p(size_t scvf, size_t compOut, size_t sh) const
computed stab shape for pressure.
Definition: stabilization.h:181
static const size_t maxNumSCVF
max number of SubControlVolumeFaces
Definition: stabilization.h:72
SmartPtr< INavierStokesUpwind< dim > > m_spUpwind
Upwind object (if set)
Definition: stabilization.h:267
INavierStokesFV1Stabilization< dim > this_type
abbreviation for own type
Definition: stabilization.h:79
MathVector< dim > & stab_vel(size_t scvf)
stabilized velocity
Definition: stabilization.h:210
void compute_upwind(const TFVGeom &geo, const MathVector< dim > vStdVel[])
computes the upwind shapes
Definition: stabilization.h:131
void register_update_func(TAssFunc func)
register a update function for a Geometry
Definition: stabilization.cpp:69
fv1_dim_traits< dim, dim > traits
used traits
Definition: stabilization.h:65
const MathVector< dim > & stab_vel(size_t scvf) const
stabilized velocity
Definition: stabilization.h:160
number & stab_shape_p(size_t scvf, size_t compOut, size_t sh)
computed stab shape for pressure.
Definition: stabilization.h:231
static const size_t maxNumSH
max number of shape functions
Definition: stabilization.h:75
Definition: stabilization.h:306
void compute_diff_length(const TFVGeom &geo)
computes the diffusion length
Definition: stabilization.cpp:106
number upwind_shape_sh(size_t scvf, size_t sh) const
upwind shape for corner vel
Definition: stabilization.h:358
number downwind_shape_ip(size_t scvf, size_t scvf2) const
upwind shapes for ip vel
Definition: stabilization.h:386
number diff_length_sq_inv(size_t scvf) const
diff length
Definition: stabilization.h:333
number m_vDiffLengthSqInv[this_type::maxNumSCVF]
vector holding diffusion Length squared and inverted
Definition: stabilization.h:410
number downwind_conv_length(size_t scvf) const
Convection Length.
Definition: stabilization.h:351
bool non_zero_shape_ip() const
returns if upwind shape w.r.t. ip vel is non-zero
Definition: stabilization.h:372
DiffusionLength m_diffLengthType
type of diffusion length computation
Definition: stabilization.h:407
number upwind_shape_ip(size_t scvf, size_t scvf2) const
upwind shapes for ip vel
Definition: stabilization.h:379
void set_diffusion_length(std::string diffLength)
sets the type of diff length used for evaluation
Definition: stabilization.cpp:89
INavierStokesSRFV1Stabilization< dim > this_type
Abbreviation for own type.
Definition: stabilization.h:309
number upwind_conv_length(size_t scvf) const
Convection Length.
Definition: stabilization.h:344
DiffusionLength
Definition: stabilization.h:313
@ COR
Definition: stabilization.h:316
@ RAW
Definition: stabilization.h:314
@ FIVEPOINT
Definition: stabilization.h:315
INavierStokesSRFV1Stabilization()
constructor
Definition: stabilization.h:321
number downwind_shape_sh(size_t scvf, size_t sh) const
upwind shape for corner vel
Definition: stabilization.h:365
Definition: upwind_interface.h:57
Definition: stabilization.h:428
INavierStokesSRFV1Stabilization< TDim > base_type
Base class.
Definition: stabilization.h:431
NavierStokesFIELDSStabilization()
constructor
Definition: stabilization.h:459
NavierStokesFIELDSStabilization< TDim > this_type
This class.
Definition: stabilization.h:434
void update(const FV1Geometry< TElem, dim > *geo, const LocalVector &vCornerValue, const MathVector< dim > vStdVel[], const bool bStokes, const DataImport< number, dim > &kinVisco, const DataImport< number, dim > &density, const DataImport< MathVector< dim >, dim > *pSource, const LocalVector *pvCornerValueOldTime, number dt)
update of values for FV1Geometry
Definition: stabilization.cpp:126
static const int dim
Dimension.
Definition: stabilization.h:437
void register_func()
Definition: stabilization.h:483
Definition: stabilization.h:510
INavierStokesSRFV1Stabilization< TDim > base_type
Base class.
Definition: stabilization.h:513
NavierStokesFLOWStabilization()
constructor
Definition: stabilization.h:541
void register_func()
Definition: stabilization.h:565
NavierStokesFLOWStabilization< TDim > this_type
This class.
Definition: stabilization.h:516
Definition: stabilization.h:588
NavierStokesFV1WithoutStabilization()
Constructor.
Definition: stabilization.h:609
NavierStokesFV1WithoutStabilization< TDim > this_type
This class.
Definition: stabilization.h:594
void register_func()
Definition: stabilization.h:633
INavierStokesFV1Stabilization< TDim > base_type
Base class.
Definition: stabilization.h:591
SmartPtr< INavierStokesSRFV1Stabilization< dim > > CreateNavierStokesStabilization(const std::string &name)
creates upwind based on a string identifier
Definition: stabilization.cpp:47
#define UG_NSSTAB_ASSERT(cond, exp)
Definition: stabilization.h:38