Finite Element Domain Decomposition Library
FEDDLib
Loading...
Searching...
No Matches
Dimless_Carreau_def.hpp
1#ifndef DIMLESS_CARREAU_DEF_hpp
2#define DIMLESS_CARREAU_DEF_hpp
3
4#include "Dimless_Carreau_decl.hpp"
5
6namespace FEDD {
7
8template <class SC, class LO, class GO, class NO>
10DifferentiableFuncClass<SC,LO,GO,NO>(params)
11{
12 this->params_=params;
13 // Reading through parameterlist
14 shearThinningModel_ = this->params_->sublist("Material").get("ShearThinningModel","");
15 characteristicTime = this->params_->sublist("Material").get("Dimless_CharacteristicTime_Lambda",0.); // corresponds to \lambda in the formulas in the literature
16 fluid_index_n = this->params_->sublist("Material").get("Carreau_FluidIndex_n",1.); // corresponds to n in the formulas being the power-law index
17 nu_0 = this->params_->sublist("Material").get("Dimless_ZeroShearRateViscosity_eta0",0.); // is the zero shear-rate viscosity
18 nu_infty = this->params_->sublist("Material").get("Dimless_InftyShearRateViscosity_etaInfty",0.); // is the infnite shear-rate viscosity
19 reference_viscosity = this->params_->sublist("Material").get("Reference_Viscosity",0.);
20 shear_rate_limitZero= this->params_->sublist("Material").get("Numerical_ZeroValue_ShearRate",1e-8);
21
22 viscosity_ = 0.;
23 // TEUCHOS_TEST_FOR_EXCEPTION( true, std::logic_error, "No discretisation Information for Velocity in Navier Stokes Element." );
24
25
26}
27
28template <class SC, class LO, class GO, class NO>
29void Dimless_Carreau<SC,LO,GO,NO>::evaluateMapping(ParameterListPtr_Type params, double shearRate, double &viscosity) {
30
31 viscosity = this->reference_viscosity*( this->nu_infty +(this->nu_0-this->nu_infty)*(std::pow(1.0+std::pow(this->characteristicTime*shearRate,2.0) , (this->fluid_index_n-1.0)/2.0 )));
32 this->viscosity_ = viscosity; // Multiply with reference viscosity to obtain actual viscosity with dimension of reference viscosity [Pa s]
33}
34
35
36
37template <class SC, class LO, class GO, class NO>
38void Dimless_Carreau<SC,LO,GO,NO>::evaluateDerivative(ParameterListPtr_Type params, double shearRate, double &res) {
39
40// The function is composed of d_eta/ d_GammaDot * d_GammaDot/ D_Tau with d_GammaDot * d_GammaDot/ D_Tau= - 2/GammaDot
41// So for a Carreau-like Fluid we do not get the problem that the shear rate is in denominator
42res = (-2.0)*(this->nu_0-this->nu_infty)*(this->fluid_index_n-1.0)*std::pow(this->characteristicTime, 2)*std::pow(1.0+std::pow(this->characteristicTime*shearRate,2.0) , ((this->fluid_index_n-3.0)/2.0) );
43res = this->reference_viscosity*res;
44
45}
46
47
48template <class SC, class LO, class GO, class NO>
49void Dimless_Carreau<SC,LO,GO,NO>::setParams(ParameterListPtr_Type params){
50 this->params_=params;
51 // Reading through parameterlist
52 shearThinningModel_ = this->params_->sublist("Material").get("ShearThinningModel","");
53 characteristicTime = this->params_->sublist("Material").get("Dimless_CharacteristicTime_Lambda",0.); // corresponds to \lambda in the formulas in the literature
54 fluid_index_n = this->params_->sublist("Material").get("Carreau_FluidIndex_n",1.); // corresponds to n in the formulas being the power-law index
55 nu_0 = this->params_->sublist("Material").get("Dimless_ZeroShearRateViscosity_eta0",0.); // is the zero shear-rate viscosity
56 nu_infty = this->params_->sublist("Material").get("Dimless_InftyShearRateViscosity_etaInfty",0.); // is the infnite shear-rate viscosity shear_rate_limitZero= this->params_->sublist("Material").get("Numerical_ZeroValue_ShearRate",1e-8);
57 reference_viscosity = this->params_->sublist("Material").get("Reference_Viscosity",0.);
58
59 }
60
61
62
63
64template <class SC, class LO, class GO, class NO>
66 std::cout << "************************************************************ " <<std::endl;
67 std::cout << "-- Chosen material model ..." << this->shearThinningModel_ << " --- " <<std::endl;
68 std::cout << "-- Specified material parameters:" <<std::endl;
69 std::cout << "-- eta_0:" << this->nu_0 <<std::endl;
70 std::cout << "-- eta_Infty:" << this->nu_infty << std::endl;
71 std::cout << "-- Fluid index n:" << this->fluid_index_n << std::endl;
72 std::cout << "-- Reference viscosity:" << this->reference_viscosity <<std::endl;
73 std::cout << "-- Characteristic time lambda:" << this->characteristicTime << std::endl;
74 std::cout << "************************************************************ " <<std::endl;
75 }
76
77
78
79
80}
81#endif
82
DifferentiableFuncClass(ParameterListPtr_Type parameters)
Definition DifferentiableFuncClass_def.hpp:10
void evaluateDerivative(ParameterListPtr_Type params, double shearRate, double &res) override
For Newton method and NOX we need additional term in Jacobian considering directional derivative of o...
Definition Dimless_Carreau_def.hpp:38
void setParams(ParameterListPtr_Type params) override
Each constitutive model includes different material parameters which will be specified in parametersP...
Definition Dimless_Carreau_def.hpp:49
Dimless_Carreau(ParameterListPtr_Type parameters)
Constructor for Dimless_Carreau.
Definition Dimless_Carreau_def.hpp:9
void evaluateMapping(ParameterListPtr_Type params, double shearRate, double &viscosity) override
Update the viscosity according to a chosen shear thinning generalized newtonian constitutive equation...
Definition Dimless_Carreau_def.hpp:29
void echoInformationMapping() override
Print parameter values used in model at runtime.
Definition Dimless_Carreau_def.hpp:65
Adaptive Mesh Refinement.
Definition AdaptiveMeshRefinement.cpp:5