Skip to content
Permalink
Browse files

Merge pull request #12847 from jbtompkins/xfem_verification_tests

Added verification tests for XFEM moving interface capability
  • Loading branch information...
bwspenc committed Feb 19, 2019
2 parents 6bef86f + 5043c4f commit d34132d265191314ed58bbd9ff6fab45b9d65501
Showing with 1,730 additions and 0 deletions.
  1. +33 −0 modules/xfem/test/include/kernels/TestMatTimeDerivative.h
  2. +38 −0 modules/xfem/test/src/kernels/TestMatTimeDerivative.C
  3. +185 −0 modules/xfem/test/tests/moving_interface/verification/1D_rz_homog1mat.i
  4. +190 −0 modules/xfem/test/tests/moving_interface/verification/1D_rz_lsdep1mat.i
  5. +181 −0 modules/xfem/test/tests/moving_interface/verification/1D_xy_homog1mat.i
  6. +188 −0 modules/xfem/test/tests/moving_interface/verification/1D_xy_lsdep1mat.i
  7. +206 −0 modules/xfem/test/tests/moving_interface/verification/2D_rz_homog1mat.i
  8. +211 −0 modules/xfem/test/tests/moving_interface/verification/2D_rz_lsdep1mat.i
  9. +202 −0 modules/xfem/test/tests/moving_interface/verification/2D_xy_homog1mat.i
  10. +206 −0 modules/xfem/test/tests/moving_interface/verification/2D_xy_lsdep1mat.i
  11. BIN modules/xfem/test/tests/moving_interface/verification/gold/1D_rz_homog1mat_out.e
  12. BIN modules/xfem/test/tests/moving_interface/verification/gold/1D_rz_homog1mat_out.e-s002
  13. BIN modules/xfem/test/tests/moving_interface/verification/gold/1D_rz_homog1mat_out.e-s003
  14. BIN modules/xfem/test/tests/moving_interface/verification/gold/1D_rz_homog1mat_out.e-s004
  15. BIN modules/xfem/test/tests/moving_interface/verification/gold/1D_rz_homog1mat_out.e-s005
  16. BIN modules/xfem/test/tests/moving_interface/verification/gold/1D_rz_lsdep1mat_out.e
  17. BIN modules/xfem/test/tests/moving_interface/verification/gold/1D_rz_lsdep1mat_out.e-s002
  18. BIN modules/xfem/test/tests/moving_interface/verification/gold/1D_rz_lsdep1mat_out.e-s003
  19. BIN modules/xfem/test/tests/moving_interface/verification/gold/1D_rz_lsdep1mat_out.e-s004
  20. BIN modules/xfem/test/tests/moving_interface/verification/gold/1D_rz_lsdep1mat_out.e-s005
  21. BIN modules/xfem/test/tests/moving_interface/verification/gold/1D_xy_homog1mat_out.e
  22. BIN modules/xfem/test/tests/moving_interface/verification/gold/1D_xy_homog1mat_out.e-s002
  23. BIN modules/xfem/test/tests/moving_interface/verification/gold/1D_xy_homog1mat_out.e-s003
  24. BIN modules/xfem/test/tests/moving_interface/verification/gold/1D_xy_homog1mat_out.e-s004
  25. BIN modules/xfem/test/tests/moving_interface/verification/gold/1D_xy_homog1mat_out.e-s005
  26. BIN modules/xfem/test/tests/moving_interface/verification/gold/1D_xy_lsdep1mat_out.e
  27. BIN modules/xfem/test/tests/moving_interface/verification/gold/1D_xy_lsdep1mat_out.e-s002
  28. BIN modules/xfem/test/tests/moving_interface/verification/gold/1D_xy_lsdep1mat_out.e-s003
  29. BIN modules/xfem/test/tests/moving_interface/verification/gold/1D_xy_lsdep1mat_out.e-s004
  30. BIN modules/xfem/test/tests/moving_interface/verification/gold/1D_xy_lsdep1mat_out.e-s005
  31. BIN modules/xfem/test/tests/moving_interface/verification/gold/2D_rz_homog1mat_out.e
  32. BIN modules/xfem/test/tests/moving_interface/verification/gold/2D_rz_homog1mat_out.e-s002
  33. BIN modules/xfem/test/tests/moving_interface/verification/gold/2D_rz_homog1mat_out.e-s003
  34. BIN modules/xfem/test/tests/moving_interface/verification/gold/2D_rz_homog1mat_out.e-s004
  35. BIN modules/xfem/test/tests/moving_interface/verification/gold/2D_rz_homog1mat_out.e-s005
  36. BIN modules/xfem/test/tests/moving_interface/verification/gold/2D_rz_lsdep1mat_out.e
  37. BIN modules/xfem/test/tests/moving_interface/verification/gold/2D_rz_lsdep1mat_out.e-s002
  38. BIN modules/xfem/test/tests/moving_interface/verification/gold/2D_rz_lsdep1mat_out.e-s003
  39. BIN modules/xfem/test/tests/moving_interface/verification/gold/2D_rz_lsdep1mat_out.e-s004
  40. BIN modules/xfem/test/tests/moving_interface/verification/gold/2D_rz_lsdep1mat_out.e-s005
  41. BIN modules/xfem/test/tests/moving_interface/verification/gold/2D_xy_homog1mat_out.e
  42. BIN modules/xfem/test/tests/moving_interface/verification/gold/2D_xy_homog1mat_out.e-s002
  43. BIN modules/xfem/test/tests/moving_interface/verification/gold/2D_xy_homog1mat_out.e-s003
  44. BIN modules/xfem/test/tests/moving_interface/verification/gold/2D_xy_homog1mat_out.e-s004
  45. BIN modules/xfem/test/tests/moving_interface/verification/gold/2D_xy_homog1mat_out.e-s005
  46. BIN modules/xfem/test/tests/moving_interface/verification/gold/2D_xy_lsdep1mat_out.e
  47. BIN modules/xfem/test/tests/moving_interface/verification/gold/2D_xy_lsdep1mat_out.e-s002
  48. BIN modules/xfem/test/tests/moving_interface/verification/gold/2D_xy_lsdep1mat_out.e-s003
  49. BIN modules/xfem/test/tests/moving_interface/verification/gold/2D_xy_lsdep1mat_out.e-s004
  50. BIN modules/xfem/test/tests/moving_interface/verification/gold/2D_xy_lsdep1mat_out.e-s005
  51. +90 −0 modules/xfem/test/tests/moving_interface/verification/tests
@@ -0,0 +1,33 @@
//* 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

#ifndef TESTMATTIMEDERIVATIVE_H
#define TESTMATTIMEDERIVATIVE_H

#include "TimeDerivative.h"

// Forward Declaration
class TestMatTimeDerivative;

template<>
InputParameters validParams<TestMatTimeDerivative>();

class TestMatTimeDerivative : public TimeDerivative
{
public:
TestMatTimeDerivative(const InputParameters & parameters);

protected:
virtual Real computeQpResidual() override;
virtual Real computeQpJacobian() override;
const MaterialProperty<Real> & _mat_prop_value;

};

#endif // TESTMATTIMEDERIVATIVE_H
@@ -0,0 +1,38 @@
//* 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 "TestMatTimeDerivative.h"

registerMooseObject("XFEMTestApp", TestMatTimeDerivative);

template<>
InputParameters
validParams<TestMatTimeDerivative>()
{
InputParameters params = validParams<TimeDerivative>();
params.addRequiredParam<MaterialPropertyName>("mat_prop_value", "Material "
"property to multiply by time "
"derivative");
return params;
}

TestMatTimeDerivative::TestMatTimeDerivative(const InputParameters & parameters)
: TimeDerivative(parameters),
_mat_prop_value(getMaterialProperty<Real>("mat_prop_value"))
{}

Real TestMatTimeDerivative::computeQpResidual()
{
return _mat_prop_value[_qp] * TimeDerivative::computeQpResidual();
}

Real TestMatTimeDerivative::computeQpJacobian()
{
return _mat_prop_value[_qp] * TimeDerivative::computeQpJacobian();
}
@@ -0,0 +1,185 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
# XFEM Moving Interface Verification Problem
# Dimensionality: quasi-1D
# Coordinate System: rz
# Material Numbers/Types: homogeneous 1 material, 2 region
# Element Order: 1st
# Interface Characteristics: u independent, prescribed level set function
# Description:
# A simple transient heat transfer problem in cylindrical coordinates designed
# with the Method of Manufactured Solutions. This problem was developed to
# verify XFEM performance in the presence of a moving interface for linear
# element models that can be exactly evaluated by FEM/Moose. Both the
# temperature solution and level set function are designed to be linear to
# attempt to minimize error between the Moose/exact solution and XFEM results.
# Thermal conductivity is a single, constant value at all points in the system.
# Results:
# The temperature at the left boundary (x=1) exhibits the largest difference
# between the FEM/Moose solution and XFEM results. We present the XFEM results
# at this location with 10 digits of precision:
# Time Expected Temperature XFEM Calculated Temperature
# 0.2 440 440
# 0.4 480 480.0008118
# 0.6 520 520.0038529
# 0.8 560 560.0089177
# 1.0 600 600.0133344
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #

[GlobalParams]
order = FIRST
family = LAGRANGE
[]

[Problem]
coord_type = RZ
[]

[Mesh]
type = GeneratedMesh
dim = 2
nx = 4
ny = 1
xmin = 1.0
xmax = 2.0
ymin = 0.0
ymax = 0.5
elem_type = QUAD4
[]

[XFEM]
qrule = moment_fitting
output_cut_plane = true
[]

[UserObjects]
[./level_set_cut_uo]
type = LevelSetCutUserObject
level_set_var = ls
heal_always = true
[../]
[]

[Variables]
[./u]
[../]
[]

[AuxVariables]
[./ls]
order = FIRST
family = LAGRANGE
[../]
[]

[Kernels]
[./heat_cond]
type = MatDiffusion
variable = u
D_name = 'diffusion_coefficient'
[../]
[./vol_heat_src]
type = BodyForce
variable = u
function = src_func
[../]
[./mat_time_deriv]
type = TestMatTimeDerivative
variable = u
mat_prop_value = rhoCp
[../]
[]

[AuxKernels]
[./ls_function]
type = FunctionAux
variable = ls
function = ls_func
[../]
[]

[Constraints]
[./xfem_constraint]
type = XFEMSingleVariableConstraint
variable = u
geometric_cut_userobject = 'level_set_cut_uo'
use_penalty = true
alpha = 1e5
[../]
[]

[Functions]
[./src_func]
type = ParsedFunction
value = '10*(-200*x+400) + 200*1.5*t/x'
[../]
[./neumann_func]
type = ParsedFunction
value = '1.5*200*t'
[../]
[./ls_func]
type = ParsedFunction
value = '2.04 - x - 0.2*t'
[../]
[]

[Materials]
[./mat_time_deriv_prop]
type = GenericConstantMaterial
prop_names = 'rhoCp'
prop_values = 10
[../]
[./therm_cond_prop]
type = GenericConstantMaterial
prop_names = 'diffusion_coefficient'
prop_values = 1.5
[../]
[]

[BCs]
[./left_u]
type = FunctionNeumannBC
variable = u
boundary = 'left'
function = neumann_func
[../]
[./right_u]
type = DirichletBC
variable = u
boundary = 'right'
value = 400
[../]
[]

[ICs]
[./u_ic]
type = ConstantIC
value = 400
variable = u
[../]
[]

[Executioner]
type = Transient
solve_type = 'PJFNK'
line_search = 'none'

l_tol = 1.0e-6
nl_max_its = 15
nl_rel_tol = 1.0e-10
nl_abs_tol = 1.0e-9

start_time = 0.0
dt = 0.2
end_time = 1.0
max_xfem_update = 1
[]

[Outputs]
interval = 1
execute_on = 'initial timestep_end'
exodus = true
[./console]
type = Console
output_linear = true
[../]
[]
Oops, something went wrong.

0 comments on commit d34132d

Please sign in to comment.
You can’t perform that action at this time.