Skip to content

Commit

Permalink
added compute_strain_rate_and_derivative to ConstViscPrefactors
Browse files Browse the repository at this point in the history
  • Loading branch information
bobmyhill committed Aug 15, 2020
1 parent a097196 commit c865b8e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Expand Up @@ -67,6 +67,15 @@ namespace aspect
compute_viscosity (const double base_viscosity,
const unsigned int composition_index) const;

/**
* Compute the strain rate and first stress derivative
* as a function of stress.
*/
std::pair<double, double>
compute_strain_rate_and_derivative (const double stress,
const double viscosity,
const unsigned int composition_index) const;

private:
/**
* The constant viscosity prefactors, which are read in
Expand Down
12 changes: 12 additions & 0 deletions source/material_model/rheology/constant_viscosity_prefactors.cc
Expand Up @@ -48,6 +48,18 @@ namespace aspect



template <int dim>
std::pair<double, double>
ConstantViscosityPrefactors<dim>::compute_strain_rate_and_derivative (const double stress,
const double viscosity,
const unsigned int composition_index) const
{
const double eta = viscosity * constant_viscosity_prefactors[composition_index];
return std::make_pair(0.5*stress/eta, 0.5/eta);
}



template <int dim>
void
ConstantViscosityPrefactors<dim>::declare_parameters (ParameterHandler &prm)
Expand Down

0 comments on commit c865b8e

Please sign in to comment.