13#ifndef __H__UG__LIB_DISC__SPATIAL_DISC__ELEM_DISC__THERMOHALINE_FLOW__FV1__THERMOHALINE_FLOW__
14#define __H__UG__LIB_DISC__SPATIAL_DISC__ELEM_DISC__THERMOHALINE_FLOW__FV1__THERMOHALINE_FLOW__
28#include "../extravol.h"
29#include "../d3f_sss.h"
30#include "../d3f_limex.h"
84template<
typename TDomain>
108 ThermohalineFlow(
const std::vector<std::string>& vFct,
const std::vector<std::string>& vSubset);
245 virtual void prepare_setting(
const std::vector<LFEID>& vLfeID,
bool bNonRegularGrid);
248 void init(
const char* functions);
255 template <
typename TElem>
258 template <
typename TElem>
261 template <
typename TElem>
264 template <
typename TElem>
267 template <
typename TElem>
270 template <
typename TElem>
273 template <
typename TElem>
276 template <
typename TElem>
282 template<
typename TElem>
297 template<
typename TElem>
339 static const size_t _C_ = 0;
342 static const size_t _P_ = 1;
345 static const size_t _T_ = 2;
433 const number* Viscosity_c,
438 template <
typename TElem>
451 template <
typename TElem>
464 template <
typename TElem>
474 std::vector<std::vector<number> > vvvDeriv[]);
477 template <
typename TElem>
490 template <
typename TElem>
503 template <
typename TElem>
513 std::vector<std::vector<number> > vvvDeriv[]);
516 template <
typename TElem>
557 template <
typename TElem>
TDomain::position_type position_type
Finite Volume Element Discretization for Thermohaline Flow.
Definition thermohaline_flow.h:87
void set_upwind_energy(SmartPtr< IConvectionShapes< dim > > shape)
sets the type of upwind for the energy equation
Definition thermohaline_flow_fv1.cpp:61
bool m_BoussinesqEnergy
flag if using boussinesq flow
Definition thermohaline_flow.h:328
MathVector< dim > m_Gravity
constant Gravity, read in once
Definition thermohaline_flow.h:336
static const size_t _T_
abbreviation for local function: temperature
Definition thermohaline_flow.h:345
void set_scheidegger_dispersion(const number alphaLong, const number alphaTrans)
Definition thermohaline_flow_fv1.cpp:326
number m_BoussinesqDensity
Reference Density for the Boussinesq flow case (needed in Energy eq)
Definition thermohaline_flow.h:399
DataImport< MathMatrix< dim, dim >, dim > m_imThermalConductivityScvf
Data import for thermal conductivity.
Definition thermohaline_flow.h:375
SmartPtr< DataExport< number, dim > > m_exTemperature
Export for the temperature.
Definition thermohaline_flow.h:541
void set_boussinesq_density(number den)
sets reference density used for boussinesq flow
Definition thermohaline_flow_fv1.cpp:48
void fsh_elem_loop()
Definition thermohaline_flow_fv1.cpp:1115
bool m_bConsGravity
flag if using Consistent Gravity
Definition thermohaline_flow.h:319
DataImport< number, dim > m_imPorosityScvf
Definition thermohaline_flow.h:363
void set_heat_capacity_fluid(number data)
sets the heat capacity of the fluid-phase
Definition thermohaline_flow_fv1.cpp:351
SmartPtr< CplUserData< number, dim > > brine()
returns the export of brine mass fracture
Definition thermohaline_flow.h:406
void set_mass_density_solid(number data)
sets the mass density of the solid-phase
Definition thermohaline_flow_fv1.cpp:359
void ex_temperature_grad(MathVector< dim > vValue[], const MathVector< dim > vGlobIP[], number time, int si, const LocalVector &u, GridObject *elem, const MathVector< dim > vCornerCoords[], const MathVector< FV1Geometry< TElem, dim >::dim > vLocIP[], const size_t nip, bool bDeriv, std::vector< std::vector< MathVector< dim > > > vvvDeriv[])
computes the value of the gradient of the brine mass fraction
Definition thermohaline_flow_fv1.cpp:950
int m_partialAssMask_Conv
Definition thermohaline_flow.h:566
void prep_elem_loop(const ReferenceObjectID roid, const int si)
Definition thermohaline_flow_fv1.cpp:1009
DataImport< number, dim > m_imOldDensityScv
Definition thermohaline_flow.h:383
void set_volume_stabilization(SmartPtr< FlowVolStabData< TDomain > > volStabData)
sets usage of volume stabilization
Definition thermohaline_flow_fv1.cpp:368
void add_jac_A_elem(LocalMatrix &J, const LocalVector &u, GridObject *elem, const MathVector< dim > vCornerCoords[])
Definition thermohaline_flow_fv1.cpp:1239
SmartPtr< CplUserData< number, dim > > temperature()
returns the export of temperature
Definition thermohaline_flow.h:412
SmartPtr< DataExport< MathVector< dim >, dim > > m_exBrineGrad
Export for the gradient of brine mass fraction.
Definition thermohaline_flow.h:535
SmartPtr< DataExport< MathVector< dim >, dim > > m_exTemperatureGrad
Export for the gradient of temperature.
Definition thermohaline_flow.h:544
DataImport< MathVector< dim >, dim > m_imConstGravity
Data import for gravity (must be constant in current implementation)
Definition thermohaline_flow.h:366
IElemDisc< TDomain > base_type
Base class type.
Definition thermohaline_flow.h:90
void set_sss_manager(SmartPtr< THSingularSourcesAndSinks< dim > > sss_mngr)
set singular sources and sinks
Definition thermohaline_flow.h:238
SmartPtr< FlowVolStabData< TDomain > > m_spVolStabData
the volume stabilization
Definition thermohaline_flow.h:331
SmartPtr< THSingularSourcesAndSinks< dim > > sss_manager()
get singular sources and sinks
Definition thermohaline_flow.h:241
SmartPtr< DataExport< number, dim > > m_exBrine
Export for the brine mass fraction.
Definition thermohaline_flow.h:532
SmartPtr< CplUserData< MathVector< dim >, dim > > pressure_grad()
returns the export of brine mass fracture
Definition thermohaline_flow.h:418
SmartPtr< DataExport< MathVector< dim >, dim > > m_exDarcyVel
Export for the Darcy velocity.
Definition thermohaline_flow.h:529
void set_viscosity(SmartPtr< CplUserData< number, dim > > user)
sets the viscosity tensor
Definition thermohaline_flow_fv1.cpp:251
DataImport< MathMatrix< dim, dim >, dim > m_imDispersionScvf
Data import for Dispersion.
Definition thermohaline_flow.h:389
void ex_darcy_cons_grav(MathVector< dim > vValue[], const MathVector< dim > vGlobIP[], number time, int si, const LocalVector &u, GridObject *elem, const MathVector< dim > vCornerCoords[], const MathVector< FV1Geometry< TElem, dim >::dim > vLocIP[], const size_t nip, bool bDeriv, std::vector< std::vector< MathVector< dim > > > vvvDeriv[])
computes the darcy velocity using consistent gravity
Definition thermohaline_flow_fv1.cpp:584
void init(const char *functions)
Definition thermohaline_flow_fv1.cpp:1966
SmartPtr< IConvectionShapes< dim > > m_spUpwindEnergy
strategy to compute the upwind shapes
Definition thermohaline_flow.h:316
void set_dispersion(SmartPtr< CplUserData< MathMatrix< dim, dim >, dim > > data)
set dispersion
Definition thermohaline_flow_fv1.cpp:318
virtual void prepare_setting(const std::vector< LFEID > &vLfeID, bool bNonRegularGrid)
type of trial space for each function used
Definition thermohaline_flow_fv1.cpp:395
DataImport< MathVector< dim >, dim > m_imPressureGradScvf
Data import for pressure gradient at scvf ips.
Definition thermohaline_flow.h:356
number m_imHeatCapacityFluid
Definition thermohaline_flow.h:393
DataImport< number, dim > m_imPorosityScv
Data import for the reaction term.
Definition thermohaline_flow.h:362
static const size_t _P_
abbreviation for local function: pressure
Definition thermohaline_flow.h:342
DataImport< number, dim > m_imDensityScvf
Definition thermohaline_flow.h:382
DataImport< MathVector< dim >, dim > m_imDarcyVelScvf
Data import for Darcy Velocity.
Definition thermohaline_flow.h:386
base_type::domain_type domain_type
Domain type.
Definition thermohaline_flow.h:97
void ex_temperature(number vValue[], const MathVector< dim > vGlobIP[], number time, int si, const LocalVector &u, GridObject *elem, const MathVector< dim > vCornerCoords[], const MathVector< FV1Geometry< TElem, dim >::dim > vLocIP[], const size_t nip, bool bDeriv, std::vector< std::vector< number > > vvvDeriv[])
computes the value of the brine mass fraction
Definition thermohaline_flow_fv1.cpp:790
DataImport< MathVector< dim >, dim > m_imTemperatureGradScvf
Data import for temperature gradient at scvf ips.
Definition thermohaline_flow.h:359
bool m_BoussinesqFlow
flag if using boussinesq flow
Definition thermohaline_flow.h:325
number m_imMassDensitySolid
Data import for mass density of solid-phase.
Definition thermohaline_flow.h:396
SmartPtr< DataExport< MathVector< dim >, dim > > m_exPressureGrad
Export for the gradient of brine mass fraction.
Definition thermohaline_flow.h:538
DataImport< number, dim > m_imBrineScvf
Data import for brine mass fraction at scvf ips.
Definition thermohaline_flow.h:352
static const int dim
World dimension.
Definition thermohaline_flow.h:100
void ex_brine_grad(MathVector< dim > vValue[], const MathVector< dim > vGlobIP[], number time, int si, const LocalVector &u, GridObject *elem, const MathVector< dim > vCornerCoords[], const MathVector< FV1Geometry< TElem, dim >::dim > vLocIP[], const size_t nip, bool bDeriv, std::vector< std::vector< MathVector< dim > > > vvvDeriv[])
computes the value of the gradient of the brine mass fraction
Definition thermohaline_flow_fv1.cpp:858
DataImport< MathMatrix< dim, dim >, dim > m_imMolDiffusionScvf
Data import for molecular diffusion tensor.
Definition thermohaline_flow.h:372
void ex_pressure_grad(MathVector< dim > vValue[], const MathVector< dim > vGlobIP[], number time, int si, const LocalVector &u, GridObject *elem, const MathVector< dim > vCornerCoords[], const MathVector< FV1Geometry< TElem, dim >::dim > vLocIP[], const size_t nip, bool bDeriv, std::vector< std::vector< MathVector< dim > > > vvvDeriv[])
computes the value of the gradient of the pressure
Definition thermohaline_flow_fv1.cpp:904
void compute_darcy_velocity_ip_std(MathVector< dim > &DarcyVel, const MathMatrix< dim, dim > &Permeability, number Viscosity, const MathVector< dim > &DensityTimesGravity, const MathVector< dim > &PressureGrad, bool compDeriv, MathVector< dim > *DarcyVel_c, MathVector< dim > *DarcyVel_p, MathVector< dim > *DarcyVel_T, const MathVector< dim > *DensityTimesGravity_c, const MathVector< dim > *DensityTimesGravity_T, const number *Viscosity_c, const MathVector< dim > *PressureGrad_p, size_t numSh)
compute darcy velocity at one ip
Definition thermohaline_flow_fv1.cpp:413
SmartPtr< CplUserData< MathVector< dim >, dim > > temperature_grad()
returns the export of temperature gradient
Definition thermohaline_flow.h:415
void set_permeability(SmartPtr< CplUserData< MathMatrix< dim, dim >, dim > > user)
sets the permeability tensor
Definition thermohaline_flow_fv1.cpp:219
void set_density(SmartPtr< CplUserData< number, dim > > data)
set density
Definition thermohaline_flow_fv1.cpp:289
SmartPtr< CplUserData< MathVector< dim >, dim > > darcy_velocity()
returns the export of the darcy velocity
Definition thermohaline_flow.h:403
void set_boussinesq_transport(bool bUse)
sets usage of boussinesq approximation for transport equation
Definition thermohaline_flow.h:114
void set_porosity(SmartPtr< CplUserData< number, dim > > user)
sets the porosity
Definition thermohaline_flow_fv1.cpp:70
void prep_elem(const LocalVector &u, GridObject *elem, const ReferenceObjectID roid, const MathVector< dim > vCornerCoords[])
Definition thermohaline_flow_fv1.cpp:1121
void set_boussinesq_flow(bool bUse)
sets usage of boussinesq approximation for flow equation
Definition thermohaline_flow.h:117
static const size_t _C_
abbreviation for local function: brine mass fraction
Definition thermohaline_flow.h:339
void add_sss_jac_elem(LocalMatrix &J, const LocalVector &u, TElem *elem, const FV1Geometry< TElem, dim > &geo, size_t i, number intensity, number concentration, number temperature, number factor=1)
adds contributions of a singular source or sink to the matrix
Definition thermohaline_flow_fv1.cpp:1160
DataImport< number, dim > m_imDensityScv
Data import for density.
Definition thermohaline_flow.h:381
SmartPtr< CplUserData< MathVector< dim >, dim > > brine_grad()
returns the export of brine mass fracture gradient
Definition thermohaline_flow.h:409
SmartPtr< IConvectionShapes< dim > > m_spUpwind
strategy to compute the upwind shapes
Definition thermohaline_flow.h:313
number m_imHeatCapacitySolid
Data import for Heat capacities.
Definition thermohaline_flow.h:392
void ex_darcy_std(MathVector< dim > vValue[], const MathVector< dim > vGlobIP[], number time, int si, const LocalVector &u, GridObject *elem, const MathVector< dim > vCornerCoords[], const MathVector< FV1Geometry< TElem, dim >::dim > vLocIP[], const size_t nip, bool bDeriv, std::vector< std::vector< MathVector< dim > > > vvvDeriv[])
computes the darcy velocity using consistent gravity
Definition thermohaline_flow_fv1.cpp:493
DataImport< MathMatrix< dim, dim >, dim > m_imPermeabilityScvf
Data import for permeability tensor.
Definition thermohaline_flow.h:369
DataImport< MathVector< dim >, dim > m_imBrineGradScvf
Definition thermohaline_flow.h:353
bool m_bVolStabDataActive
whether the volume stabilization is active (i.e. m_spVolStabData is not SPNULL and active)
Definition thermohaline_flow.h:333
void add_jac_M_elem(LocalMatrix &J, const LocalVector &u, GridObject *elem, const MathVector< dim > vCornerCoords[])
Definition thermohaline_flow_fv1.cpp:1797
void set_thermal_conductivity(SmartPtr< CplUserData< MathMatrix< dim, dim >, dim > > user)
sets the thermal conductivity tensor
Definition thermohaline_flow_fv1.cpp:194
virtual void prep_assemble_loop()
Definition thermohaline_flow_fv1.cpp:995
void set_partial_velocity(int mask)
Definition thermohaline_flow.h:562
void ex_brine(number vValue[], const MathVector< dim > vGlobIP[], number time, int si, const LocalVector &u, GridObject *elem, const MathVector< dim > vCornerCoords[], const MathVector< FV1Geometry< TElem, dim >::dim > vLocIP[], const size_t nip, bool bDeriv, std::vector< std::vector< number > > vvvDeriv[])
computes the value of the brine mass fraction
Definition thermohaline_flow_fv1.cpp:722
SmartPtr< THSingularSourcesAndSinks< dim > > m_sss_mngr
singular sources and sinks manager
Definition thermohaline_flow.h:348
void set_upwind(SmartPtr< IConvectionShapes< dim > > shape)
sets the type of upwind
Definition thermohaline_flow_fv1.cpp:55
bool m_BoussinesqTransport
flag if using boussinesq transport
Definition thermohaline_flow.h:322
void add_def_M_elem(LocalVector &d, const LocalVector &u, GridObject *elem, const MathVector< dim > vCornerCoords[])
Definition thermohaline_flow_fv1.cpp:1880
void register_all_fv1_funcs()
Definition thermohaline_flow_fv1.cpp:2040
void set_heat_capacity_solid(number data)
sets the heat capacity of the solid-phase
Definition thermohaline_flow_fv1.cpp:344
void set_molecular_diffusion(SmartPtr< CplUserData< MathMatrix< dim, dim >, dim > > user)
sets the molecular diffusion tensor
Definition thermohaline_flow_fv1.cpp:169
ThermohalineFlow< TDomain > this_type
own type
Definition thermohaline_flow.h:93
virtual bool requests_local_time_series()
returns if local time series is needed
Definition thermohaline_flow_fv1.cpp:380
void set_gravity(SmartPtr< CplUserData< MathVector< dim >, dim > > user)
sets the gravity vector
Definition thermohaline_flow_fv1.cpp:96
base_type::position_type position_type
Position type.
Definition thermohaline_flow.h:103
void register_fv1_func()
Definition thermohaline_flow_fv1.cpp:2053
void add_rhs_elem(LocalVector &d, GridObject *elem, const MathVector< dim > vCornerCoords[])
Definition thermohaline_flow_fv1.cpp:1935
void add_sss_def_elem(LocalVector &d, const LocalVector &u, TElem *elem, const FV1Geometry< TElem, dim > &geo, size_t i, number intensity, number concentration, number temperature, number factor=1)
adds contributions of a singular source or sink to the defect
Definition thermohaline_flow_fv1.cpp:1580
void add_def_A_elem(LocalVector &d, const LocalVector &u, GridObject *elem, const MathVector< dim > vCornerCoords[])
Definition thermohaline_flow_fv1.cpp:1629
void set_consistent_gravity(bool bUse)
sets usage of consistent gravity
Definition thermohaline_flow_fv1.cpp:41
DataImport< number, dim > m_imViscosityScvf
Data import for viscosity.
Definition thermohaline_flow.h:378
function util d3f parse Viscosity(ViscosityDesc, w)
Definition thermohaline_flow.h:550
RegisterFV1(this_type *pThis)
Definition thermohaline_flow.h:551
this_type * m_pThis
Definition thermohaline_flow.h:552
void operator()(TElem &)
Definition thermohaline_flow.h:553