ExaDG
Loading...
Searching...
No Matches
generalized_newtonian_model.h
1/* ______________________________________________________________________
2 *
3 * ExaDG - High-Order Discontinuous Galerkin for the Exa-Scale
4 *
5 * Copyright (C) 2023 by the ExaDG authors
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 * ______________________________________________________________________
20 */
21
22#ifndef INCLUDE_EXADG_INCOMPRESSIBLE_NAVIER_STOKES_SPATIAL_DISCRETIZATION_GENERALIZED_NEWTONIAN_MODEL_H_
23#define INCLUDE_EXADG_INCOMPRESSIBLE_NAVIER_STOKES_SPATIAL_DISCRETIZATION_GENERALIZED_NEWTONIAN_MODEL_H_
24
25// ExaDG
26#include <exadg/incompressible_navier_stokes/spatial_discretization/viscosity_model_base.h>
27
28namespace ExaDG
29{
30namespace IncNS
31{
32/*
33 * Generalized Newtonian model.
34 */
35template<int dim, typename Number>
37{
38private:
41
42 typedef dealii::LinearAlgebra::distributed::Vector<Number> VectorType;
43
44 typedef dealii::VectorizedArray<Number> scalar;
45 typedef dealii::Tensor<2, dim, dealii::VectorizedArray<Number>> tensor;
46
47 typedef std::pair<unsigned int, unsigned int> Range;
48
49 typedef CellIntegrator<dim, dim, Number> CellIntegratorU;
50 typedef FaceIntegrator<dim, dim, Number> FaceIntegratorU;
51
52public:
57
62
66 void
67 initialize(dealii::MatrixFree<dim, Number> const & matrix_free_in,
68 std::shared_ptr<Operators::ViscousKernel<dim, Number>> viscous_kernel_in,
69 GeneralizedNewtonianModelData const & generalized_newtonian_model_data_in,
70 unsigned int const dof_index_velocity_in);
71
76 void
77 set_viscosity(VectorType const & velocity) const final;
78
82 void
83 add_viscosity(VectorType const & velocity) const final;
84
85private:
86 void
87 cell_loop_set_coefficients(dealii::MatrixFree<dim, Number> const & data,
88 VectorType &,
89 VectorType const & src,
90 Range const & cell_range) const;
91
92 void
93 face_loop_set_coefficients(dealii::MatrixFree<dim, Number> const & data,
94 VectorType &,
95 VectorType const & src,
96 Range const & face_range) const;
97
98 void
99 boundary_face_loop_set_coefficients(dealii::MatrixFree<dim, Number> const & data,
100 VectorType &,
101 VectorType const & src,
102 Range const & face_range) const;
103
121 void
122 add_generalized_newtonian_viscosity(scalar & viscosity, tensor const & velocity_gradient) const;
123
131 scalar
132 compute_viscosity_factor(scalar const & shear_rate) const;
133
134 void
135 generalized_carreau_yasuda_model(scalar & viscosity_factor, scalar const & shear_rate) const;
136
138};
139
140} // namespace IncNS
141} // namespace ExaDG
142
143#endif /* INCLUDE_EXADG_INCOMPRESSIBLE_NAVIER_STOKES_SPATIAL_DISCRETIZATION_GENERALIZED_NEWTONIAN_MODEL_H_ \
144 */
Definition generalized_newtonian_model.h:37
void add_viscosity(VectorType const &velocity) const final
Definition generalized_newtonian_model.cpp:64
void initialize(dealii::MatrixFree< dim, Number > const &matrix_free_in, std::shared_ptr< Operators::ViscousKernel< dim, Number > > viscous_kernel_in, GeneralizedNewtonianModelData const &generalized_newtonian_model_data_in, unsigned int const dof_index_velocity_in)
Definition generalized_newtonian_model.cpp:40
virtual ~GeneralizedNewtonianModel()
Definition generalized_newtonian_model.cpp:34
void set_viscosity(VectorType const &velocity) const final
Definition generalized_newtonian_model.cpp:55
GeneralizedNewtonianModel()
Definition generalized_newtonian_model.cpp:29
Definition viscous_operator.h:49
Definition viscosity_model_base.h:43
Definition driver.cpp:33
Definition viscosity_model_data.h:92