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