Finite Element Domain Decomposition Library
FEDDLib
|
This class is derived from the abstract class DifferentiableFuncClass and should provide functionality to evaluate the viscosity function specified by PowerLaw model (see [1]) More...
#include <PowerLaw_decl.hpp>
Public Types | |
typedef MultiVector< SC, LO, GO, NO > | MultiVector_Type |
typedef Teuchos::RCP< MultiVector_Type > | MultiVectorPtr_Type |
typedef Teuchos::RCP< const MultiVector_Type > | MultiVectorConstPtr_Type |
typedef DifferentiableFuncClass< SC, LO, GO, NO > | DifferentiableFuncClass_Type |
![]() | |
typedef MultiVector< default_sc, default_lo, default_go, default_no > | MultiVector_Type |
typedef Teuchos::RCP< MultiVector_Type > | MultiVectorPtr_Type |
typedef Teuchos::RCP< const MultiVector_Type > | MultiVectorConstPtr_Type |
![]() | |
typedef MultiVector< default_sc, default_lo, default_go, default_no > | MultiVector_Type |
typedef Teuchos::RCP< MultiVector_Type > | MultiVectorPtr_Type |
typedef Teuchos::RCP< const MultiVector_Type > | MultiVectorConstPtr_Type |
Public Member Functions | |
void | setParams (ParameterListPtr_Type params) override |
Each constitutive model includes different material parameters which will be specified in parametersProblem.xml This function should set the specififc needed parameters for each model to the defined values. | |
void | evaluateMapping (ParameterListPtr_Type params, double shearRate, double &viscosity) override |
Update the viscosity according to a chosen shear thinning generalized newtonian constitutive equation. Viscosity depends on spatial coordinates due to its dependency on velocity gradients. | |
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 our functional formulation. IMPORTANT: Here we implement the contribution of this: d(eta)/ d(gamma_Dot) * d(gamma_Dot)*d(Pi_||). For each constitutive model the function looks different and will be defined inside this function. | |
void | echoInformationMapping () override |
Print parameter values used in model at runtime. | |
double | getViscosity () |
PowerLaw (ParameterListPtr_Type parameters) | |
Constructor for CarreauYasuda. | |
![]() | |
virtual void | evaluateMapping (ParameterListPtr_Type params, MultiVectorConstPtr_Type input, MultiVectorPtr_Type &output) override |
Implement a mapping for evaluating output in dependence of given input and specified parameters for MultiVectorPtr_Type inputs/ outputs. | |
virtual void | evaluateDerivative (ParameterListPtr_Type params, MultiVectorConstPtr_Type x, MultiVectorPtr_Type &res) override |
Computes value of derivative of defined function in evaluateMapping. | |
![]() | |
virtual void | updateParams (ParameterListPtr_Type params) |
Set or update the parameters read from the ParameterList. | |
Additional Inherited Members | |
![]() | |
DifferentiableFuncClass (ParameterListPtr_Type parameters) | |
Constructor. | |
![]() | |
InputToOutputMappingClass (ParameterListPtr_Type parameters) | |
Constructor. | |
![]() | |
ParameterListPtr_Type | params_ |
![]() | |
ParameterListPtr_Type | params_ |
This class is derived from the abstract class DifferentiableFuncClass and should provide functionality to evaluate the viscosity function specified by PowerLaw model (see [1])
SC | The scalar type. So far, this is always double, but having it as a template parameter would allow flexibily, e.g., for using complex instead |
LO | The local ordinal type. The is the index type for local indices |
GO | The global ordinal type. The is the index type for global indices |
NO | The Kokkos Node type. This would allow for performance portibility when using Kokkos. Currently, this is not used. |
In general, there are several equations used to describe the material behavior of blood. Here (in this folder), we implement generalized Newtonian constitutive equations that capture the shear-thinning behavior of blood. The chosen shear-thinning model, such as the Power-Law or Carreau-Yasuda model, provides a function to update viscosity, which is no longer constant but depends on the shear rate (and other fixed constant parameters).
In our FEM code, we need an update function for viscosity, depending on the chosen model. If we apply Newton's method or NOX, we also require the directional derivative of the viscosity function, which also depends on the chosen model. Additionally, we need functions to set the required parameters of the chosen model and a function to print the parameter values.
The material parameters can be provided through a Teuchos::ParameterList object, which contains all the parameters specified in the input file 'parametersProblem.xml'. The structure of the input file and, consequently, the resulting parameter list can be chosen freely. The FEDDLib will handle reading the parameters from the file and making them available.
IMPORTANT: Regard e.g. following paper for computation of derivative @article{article_he, author = {He, Xin and Neytcheva, Maya and Vuik, C.}, year = {2015}, month = {06}, pages = {33-58}, title = {On Preconditioning of Incompressible Non-Newtonian Flow Problems}, volume = {33}, journal = {Journal of Computational Mathematics}, doi = {10.4208/jcm.1407-m4486} }
In our Finite Element Method (FEM) assembly, we require the directional derivative of the shear stress term with respect to the velocity vector for Newton's method. Since our viscosity function depends nonlinearly on the shear rate, which in turn depends on velocity, we must account for this contribution. Thus, when assembling the directional derivative term (in AssembleFEGeneralizedNewtonian), we call the function "this->viscosityModel->computeDerivative." It's crucial to note that through the chain rule, we obtain different contributions when computing the directional derivative of eta(gamma_dot) with respect to velocity. The individual terms are, for instance, detailed in the literature paper above. In general one obtain:
d (eta( gamma_Dot(v + eps*delta_v) ) )/ d(eps) |eps=0 = d(eta)/ d(gamma_Dot) * d(gamma_Dot)*d(Pi_||) * d(Pi_||)/ d(D) : d (D(v+eps*delta_v))/d(eps) |eps=0 Here Pi_|| is the second invariant of the strain-rate tensor D(v). In total we get four contributions: IMPORTANT: Consider that the contraction operator : is used in the formula above
For our viscosity models we define our derivative function "computeDerivative" to return the result of d(eta)/ d(gamma_Dot) * d(gamma_Dot)*d(Pi_||), which encompasses the first two contributions dependent on the chosen viscosity model.
FEDD::PowerLaw< SC, LO, GO, NO >::PowerLaw | ( | ParameterListPtr_Type | parameters | ) |
Constructor for CarreauYasuda.
[in] | parameters | Parameterlist for current problem |
|
overridevirtual |
Print parameter values used in model at runtime.
Implements FEDD::DifferentiableFuncClass< default_sc, default_lo, default_go, default_no >.
|
overridevirtual |
For Newton method and NOX we need additional term in Jacobian considering directional derivative of our functional formulation. IMPORTANT: Here we implement the contribution of this: d(eta)/ d(gamma_Dot) * d(gamma_Dot)*d(Pi_||). For each constitutive model the function looks different and will be defined inside this function.
[in] | params | as read from the xml file (maybe redundant) |
[in] | shearRate | scalar value of computed shear rate |
[in,out] | res | scalar value of d(eta)/ d(gamma_Dot) * d(gamma_Dot)*d(Pi_||) |
Implements FEDD::DifferentiableFuncClass< default_sc, default_lo, default_go, default_no >.
|
overridevirtual |
Update the viscosity according to a chosen shear thinning generalized newtonian constitutive equation. Viscosity depends on spatial coordinates due to its dependency on velocity gradients.
[in] | params | as read from the xml file (maybe redundant) |
[in] | shearRate | scalar value of computed shear rate |
[in,out] | viscosity | value of viscosity |
Implements FEDD::DifferentiableFuncClass< default_sc, default_lo, default_go, default_no >.
|
overridevirtual |
Each constitutive model includes different material parameters which will be specified in parametersProblem.xml This function should set the specififc needed parameters for each model to the defined values.
[in] | ParameterList | as read from the xml file (maybe redundant) |
Implements FEDD::DifferentiableFuncClass< default_sc, default_lo, default_go, default_no >.