|
33 | 33 |
|
34 | 34 | namespace aspect |
35 | 35 | { |
36 | | - namespace HeatingModel |
37 | | - { |
38 | | - template <int dim> |
39 | | - class ShearHeatingAnisotropicViscosity : public Interface<dim>, public ::aspect::SimulatorAccess<dim> |
40 | | - { |
41 | | - public: |
42 | | - /** |
43 | | - * Compute the heating model outputs for this class. |
44 | | - */ |
45 | | - virtual |
46 | | - void |
47 | | - evaluate (const MaterialModel::MaterialModelInputs<dim> &material_model_inputs, |
48 | | - const MaterialModel::MaterialModelOutputs<dim> &material_model_outputs, |
49 | | - HeatingModel::HeatingModelOutputs &heating_model_outputs) const; |
50 | | - |
51 | | - /** |
52 | | - * Allow the heating model to attach additional material model outputs. |
53 | | - */ |
54 | | - virtual |
55 | | - void |
56 | | - create_additional_material_model_outputs(MaterialModel::MaterialModelOutputs<dim> &material_model_outputs) const; |
57 | | - }; |
58 | | - |
59 | | - template <int dim> |
60 | | - void |
61 | | - ShearHeatingAnisotropicViscosity<dim>:: |
62 | | - evaluate (const MaterialModel::MaterialModelInputs<dim> &material_model_inputs, |
63 | | - const MaterialModel::MaterialModelOutputs<dim> &material_model_outputs, |
64 | | - HeatingModel::HeatingModelOutputs &heating_model_outputs) const |
65 | | - { |
66 | | - Assert(heating_model_outputs.heating_source_terms.size() == material_model_inputs.position.size(), |
67 | | - ExcMessage ("Heating outputs need to have the same number of entries as the material model inputs.")); |
68 | | - |
69 | | - // Some material models provide dislocation viscosities and boundary area work fractions |
70 | | - // as additional material outputs. If they are attached, use them. |
71 | | - const std::shared_ptr<const ShearHeatingOutputs<dim>> shear_heating_out = |
72 | | - material_model_outputs.template get_additional_output_object<ShearHeatingOutputs<dim>>(); |
73 | | - |
74 | | - const std::shared_ptr<const MaterialModel::AnisotropicViscosity<dim>> anisotropic_viscosity = |
75 | | - material_model_outputs.template get_additional_output_object<MaterialModel::AnisotropicViscosity<dim>>(); |
76 | | - |
77 | | - for (unsigned int q=0; q<heating_model_outputs.heating_source_terms.size(); ++q) |
78 | | - { |
79 | | - // If there is an anisotropic viscosity, use it to compute the correct stress |
80 | | - const SymmetricTensor<2,dim> &directed_strain_rate = ((anisotropic_viscosity != nullptr) |
81 | | - ? |
82 | | - anisotropic_viscosity->stress_strain_directors[q] |
83 | | - * material_model_inputs.strain_rate[q] |
84 | | - : |
85 | | - material_model_inputs.strain_rate[q]); |
86 | | - |
87 | | - const SymmetricTensor<2,dim> stress = |
88 | | - 2 * material_model_outputs.viscosities[q] * |
89 | | - (this->get_material_model().is_compressible() |
90 | | - ? |
91 | | - directed_strain_rate - 1./3. * trace(directed_strain_rate) * unit_symmetric_tensor<dim>() |
92 | | - : |
93 | | - directed_strain_rate); |
94 | | - |
95 | | - const SymmetricTensor<2,dim> deviatoric_strain_rate = |
96 | | - (this->get_material_model().is_compressible() |
97 | | - ? |
98 | | - material_model_inputs.strain_rate[q] |
99 | | - - 1./3. * trace(material_model_inputs.strain_rate[q]) * unit_symmetric_tensor<dim>() |
100 | | - : |
101 | | - material_model_inputs.strain_rate[q]); |
102 | | - |
103 | | - heating_model_outputs.heating_source_terms[q] = stress * deviatoric_strain_rate; |
104 | | - |
105 | | - // If shear heating work fractions are provided, reduce the |
106 | | - // overall heating by this amount (which is assumed to be converted into other forms of energy) |
107 | | - if (shear_heating_out != nullptr) |
108 | | - heating_model_outputs.heating_source_terms[q] *= shear_heating_out->shear_heating_work_fractions[q]; |
109 | | - |
110 | | - heating_model_outputs.lhs_latent_heat_terms[q] = 0.0; |
111 | | - } |
112 | | - } |
113 | | - |
114 | | - template <int dim> |
115 | | - void |
116 | | - ShearHeatingAnisotropicViscosity<dim>:: |
117 | | - create_additional_material_model_outputs(MaterialModel::MaterialModelOutputs<dim> &material_model_outputs) const |
118 | | - { |
119 | | - const unsigned int n_points = material_model_outputs.viscosities.size(); |
120 | | - |
121 | | - if (material_model_outputs.template has_additional_output_object<MaterialModel::AnisotropicViscosity<dim>>() == false) |
122 | | - { |
123 | | - material_model_outputs.additional_outputs.push_back( |
124 | | - std::make_unique<MaterialModel::AnisotropicViscosity<dim>> (n_points)); |
125 | | - } |
126 | | - |
127 | | - this->get_material_model().create_additional_named_outputs(material_model_outputs); |
128 | | - } |
129 | | - } |
130 | | - |
131 | 36 | namespace MaterialModel |
132 | 37 | { |
133 | 38 | template <int dim> |
134 | 39 | class Anisotropic : public MaterialModel::Simple<dim> |
135 | 40 | { |
136 | 41 | public: |
137 | | - virtual void initialize(); |
| 42 | + void initialize() override; |
138 | 43 |
|
139 | | - virtual void evaluate(const MaterialModel::MaterialModelInputs<dim> &in, |
140 | | - MaterialModel::MaterialModelOutputs<dim> &out) const; |
| 44 | + void evaluate(const MaterialModel::MaterialModelInputs<dim> &in, |
| 45 | + MaterialModel::MaterialModelOutputs<dim> &out) const override; |
141 | 46 | static void declare_parameters(ParameterHandler &prm); |
142 | | - virtual void parse_parameters(ParameterHandler &prm); |
| 47 | + void parse_parameters(ParameterHandler &prm) override; |
143 | 48 |
|
144 | 49 | /** |
145 | 50 | * Return true if the compressibility() function returns something that |
146 | 51 | * is not zero. |
147 | 52 | */ |
148 | | - virtual bool |
149 | | - is_compressible () const; |
| 53 | + bool |
| 54 | + is_compressible () const override; |
150 | 55 |
|
151 | 56 | private: |
152 | 57 | void set_assemblers(const SimulatorAccess<dim> &, |
@@ -313,18 +218,6 @@ namespace aspect |
313 | 218 | // explicit instantiations |
314 | 219 | namespace aspect |
315 | 220 | { |
316 | | - namespace HeatingModel |
317 | | - { |
318 | | - ASPECT_REGISTER_HEATING_MODEL(ShearHeatingAnisotropicViscosity, |
319 | | - "anisotropic shear heating", |
320 | | - "Implementation of a standard model for shear heating. " |
321 | | - "Adds the term: " |
322 | | - "$ 2 \\eta \\left( \\varepsilon - \\frac{1}{3} \\text{tr} " |
323 | | - "\\varepsilon \\mathbf 1 \\right) : \\left( \\varepsilon - \\frac{1}{3} " |
324 | | - "\\text{tr} \\varepsilon \\mathbf 1 \\right)$ to the " |
325 | | - "right-hand side of the temperature equation.") |
326 | | - } |
327 | | - |
328 | 221 | namespace MaterialModel |
329 | 222 | { |
330 | 223 | ASPECT_REGISTER_MATERIAL_MODEL(Anisotropic, |
|
0 commit comments