...
 
Commits (2)
......@@ -188,7 +188,8 @@
"LynxADAdvectionTemperature.C": "cpp",
"LynxHeatSources copy.C": "cpp",
"LynxADHeatSources.C": "cpp",
"LynxADPlasticModel.C": "cpp"
"LynxADPlasticModel.C": "cpp",
"LynxDarcyVelocityAux.C": "cpp"
},
"C_Cpp.errorSquiggles": "Disabled",
"python.pythonPath": "/opt/moose/miniconda/bin/python"
......
/******************************************************************************/
/* This file is part of */
/* LYNX, a MOOSE-based application */
/* Lithosphere dYnamic Numerical toolboX */
/* */
/* Copyright (C) 2017 by Antoine B. Jacquey and Mauro Cacace */
/* GFZ Potsdam, German Research Centre for Geosciences */
/* */
/* Licensed under GNU General Public License 3, */
/* please see LICENSE for details */
/* or http://www.gnu.org/licenses/gpl.html */
/******************************************************************************/
#pragma once
#include "AuxKernel.h"
#include "DerivativeMaterialInterface.h"
class LynxDarcyVelocityAux;
template <>
InputParameters validParams<LynxDarcyVelocityAux>();
class LynxDarcyVelocityAux : public DerivativeMaterialInterface<AuxKernel>
{
public:
LynxDarcyVelocityAux(const InputParameters & parameters);
protected:
virtual Real computeValue() override;
const unsigned int _component;
const VariableGradient & _grad_pf;
const MaterialProperty<Real> & _fluid_mobility;
const MaterialProperty<Real> & _rho_f;
const MaterialProperty<RealVectorValue> & _gravity;
};
\ No newline at end of file
/******************************************************************************/
/* This file is part of */
/* LYNX, a MOOSE-based application */
/* Lithosphere dYnamic Numerical toolboX */
/* */
/* Copyright (C) 2017 by Antoine B. Jacquey and Mauro Cacace */
/* GFZ Potsdam, German Research Centre for Geosciences */
/* */
/* Licensed under GNU General Public License 3, */
/* please see LICENSE for details */
/* or http://www.gnu.org/licenses/gpl.html */
/******************************************************************************/
#include "LynxDarcyVelocityAux.h"
registerMooseObject("LynxApp", LynxDarcyVelocityAux);
template <>
InputParameters
validParams<LynxDarcyVelocityAux>()
{
InputParameters params = validParams<AuxKernel>();
params.addClassDescription("Calculates the given component of the Darcy velocity.");
params.addRequiredCoupledVar("fluid_pressure", "The fluid pressure variable.");
params.addRequiredRangeCheckedParam<unsigned int>(
"component",
"component >= 0 & component <= 2",
"Integer corresponding to direction of the Darcy velocity (0, 1, 2.");
return params;
}
LynxDarcyVelocityAux::LynxDarcyVelocityAux(const InputParameters & parameters)
: DerivativeMaterialInterface<AuxKernel>(parameters),
_component(getParam<unsigned int>("component")),
_grad_pf(coupledGradient("fluid_pressure")),
_fluid_mobility(getDefaultMaterialProperty<Real>("fluid_mobility")),
_rho_f(getDefaultMaterialProperty<Real>("fluid_density")),
_gravity(getDefaultMaterialProperty<RealVectorValue>("gravity_vector"))
{
}
Real
LynxDarcyVelocityAux::computeValue()
{
return -_fluid_mobility[_qp] * (_grad_pf[_qp](_component) - _rho_f[_qp] * _gravity[_qp](_component));
}
#[Tests]
# [./damage_accumulation]
# type = 'Exodiff'
# input = 'damage_accumulation.i'
# exodiff = 'damage_accumulation_out.e'
# [../]
# [./damage_inelastic]
# type = 'Exodiff'
# input = 'damage_inelastic.i'
# exodiff = 'damage_inelastic_out.e'
# [../]
# [./damage_inelastic_multiapp]
# type = 'Exodiff'
# input = 'damage_inelastic_master.i'
# exodiff = 'damage_inelastic_master_out.e'
# [../]
# [./damage_convex_compression_vp]
# type = 'Exodiff'
# input = 'damage_convex_compression_vp.i'
# exodiff = 'damage_convex_compression_vp_out.e'
# [../]
#[]
......@@ -29,9 +29,4 @@
input = 'elastic_bending_plate.i'
exodiff = 'elastic_bending_plate_out.e'
[../]
# [./initial_stress]
# type = 'Exodiff'
# input = 'elastic_initial_stress.i'
# exodiff = 'elastic_initial_stress_out.e'
# [../]
[]
\ No newline at end of file
[Mesh]
type = GeneratedMesh
dim = 3
nx = 10
ny = 1
nz = 1
xmin = 0
xmax = 1
ymin = 0
ymax = 0.1
zmin = 0
zmax = 0.1
[]
[Variables]
[./pf]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./darcy_div]
type = LynxADHydroDarcy
variable = pf
[../]
[]
[AuxVariables]
[./darcy_vel_x]
order = CONSTANT
family = MONOMIAL
[../]
[./darcy_vel_y]
order = CONSTANT
family = MONOMIAL
[../]
[./darcy_vel_z]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./darcy_vel_x_aux]
type = LynxDarcyVelocityAux
variable = darcy_vel_x
component = 0
fluid_pressure = pf
[../]
[./darcy_vel_y_aux]
type = LynxDarcyVelocityAux
variable = darcy_vel_y
component = 1
fluid_pressure = pf
[../]
[./darcy_vel_z_aux]
type = LynxDarcyVelocityAux
variable = darcy_vel_z
component = 2
fluid_pressure = pf
[../]
[]
[BCs]
[./left_p1]
type = ADDirichletBC
variable = pf
boundary = 'left'
value = 2.0
[../]
[./right_p0]
type = ADDirichletBC
variable = pf
boundary = 'right'
value = 0.0
[../]
[]
[Materials]
[./hydro_const]
type = LynxADHydroConstant
fluid_viscosity = 1.0
permeability = 0.5
porosity = 0.1
[../]
[]
[Preconditioning]
[./precond]
type = SMP
full = true
petsc_options = '-snes_ksp_ew'
petsc_options_iname = '-ksp_type -pc_type -snes_atol -snes_rtol -snes_max_it -ksp_max_it -sub_pc_type -sub_pc_factor_shift_type'
petsc_options_value = 'gmres asm 1E-05 1E-10 200 500 lu NONZERO'
[../]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
automatic_scaling = true
[]
[Outputs]
perf_graph = true
exodus = true
[]
[Mesh]
type = GeneratedMesh
dim = 3
nx = 1
ny = 1
nz = 10
xmin = 0
xmax = 0.1
ymin = 0
ymax = 0.1
zmin = 0
zmax = 1
[]
[Variables]
[./pf]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./darcy_div]
type = LynxADHydroDarcy
variable = pf
[../]
[]
[AuxVariables]
[./darcy_vel_x]
order = CONSTANT
family = MONOMIAL
[../]
[./darcy_vel_y]
order = CONSTANT
family = MONOMIAL
[../]
[./darcy_vel_z]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./darcy_vel_x_aux]
type = LynxDarcyVelocityAux
variable = darcy_vel_x
component = 0
fluid_pressure = pf
[../]
[./darcy_vel_y_aux]
type = LynxDarcyVelocityAux
variable = darcy_vel_y
component = 1
fluid_pressure = pf
[../]
[./darcy_vel_z_aux]
type = LynxDarcyVelocityAux
variable = darcy_vel_z
component = 2
fluid_pressure = pf
[../]
[]
[BCs]
[./top_p0]
type = ADDirichletBC
variable = pf
boundary = 'front'
value = 0.0
[../]
[./bottom_p1]
type = ADDirichletBC
variable = pf
boundary = 'back'
value = 2.0
[../]
[]
[Materials]
[./hydro_const]
type = LynxADHydroConstant
fluid_viscosity = 1.0
permeability = 0.5
porosity = 0.1
[../]
[./density_const]
type = LynxADDensityConstant
has_gravity = true
gravity_acceleration = 1.0
fluid_density = 1.0
solid_density = 0.0
[../]
[]
[Preconditioning]
[./precond]
type = SMP
full = true
petsc_options = '-snes_ksp_ew'
petsc_options_iname = '-ksp_type -pc_type -snes_atol -snes_rtol -snes_max_it -ksp_max_it -sub_pc_type -sub_pc_factor_shift_type'
petsc_options_value = 'gmres asm 1E-05 1E-10 200 500 lu NONZERO'
[../]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
automatic_scaling = true
[]
[Outputs]
perf_graph = true
exodus = true
[]
[Tests]
[./darcy_vel]
type = 'Exodiff'
input = 'darcy_vel.i'
exodiff = 'darcy_vel_out.e'
[../]
[./darcy_vel_grav]
type = 'Exodiff'
input = 'darcy_vel_grav.i'
exodiff = 'darcy_vel_grav_out.e'
[../]
[]