MOOSE Newsletter (November 2019)
Mesh MetaData Store
MOOSE has gained a new feature that makes it easier to manage mesh related attributes during simulation setup, namely the mesh "MetaData" Store. The purpose of this object is to hold any kind of attribute or property that a developer may wish to publish about the mesh for use in other objects.
There are a few reasons why you may want to use the MetaData store:
- No need to dynamic cast the underlying mesh object to gain access to methods or attributes. - Solves the problem of not having access to MeshGenerator during recover. - No need to handle getting parameters from the mesh differently for normal startup vs recover runs.
Storing properties in the store means that you won't have to dynamic cast the underlying mesh object to get access to specific APIs or properties on your mesh. Another benefit of using the store is that you don't have to treat your normal simulation and recover simulations any differently from one and other. You'll be able to retrieve properties the same way in either case simplifying your startup code. This makes a lot of difference if you are using the MeshGeneration system to build your mesh programatically. The MetaData store is populated very early on recover runs so the data is available during the execution of any custom Actions that you might create.
Interface Material
MOOSE now has the ability to create IntefaceMaterial
objects. InterfaceMaterials
are capable of grabbing element face and neighbor face variable values as well as element face and neighbor face material properties, allowing for creation of truly interfacial properties that are a blend of the quantities on the connected subdomains. An example application of InterfaceMaterials
is for cohesive zone modelling. Example input files include interface_value_material.i, interface_value_material_split_mesh.i, and interface_value_material_split_mesh_stateful.i. Source examples of InterfaceMaterial
derived objects are InterfaceValueMaterial.C and JumpInterfaceMaterial.C. Header examples can be found at InterfaceValueMaterial.h and JumpInterfaceMaterial.h.
/test/tests/materials/interface_material/interface_value_material.i
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 2
xmax = 2
ny = 2
ymax = 2
elem_type = QUAD4
[]
[./subdomain_id]
input = gen
type = SubdomainBoundingBoxGenerator
bottom_left = '1 0 0'
top_right = '2 2 0'
block_id = 1
[../]
[./interface]
type = SideSetsBetweenSubdomainsGenerator
input = subdomain_id
master_block = '0'
paired_block = '1'
new_boundary = 'interface'
[../]
[]
[Variables]
[./u]
block = 0
[../]
[./v]
block = 1
[../]
[]
[Kernels]
[./diff]
type = MatDiffusion
variable = u
diffusivity = 'diffusivity'
block = 0
[../]
[./diff_v]
type = MatDiffusion
variable = v
diffusivity = 'diffusivity'
block = 1
[../]
[]
[InterfaceKernels]
[tied]
type = PenaltyInterfaceDiffusion
variable = u
neighbor_var = v
jump_prop_name = "average_jump"
penalty = 1e6
boundary = 'interface'
[]
[]
[BCs]
[u_left]
type = DirichletBC
boundary = 'left'
variable = u
value = 1
[]
[v_right]
type = DirichletBC
boundary = 'right'
variable = v
value = 0
[]
[]
[Materials]
[./stateful1]
type = StatefulMaterial
block = 0
initial_diffusivity = 1
# outputs = all
[../]
[./stateful2]
type = StatefulMaterial
block = 1
initial_diffusivity = 2
# outputs = all
[../]
[./interface_material_avg]
type = InterfaceValueMaterial
mat_prop_master = diffusivity
mat_prop_slave = diffusivity
var_master = diffusivity_var
var_slave = diffusivity_var
mat_prop_out_basename = diff
boundary = interface
interface_value_type = average
mat_prop_var_out_basename = diff_var
nl_var_master = u
nl_var_slave = v
[../]
[./interface_material_jump_master_minus_slave]
type = InterfaceValueMaterial
mat_prop_master = diffusivity
mat_prop_slave = diffusivity
var_master = diffusivity_var
var_slave = diffusivity_var
mat_prop_out_basename = diff
boundary = interface
interface_value_type = jump_master_minus_slave
mat_prop_var_out_basename = diff_var
nl_var_master = u
nl_var_slave = v
[../]
[./interface_material_jump_slave_minus_master]
type = InterfaceValueMaterial
mat_prop_master = diffusivity
mat_prop_slave = diffusivity
var_master = diffusivity_var
var_slave = diffusivity_var
mat_prop_out_basename = diff
boundary = interface
interface_value_type = jump_slave_minus_master
mat_prop_var_out_basename = diff_var
nl_var_master = u
nl_var_slave = v
[../]
[./interface_material_jump_abs]
type = InterfaceValueMaterial
mat_prop_master = diffusivity
mat_prop_slave = diffusivity
var_master = diffusivity_var
var_slave = diffusivity_var
mat_prop_out_basename = diff
boundary = interface
interface_value_type = jump_abs
mat_prop_var_out_basename = diff_var
nl_var_master = u
nl_var_slave = v
[../]
[./interface_material_master]
type = InterfaceValueMaterial
mat_prop_master = diffusivity
mat_prop_slave = diffusivity
var_master = diffusivity_var
var_slave = diffusivity_var
mat_prop_out_basename = diff
boundary = interface
interface_value_type = master
mat_prop_var_out_basename = diff_var
nl_var_master = u
nl_var_slave = v
[../]
[./interface_material_slave]
type = InterfaceValueMaterial
mat_prop_master = diffusivity
mat_prop_slave = diffusivity
var_master = diffusivity_var
var_slave = diffusivity_var
mat_prop_out_basename = diff
mat_prop_var_out_basename = diff_var
boundary = interface
interface_value_type = slave
nl_var_master = u
nl_var_slave = v
[../]
[]
[AuxKernels]
[./interface_material_avg]
type = MaterialRealAux
property = diff_average
variable = diffusivity_average
boundary = interface
[]
[./interface_material_jump_master_minus_slave]
type = MaterialRealAux
property = diff_jump_master_minus_slave
variable = diffusivity_jump_master_minus_slave
boundary = interface
[]
[./interface_material_jump_slave_minus_master]
type = MaterialRealAux
property = diff_jump_slave_minus_master
variable = diffusivity_jump_slave_minus_master
boundary = interface
[]
[./interface_material_jump_abs]
type = MaterialRealAux
property = diff_jump_abs
variable = diffusivity_jump_abs
boundary = interface
[]
[./interface_material_master]
type = MaterialRealAux
property = diff_master
variable = diffusivity_master
boundary = interface
[]
[./interface_material_slave]
type = MaterialRealAux
property = diff_slave
variable = diffusivity_slave
boundary = interface
[]
[diffusivity_var]
type = MaterialRealAux
property = diffusivity
variable = diffusivity_var
[]
[]
[AuxVariables]
[diffusivity_var]
family = MONOMIAL
order = CONSTANT
[]
[./diffusivity_average]
family = MONOMIAL
order = CONSTANT
[]
[./diffusivity_jump_master_minus_slave]
family = MONOMIAL
order = CONSTANT
[]
[./diffusivity_jump_slave_minus_master]
family = MONOMIAL
order = CONSTANT
[]
[./diffusivity_jump_abs]
family = MONOMIAL
order = CONSTANT
[]
[./diffusivity_master]
family = MONOMIAL
order = CONSTANT
[]
[./diffusivity_slave]
family = MONOMIAL
order = CONSTANT
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
[]
[Outputs]
exodus = true
[]
/test/tests/materials/interface_material/interface_value_material_split_mesh.i
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 2
xmax = 2
ny = 2
ymax = 2
elem_type = QUAD4
[]
[./subdomain_id]
input = gen
type = SubdomainBoundingBoxGenerator
bottom_left = '1 0 0'
top_right = '2 2 0'
block_id = 1
[../]
[./split]
type = BreakMeshByBlockGenerator
input = subdomain_id
[../]
[]
[Variables]
[./u]
block = 0
[../]
[./v]
block = 1
[../]
[]
[Kernels]
[./diff]
type = MatDiffusion
variable = u
diffusivity = 'diffusivity'
block = 0
[../]
[./diff_v]
type = MatDiffusion
variable = v
diffusivity = 'diffusivity'
block = 1
[../]
[]
[InterfaceKernels]
[tied]
type = PenaltyInterfaceDiffusion
variable = u
neighbor_var = v
jump_prop_name = "average_jump"
penalty = 1e6
boundary = 'interface'
[]
[]
[BCs]
[u_left]
type = DirichletBC
boundary = 'left'
variable = u
value = 1
[]
[v_right]
type = DirichletBC
boundary = 'right'
variable = v
value = 0
[]
[]
[Materials]
[./stateful1]
type = StatefulMaterial
block = 0
initial_diffusivity = 1
# outputs = all
[../]
[./stateful2]
type = StatefulMaterial
block = 1
initial_diffusivity = 2
# outputs = all
[../]
[./interface_material_avg]
type = InterfaceValueMaterial
mat_prop_master = diffusivity
mat_prop_slave = diffusivity
var_master = diffusivity_var
var_slave = diffusivity_var
mat_prop_out_basename = diff
boundary = interface
interface_value_type = average
mat_prop_var_out_basename = diff_var
nl_var_master = u
nl_var_slave = v
[../]
[./interface_material_jump_master_minus_slave]
type = InterfaceValueMaterial
mat_prop_master = diffusivity
mat_prop_slave = diffusivity
var_master = diffusivity_var
var_slave = diffusivity_var
mat_prop_out_basename = diff
boundary = interface
interface_value_type = jump_master_minus_slave
mat_prop_var_out_basename = diff_var
nl_var_master = u
nl_var_slave = v
[../]
[./interface_material_jump_slave_minus_master]
type = InterfaceValueMaterial
mat_prop_master = diffusivity
mat_prop_slave = diffusivity
var_master = diffusivity_var
var_slave = diffusivity_var
mat_prop_out_basename = diff
boundary = interface
interface_value_type = jump_slave_minus_master
mat_prop_var_out_basename = diff_var
nl_var_master = u
nl_var_slave = v
[../]
[./interface_material_jump_abs]
type = InterfaceValueMaterial
mat_prop_master = diffusivity
mat_prop_slave = diffusivity
var_master = diffusivity_var
var_slave = diffusivity_var
mat_prop_out_basename = diff
boundary = interface
interface_value_type = jump_abs
mat_prop_var_out_basename = diff_var
nl_var_master = u
nl_var_slave = v
[../]
[./interface_material_master]
type = InterfaceValueMaterial
mat_prop_master = diffusivity
mat_prop_slave = diffusivity
var_master = diffusivity_var
var_slave = diffusivity_var
mat_prop_out_basename = diff
boundary = interface
interface_value_type = master
mat_prop_var_out_basename = diff_var
nl_var_master = u
nl_var_slave = v
[../]
[./interface_material_slave]
type = InterfaceValueMaterial
mat_prop_master = diffusivity
mat_prop_slave = diffusivity
var_master = diffusivity_var
var_slave = diffusivity_var
mat_prop_out_basename = diff
mat_prop_var_out_basename = diff_var
boundary = interface
interface_value_type = slave
nl_var_master = u
nl_var_slave = v
[../]
[]
[AuxKernels]
[./interface_material_avg]
type = MaterialRealAux
property = diff_average
variable = diffusivity_average
boundary = interface
[]
[./interface_material_jump_master_minus_slave]
type = MaterialRealAux
property = diff_jump_master_minus_slave
variable = diffusivity_jump_master_minus_slave
boundary = interface
[]
[./interface_material_jump_slave_minus_master]
type = MaterialRealAux
property = diff_jump_slave_minus_master
variable = diffusivity_jump_slave_minus_master
boundary = interface
[]
[./interface_material_jump_abs]
type = MaterialRealAux
property = diff_jump_abs
variable = diffusivity_jump_abs
boundary = interface
[]
[./interface_material_master]
type = MaterialRealAux
property = diff_master
variable = diffusivity_master
boundary = interface
[]
[./interface_material_slave]
type = MaterialRealAux
property = diff_slave
variable = diffusivity_slave
boundary = interface
[]
[diffusivity_var]
type = MaterialRealAux
property = diffusivity
variable = diffusivity_var
[]
[]
[AuxVariables]
[diffusivity_var]
family = MONOMIAL
order = CONSTANT
[]
[./diffusivity_average]
family = MONOMIAL
order = CONSTANT
[]
[./diffusivity_jump_master_minus_slave]
family = MONOMIAL
order = CONSTANT
[]
[./diffusivity_jump_slave_minus_master]
family = MONOMIAL
order = CONSTANT
[]
[./diffusivity_jump_abs]
family = MONOMIAL
order = CONSTANT
[]
[./diffusivity_master]
family = MONOMIAL
order = CONSTANT
[]
[./diffusivity_slave]
family = MONOMIAL
order = CONSTANT
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
[]
[Outputs]
exodus = true
[]
/test/tests/materials/interface_material/interface_value_material_split_mesh_stateful.i
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 2
xmax = 2
ny = 2
ymax = 2
elem_type = QUAD4
[]
[./subdomain_id]
input = gen
type = SubdomainBoundingBoxGenerator
bottom_left = '1 0 0'
top_right = '2 2 0'
block_id = 1
[../]
[./split]
type = BreakMeshByBlockGenerator
input = subdomain_id
[../]
[]
[Variables]
[./u]
block = 0
[../]
[./v]
block = 1
[../]
[]
[Kernels]
[./diff]
type = MatDiffusion
variable = u
diffusivity = 'diffusivity'
block = 0
[../]
[./diff_v]
type = MatDiffusion
variable = v
diffusivity = 'diffusivity'
block = 1
[../]
[]
[InterfaceKernels]
[tied]
type = PenaltyInterfaceDiffusion
variable = u
neighbor_var = v
penalty = 1e6
jump_prop_name = "average_jump"
boundary = 'interface'
[]
[]
[BCs]
[u_left]
type = DirichletBC
boundary = 'left'
variable = u
value = 1
[]
[v_right]
type = DirichletBC
boundary = 'right'
variable = v
value = 0
[]
[]
[Materials]
[./stateful1]
type = StatefulMaterial
block = 0
initial_diffusivity = 1
# outputs = all
[../]
[./stateful2]
type = StatefulMaterial
block = 1
initial_diffusivity = 2
# outputs = all
[../]
[./interface_material_avg]
type = InterfaceValueMaterial
mat_prop_master = diffusivity
mat_prop_slave = diffusivity
var_master = diffusivity_var
var_slave = diffusivity_var
mat_prop_out_basename = diff
boundary = interface
interface_value_type = average
mat_prop_var_out_basename = diff_var
nl_var_master = u
nl_var_slave = v
couple_old_values_and_properties = true
[../]
[./interface_material_jump_master_minus_slave]
type = InterfaceValueMaterial
mat_prop_master = diffusivity
mat_prop_slave = diffusivity
var_master = diffusivity_var
var_slave = diffusivity_var
mat_prop_out_basename = diff
boundary = interface
interface_value_type = jump_master_minus_slave
mat_prop_var_out_basename = diff_var
nl_var_master = u
nl_var_slave = v
couple_old_values_and_properties = true
[../]
[./interface_material_jump_slave_minus_master]
type = InterfaceValueMaterial
mat_prop_master = diffusivity
mat_prop_slave = diffusivity
var_master = diffusivity_var
var_slave = diffusivity_var
mat_prop_out_basename = diff
boundary = interface
interface_value_type = jump_slave_minus_master
mat_prop_var_out_basename = diff_var
nl_var_master = u
nl_var_slave = v
couple_old_values_and_properties = true
[../]
[./interface_material_jump_abs]
type = InterfaceValueMaterial
mat_prop_master = diffusivity
mat_prop_slave = diffusivity
var_master = diffusivity_var
var_slave = diffusivity_var
mat_prop_out_basename = diff
boundary = interface
interface_value_type = jump_abs
mat_prop_var_out_basename = diff_var
nl_var_master = u
nl_var_slave = v
couple_old_values_and_properties = true
[../]
[./interface_material_master]
type = InterfaceValueMaterial
mat_prop_master = diffusivity
mat_prop_slave = diffusivity
var_master = diffusivity_var
var_slave = diffusivity_var
mat_prop_out_basename = diff
boundary = interface
interface_value_type = master
mat_prop_var_out_basename = diff_var
nl_var_master = u
nl_var_slave = v
couple_old_values_and_properties = true
[../]
[./interface_material_slave]
type = InterfaceValueMaterial
mat_prop_master = diffusivity
mat_prop_slave = diffusivity
var_master = diffusivity_var
var_slave = diffusivity_var
mat_prop_out_basename = diff
mat_prop_var_out_basename = diff_var
boundary = interface
interface_value_type = slave
nl_var_master = u
nl_var_slave = v
couple_old_values_and_properties = true
[../]
[]
[AuxKernels]
[./interface_material_avg]
type = MaterialRealAux
property = diff_average
variable = diffusivity_average
boundary = interface
[]
[./interface_material_jump_master_minus_slave]
type = MaterialRealAux
property = diff_jump_master_minus_slave
variable = diffusivity_jump_master_minus_slave
boundary = interface
[]
[./interface_material_jump_slave_minus_master]
type = MaterialRealAux
property = diff_jump_slave_minus_master
variable = diffusivity_jump_slave_minus_master
boundary = interface
[]
[./interface_material_jump_abs]
type = MaterialRealAux
property = diff_jump_abs
variable = diffusivity_jump_abs
boundary = interface
[]
[./interface_material_master]
type = MaterialRealAux
property = diff_master
variable = diffusivity_master
boundary = interface
[]
[./interface_material_slave]
type = MaterialRealAux
property = diff_slave
variable = diffusivity_slave
boundary = interface
[]
[./interface_material_avg_prev]
type = MaterialRealAux
property = diff_average_prev
variable = diffusivity_average_prev
boundary = interface
[]
[./interface_material_jump_master_minus_slave_prev]
type = MaterialRealAux
property = diff_jump_master_minus_slave_prev
variable = diffusivity_jump_master_minus_slave_prev
boundary = interface
[]
[./interface_material_jump_slave_minus_master_prev]
type = MaterialRealAux
property = diff_jump_slave_minus_master_prev
variable = diffusivity_jump_slave_minus_master_prev
boundary = interface
[]
[./interface_material_jump_abs_prev]
type = MaterialRealAux
property = diff_jump_abs_prev
variable = diffusivity_jump_abs_prev
boundary = interface
[]
[./interface_material_master_prev]
type = MaterialRealAux
property = diff_master_prev
variable = diffusivity_master_prev
boundary = interface
[]
[./interface_material_slave_prev]
type = MaterialRealAux
property = diff_slave_prev
variable = diffusivity_slave_prev
boundary = interface
[]
[diffusivity_var]
type = MaterialRealAux
property = diffusivity
variable = diffusivity_var
[]
[]
[AuxVariables]
[diffusivity_var]
family = MONOMIAL
order = CONSTANT
[]
[./diffusivity_average]
family = MONOMIAL
order = CONSTANT
[]
[./diffusivity_jump_master_minus_slave]
family = MONOMIAL
order = CONSTANT
[]
[./diffusivity_jump_slave_minus_master]
family = MONOMIAL
order = CONSTANT
[]
[./diffusivity_jump_abs]
family = MONOMIAL
order = CONSTANT
[]
[./diffusivity_master]
family = MONOMIAL
order = CONSTANT
[]
[./diffusivity_slave]
family = MONOMIAL
order = CONSTANT
[]
[./diffusivity_average_prev]
family = MONOMIAL
order = CONSTANT
[]
[./diffusivity_jump_master_minus_slave_prev]
family = MONOMIAL
order = CONSTANT
[]
[./diffusivity_jump_slave_minus_master_prev]
family = MONOMIAL
order = CONSTANT
[]
[./diffusivity_jump_abs_prev]
family = MONOMIAL
order = CONSTANT
[]
[./diffusivity_master_prev]
family = MONOMIAL
order = CONSTANT
[]
[./diffusivity_slave_prev]
family = MONOMIAL
order = CONSTANT
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
num_steps = 3
dt = 0.5
[]
[Outputs]
exodus = true
[]
/test/src/materials/InterfaceValueMaterial.C
// 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 "InterfaceValueMaterial.h"
#include "InterfaceValueTools.h"
registerMooseObject("MooseTestApp", InterfaceValueMaterial);
InputParameters
InterfaceValueMaterial::validParams()
{
InputParameters params = InterfaceMaterial::validParams();
params.addClassDescription("Calculates a variable's jump value across an interface.");
params.addRequiredParam<std::string>("mat_prop_master",
"The material property on the master side of the interface");
params.addRequiredParam<std::string>("mat_prop_slave",
"The material property on the slave side of the interface");
params.addRequiredParam<std::string>("mat_prop_out_basename",
"The base name for the output material property");
params.addRequiredCoupledVar(
"var_master",
"A variable on the master side of the interface that should be equivalent to the value of "
"the master material property (through MaterialRealAux for example");
params.addRequiredCoupledVar(
"var_slave",
"A variable on the slave side of the interface that should be equivalent to the value of "
"the slave material property (through MaterialRealAux for example");
params.addRequiredCoupledVar("nl_var_master",
"Master side non-linear variable for jump computation");
params.addRequiredCoupledVar("nl_var_slave",
"Slave side non-linear variable for jump computation");
params.addRequiredParam<std::string>("mat_prop_var_out_basename",
"The base name for the output material property");
params.addParam<MooseEnum>("interface_value_type",
InterfaceValueTools::InterfaceAverageOptions(),
"Type of scalar output");
params.addParam<bool>("couple_old_values_and_properties",
false,
"get also old variable and material properties values");
return params;
}
InterfaceValueMaterial::InterfaceValueMaterial(const InputParameters & parameters)
: InterfaceMaterial(parameters),
_mp_master_name(getParam<std::string>("mat_prop_master")),
_mp_slave_name(getParam<std::string>("mat_prop_slave")),
_mp_master(getMaterialPropertyByName<Real>(_mp_master_name)),
_mp_slave(getNeighborMaterialPropertyByName<Real>(_mp_slave_name)),
_var_master(coupledValue("var_master")),
_var_slave(coupledNeighborValue("var_slave")),
_nl_var_master(coupledValue("nl_var_master")),
_nl_var_slave(coupledNeighborValue("nl_var_slave")),
_couple_old_values_and_properties(getParam<bool>("couple_old_values_and_properties")),
_mp_master_old(_couple_old_values_and_properties
? &getMaterialPropertyOldByName<Real>(_mp_master_name)
: nullptr),
_mp_slave_old(_couple_old_values_and_properties
? &getNeighborMaterialPropertyOld<Real>(_mp_slave_name)
: nullptr),
_var_master_old(_couple_old_values_and_properties ? &coupledValueOld("var_master") : nullptr),
_var_slave_old(_couple_old_values_and_properties ? &coupledNeighborValueOld("var_slave")
: nullptr),
_nl_var_master_old(_couple_old_values_and_properties ? &coupledValueOld("nl_var_master")
: nullptr),
_nl_var_slave_old(_couple_old_values_and_properties ? &coupledNeighborValueOld("nl_var_slave")
: nullptr),
_interface_value_type(parameters.get<MooseEnum>("interface_value_type")),
_mp_out_base_name(getParam<std::string>("mat_prop_out_basename")),
_mp_var_out_base_name(getParam<std::string>("mat_prop_var_out_basename")),
_interface_value(
declareProperty<Real>(_mp_out_base_name + "_" + std::string(_interface_value_type))),
_interface_value_2(
declareProperty<Real>(_mp_var_out_base_name + "_" + std::string(_interface_value_type))),
_interface_value_old(
getMaterialPropertyOld<Real>(_mp_out_base_name + "_" + std::string(_interface_value_type))),
_interface_value_2_old(getMaterialPropertyOld<Real>(_mp_var_out_base_name + "_" +
std::string(_interface_value_type))),
_interface_value_prev(declareProperty<Real>(_mp_out_base_name + "_" +
std::string(_interface_value_type) + "_prev")),
_interface_value_prev_2(declareProperty<Real>(_mp_var_out_base_name + "_" +
std::string(_interface_value_type) + "_prev_2")),
_jump(declareProperty<Real>(std::string(_interface_value_type) + "_jump")),
_jump_prev(declareProperty<Real>(std::string(_interface_value_type) + "_jump_prev"))
{
}
void
InterfaceValueMaterial::computeQpProperties()
{
mooseAssert(_mp_master[_qp] == _var_master[_qp],
"the material property and variable values on the master side do not coincide.");
mooseAssert(_mp_slave[_qp] == _var_slave[_qp],
"the material property and variable values on the slave side do not coincide.");
_interface_value[_qp] =
InterfaceValueTools::getQuantity(_interface_value_type, _mp_master[_qp], _mp_slave[_qp]);
_interface_value_2[_qp] =
InterfaceValueTools::getQuantity(_interface_value_type, _var_master[_qp], _var_slave[_qp]);
_jump[_qp] = _nl_var_master[_qp] - _nl_var_slave[_qp];
if (_couple_old_values_and_properties)
{
_interface_value_prev[_qp] = InterfaceValueTools::getQuantity(
_interface_value_type, (*_mp_master_old)[_qp], (*_mp_slave_old)[_qp]);
_interface_value_prev_2[_qp] = InterfaceValueTools::getQuantity(
_interface_value_type, (*_var_master_old)[_qp], (*_var_slave_old)[_qp]);
_jump_prev[_qp] = (*_nl_var_master_old)[_qp] - (*_nl_var_slave_old)[_qp];
}
}
void
InterfaceValueMaterial::initQpStatefulProperties()
{
_interface_value[_qp] = 0;
_interface_value_2[_qp] = 0;
}
/test/src/materials/JumpInterfaceMaterial.C
// 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 "JumpInterfaceMaterial.h"
registerMooseObject("MooseTestApp", JumpInterfaceMaterial);
InputParameters
JumpInterfaceMaterial::validParams()
{
InputParameters params = InterfaceMaterial::validParams();
params.addClassDescription("Calculates a variable's jump value across an interface.");
params.addRequiredCoupledVar("var", "Name of the variable");
params.addRequiredCoupledVar("neighbor_var", "Name of the neighbor variable");
return params;
}
JumpInterfaceMaterial::JumpInterfaceMaterial(const InputParameters & parameters)
: InterfaceMaterial(parameters),
_value(coupledValue("var")),
_neighbor_value(coupledNeighborValue("neighbor_var")),
_jump(declareProperty<Real>("jump"))
{
}
void
JumpInterfaceMaterial::computeQpProperties()
{
_jump[_qp] = _value[_qp] - _neighbor_value[_qp];
}
/test/include/materials/InterfaceValueMaterial.h
// 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 "InterfaceMaterial.h"
/**
* Interface material calculates a variable's jump value across an interface
*/
class InterfaceValueMaterial : public InterfaceMaterial
{
public:
static InputParameters validParams();
InterfaceValueMaterial(const InputParameters & parameters);
protected:
virtual void computeQpProperties() override;
virtual void initQpStatefulProperties() override;
const std::string _mp_master_name;
const std::string _mp_slave_name;
const MaterialProperty<Real> & _mp_master;
const MaterialProperty<Real> & _mp_slave;
const VariableValue & _var_master;
const VariableValue & _var_slave;
const VariableValue & _nl_var_master;
const VariableValue & _nl_var_slave;
/// old values
const bool _couple_old_values_and_properties;
const MaterialProperty<Real> * _mp_master_old;
const MaterialProperty<Real> * _mp_slave_old;
const VariableValue * _var_master_old;
const VariableValue * _var_slave_old;
const VariableValue * _nl_var_master_old;
const VariableValue * _nl_var_slave_old;
/// the value type to be computed across the interface
const MooseEnum _interface_value_type;
const std::string _mp_out_base_name;
const std::string _mp_var_out_base_name;
MaterialProperty<Real> & _interface_value;
MaterialProperty<Real> & _interface_value_2;
const MaterialProperty<Real> & _interface_value_old;
const MaterialProperty<Real> & _interface_value_2_old;
MaterialProperty<Real> & _interface_value_prev;
MaterialProperty<Real> & _interface_value_prev_2;
MaterialProperty<Real> & _jump;
// previous jump value
MaterialProperty<Real> & _jump_prev;
};
/test/include/materials/JumpInterfaceMaterial.h
// 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 "InterfaceMaterial.h"
#include "MaterialProperty.h"
/**
* Interface material calculates a variable's jump value across an interface
*/
class JumpInterfaceMaterial : public InterfaceMaterial
{
public:
static InputParameters validParams();
JumpInterfaceMaterial(const InputParameters & parameters);
protected:
virtual void computeQpProperties() override;
const VariableValue & _value;
const VariableValue & _neighbor_value;
MaterialProperty<Real> & _jump;
};
libpng detection test has moved to MOOSE's configure
Does anyone remember when MOOSE got a proper configure system? No? Good, then that means we did our job correctly. The test for the existence of libpng, which was hacked into one of the MOOSE Makefiles was moved to MOOSE's configure system for better reliability. It turns out that the detection failed in rare cases but it was annoying to deal with on systems where it did. Now, we run this test during configure so that we can reliably work with or without it based on the configure result.
MOOSE's configure system
We managed to make it 10 years without a configure script. We did this because we wanted to keep the build process simple for our developers and we were able to delegate all of our configure needs to libMesh's configure system. Well we finally caved and added a full-blown configure system to MOOSE. We are using the GNU Autotools for now, but the most important part is that nobody needs to change their work flow to accommodate the new configure script. It is completely optional at this point and we hope to keep it that way indefinitely.
There are a few optional library configurations that you may choose to activate by running the script yourself. You can always check out what options are available by going to the framework
directory and running ./configure --help
.
Miscellaneous enhancements and bug fixes
The TestHarness properly skips tests that require the presence of libpng.
Kernels for eigenvalue system
We made all kernels in the eigenvalue system consistent with those used in the nonlinear system. That being said, any existing kernels for regular nonlinear calculations can be used in the eigenvalue system without any changes.
Conservative transfer with L2 Lagrange
Conservative transfer supports L2 Lagrange nonlinear variable now.
IntegralBC support in eigenvalue system
We enhanced the eigenvalue system to support the IntegralBC. This help neutron transport calculations where the IntegralBC boundary conditions are often used in eigenvalue calculations.