forked from idaholab/moose
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add tests for tagged coupling idaholab#17586
- Loading branch information
Showing
14 changed files
with
313 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
//* 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 "Kernel.h" | ||
|
||
class MatKernel : public Kernel | ||
{ | ||
public: | ||
static InputParameters validParams(); | ||
|
||
MatKernel(const InputParameters & parameters); | ||
|
||
protected: | ||
virtual Real computeQpResidual(); | ||
const MaterialProperty<Real> & _mat_prop; | ||
const Real _coef; | ||
}; |
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 "MatKernel.h" | ||
|
||
registerMooseObject("MooseTestApp", MatKernel); | ||
|
||
InputParameters | ||
MatKernel::validParams() | ||
{ | ||
InputParameters params = Kernel::validParams(); | ||
params.addParam<Real>("coefficient", 1.0, "Coefficient of the term"); | ||
params.addParam<MaterialPropertyName>("mat_prop", | ||
"the name of the material property for coupling"); | ||
return params; | ||
} | ||
|
||
MatKernel::MatKernel(const InputParameters & parameters) | ||
: Kernel(parameters), | ||
_mat_prop(getMaterialProperty<Real>("mat_prop")), | ||
_coef(getParam<Real>("coefficient")) | ||
{ | ||
} | ||
|
||
Real | ||
MatKernel::computeQpResidual() | ||
{ | ||
return _coef * _test[_i][_qp] * _mat_prop[_qp]; | ||
} | ||
|
||
// we currently have no way to assemble Jacobian properly for a general material property |
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
79 changes: 79 additions & 0 deletions
79
test/tests/executioners/fixed_point/2d_diffusion_fixed_point_toggle.i
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,79 @@ | ||
[Mesh] | ||
type = GeneratedMesh | ||
dim = 2 | ||
nx = 4 | ||
ny = 4 | ||
xmin = -1 | ||
xmax = 1 | ||
ymin = -1 | ||
ymax = 1 | ||
[] | ||
|
||
[Variables] | ||
[u] | ||
order = FIRST | ||
family = LAGRANGE | ||
[] | ||
[] | ||
|
||
[Kernels] | ||
[diff] | ||
type = Diffusion | ||
variable = u | ||
[] | ||
[pseudo_time] | ||
type = CoupledForceLagged | ||
variable = u | ||
coefficient = 0.1 | ||
v = u | ||
tag = 'previous' | ||
[] | ||
[pseudo_time_compensation] | ||
type = CoefReaction | ||
variable = u | ||
coefficient = 0.1 | ||
[] | ||
[] | ||
|
||
[BCs] | ||
[left] | ||
type = VacuumBC | ||
variable = u | ||
boundary = left | ||
[] | ||
|
||
[right] | ||
type = NeumannBC | ||
variable = u | ||
boundary = right | ||
value = 1 | ||
[] | ||
[] | ||
|
||
[Postprocessors] | ||
[unorm] | ||
type = ElementL2Norm | ||
variable = u | ||
[] | ||
[udiff] | ||
type = ElementL2Diff | ||
variable = u | ||
tag = 'previous' | ||
[] | ||
[] | ||
|
||
[Problem] | ||
type = FixedPointProblem | ||
fp_tag_name = 'previous' | ||
tagged_vector_for_partial_residual = false | ||
[] | ||
|
||
[Executioner] | ||
type = FixedPointSteady | ||
nl_rel_tol = 1e-2 | ||
nl_abs_tol = 1e-12 | ||
[] | ||
|
||
[Outputs] | ||
exodus = true | ||
[] |
Oops, something went wrong.