-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Potentially working stokes flow, need a manufactured solution
- Loading branch information
1 parent
0bff60d
commit 951742a
Showing
19 changed files
with
415 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
//* This file is part of the MOOSE framework | ||
//* https://www.mooseframework.org | ||
//* | ||
//* All rights reserved, see COPYRIGHT for full restrictions | ||
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT | ||
//* | ||
//* Licensed under LGPL 2.1, please see LICENSE for details | ||
//* https://www.gnu.org/licenses/lgpl-2.1.html | ||
|
||
#pragma once | ||
|
||
#include "Material.h" | ||
#include "DerivativeMaterialInterface.h" | ||
|
||
/** | ||
* Calculate the simple small strain rate | ||
*/ | ||
class StokesLinearViscous : public DerivativeMaterialInterface<Material> | ||
{ | ||
public: | ||
static InputParameters validParams(); | ||
|
||
StokesLinearViscous(const InputParameters & parameters); | ||
|
||
protected: | ||
/// @brief Calculate the strain | ||
void computeQpProperties() override; | ||
|
||
/// The stress | ||
ADMaterialProperty<RankTwoTensor> & _stress; | ||
|
||
/// The strain rate | ||
const ADMaterialProperty<RankTwoTensor> & _strain_rate; | ||
|
||
/// Power law prefactor | ||
const ADMaterialProperty<Real> & _mu; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
//* This file is part of the MOOSE framework | ||
//* https://www.mooseframework.org | ||
//* | ||
//* All rights reserved, see COPYRIGHT for full restrictions | ||
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT | ||
//* | ||
//* Licensed under LGPL 2.1, please see LICENSE for details | ||
//* https://www.gnu.org/licenses/lgpl-2.1.html | ||
|
||
#pragma once | ||
|
||
#include "Material.h" | ||
#include "DerivativeMaterialInterface.h" | ||
|
||
/** | ||
* Calculate the simple small strain rate | ||
*/ | ||
class StokesPowerLawCreep : public DerivativeMaterialInterface<Material> | ||
{ | ||
public: | ||
static InputParameters validParams(); | ||
|
||
StokesPowerLawCreep(const InputParameters & parameters); | ||
|
||
protected: | ||
/// @brief Calculate the strain | ||
void computeQpProperties() override; | ||
|
||
/// The stress | ||
ADMaterialProperty<RankTwoTensor> & _stress; | ||
|
||
/// The strain rate | ||
const ADMaterialProperty<RankTwoTensor> & _strain_rate; | ||
|
||
/// Power law prefactor | ||
const ADMaterialProperty<Real> & _A; | ||
|
||
/// Power law exponent | ||
const ADMaterialProperty<Real> & _n; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
//* This file is part of the MOOSE framework | ||
//* https://www.mooseframework.org | ||
//* | ||
//* All rights reserved, see COPYRIGHT for full restrictions | ||
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT | ||
//* | ||
//* Licensed under LGPL 2.1, please see LICENSE for details | ||
//* https://www.gnu.org/licenses/lgpl-2.1.html | ||
|
||
#pragma once | ||
|
||
#include "Material.h" | ||
#include "DerivativeMaterialInterface.h" | ||
|
||
/** | ||
* Calculate the simple small strain rate | ||
*/ | ||
class StokesStrainRate : public DerivativeMaterialInterface<Material> | ||
{ | ||
public: | ||
static InputParameters validParams(); | ||
|
||
StokesStrainRate(const InputParameters & parameters); | ||
|
||
protected: | ||
/// @brief Calculate the strain | ||
void computeQpProperties() override; | ||
|
||
/// The strain rate | ||
ADMaterialProperty<RankTwoTensor> & _strain_rate; | ||
|
||
/// The coupled velocity gradient | ||
const ADVectorVariableGradient & _grad_vel; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
//* This file is part of the MOOSE framework | ||
//* https://www.mooseframework.org | ||
//* | ||
//* All rights reserved, see COPYRIGHT for full restrictions | ||
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT | ||
//* | ||
//* Licensed under LGPL 2.1, please see LICENSE for details | ||
//* https://www.gnu.org/licenses/lgpl-2.1.html | ||
#include "StokesLinearViscous.h" | ||
|
||
registerMooseObject("DeerApp", StokesLinearViscous); | ||
|
||
InputParameters | ||
StokesLinearViscous::validParams() | ||
{ | ||
InputParameters params = DerivativeMaterialInterface<Material>::validParams(); | ||
params.addClassDescription("Calculate the stress for Stokes flow using the simple linear model."); | ||
|
||
params.addRequiredParam<MaterialPropertyName>("mu", "Viscosity"); | ||
|
||
params.suppressParameter<bool>("use_displaced_mesh"); | ||
return params; | ||
} | ||
|
||
StokesLinearViscous::StokesLinearViscous(const InputParameters & parameters) | ||
: DerivativeMaterialInterface<Material>(parameters), | ||
_stress(declareADProperty<RankTwoTensor>("stress")), | ||
_strain_rate(getADMaterialPropertyByName<RankTwoTensor>("strain_rate")), | ||
_mu(getADMaterialProperty<Real>("mu")) | ||
{ | ||
} | ||
|
||
void | ||
StokesLinearViscous::computeQpProperties() | ||
{ | ||
_stress[_qp] = _strain_rate[_qp] * _mu[_qp]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
//* This file is part of the MOOSE framework | ||
//* https://www.mooseframework.org | ||
//* | ||
//* All rights reserved, see COPYRIGHT for full restrictions | ||
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT | ||
//* | ||
//* Licensed under LGPL 2.1, please see LICENSE for details | ||
//* https://www.gnu.org/licenses/lgpl-2.1.html | ||
#include "StokesPowerLawCreep.h" | ||
|
||
registerMooseObject("DeerApp", StokesPowerLawCreep); | ||
|
||
InputParameters | ||
StokesPowerLawCreep::validParams() | ||
{ | ||
InputParameters params = DerivativeMaterialInterface<Material>::validParams(); | ||
params.addClassDescription("Calculate the stress for Stokes flow using a power law creep model"); | ||
|
||
params.addRequiredParam<MaterialPropertyName>("A", "Creep prefactor"); | ||
params.addRequiredParam<MaterialPropertyName>("n", "Creep exponent"); | ||
|
||
params.suppressParameter<bool>("use_displaced_mesh"); | ||
return params; | ||
} | ||
|
||
StokesPowerLawCreep::StokesPowerLawCreep(const InputParameters & parameters) | ||
: DerivativeMaterialInterface<Material>(parameters), | ||
_stress(declareADProperty<RankTwoTensor>("stress")), | ||
_strain_rate(getADMaterialPropertyByName<RankTwoTensor>("strain_rate")), | ||
_A(getADMaterialProperty<Real>("A")), | ||
_n(getADMaterialProperty<Real>("n")) | ||
{ | ||
} | ||
|
||
void | ||
StokesPowerLawCreep::computeQpProperties() | ||
{ | ||
auto A = _A[_qp]; | ||
auto n = _n[_qp]; | ||
auto dev_strain_rate = _strain_rate[_qp].deviatoric(); | ||
|
||
auto effective_strain_rate = std::sqrt(2.0 / 3.0 * dev_strain_rate.contract(dev_strain_rate)); | ||
auto effective_stress = std::pow(effective_strain_rate / A, 1.0 / n); | ||
|
||
_stress[_qp] = 2.0 / 3.0 * dev_strain_rate / (A * std::pow(effective_stress, n - 1.0)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
//* This file is part of the MOOSE framework | ||
//* https://www.mooseframework.org | ||
//* | ||
//* All rights reserved, see COPYRIGHT for full restrictions | ||
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT | ||
//* | ||
//* Licensed under LGPL 2.1, please see LICENSE for details | ||
//* https://www.gnu.org/licenses/lgpl-2.1.html | ||
#include "StokesStrainRate.h" | ||
|
||
registerMooseObject("DeerApp", StokesStrainRate); | ||
|
||
InputParameters | ||
StokesStrainRate::validParams() | ||
{ | ||
InputParameters params = DerivativeMaterialInterface<Material>::validParams(); | ||
params.addClassDescription("Calculate the strain rate as the symmetric gradient of the velocity"); | ||
params.addRequiredCoupledVar("velocity", "The vector-valued velocity"); | ||
params.suppressParameter<bool>("use_displaced_mesh"); | ||
return params; | ||
} | ||
|
||
StokesStrainRate::StokesStrainRate(const InputParameters & parameters) | ||
: DerivativeMaterialInterface<Material>(parameters), | ||
_strain_rate(declareADProperty<RankTwoTensor>("strain_rate")), | ||
_grad_vel(adCoupledVectorGradient("velocity")) | ||
|
||
{ | ||
} | ||
|
||
void | ||
StokesStrainRate::computeQpProperties() | ||
{ | ||
_strain_rate[_qp] = 0.5 * (_grad_vel[_qp] + _grad_vel[_qp].transpose()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.