Skip to content

Commit

Permalink
Conservative transfers: added a test
Browse files Browse the repository at this point in the history
that uses MultiAppCopyTransfer. But the code should work for other field transferes

Refs idaholab#12948
  • Loading branch information
fdkong committed Apr 10, 2019
1 parent 3c0e893 commit a6af7a9
Show file tree
Hide file tree
Showing 5 changed files with 143 additions and 0 deletions.
Binary file not shown.
Binary file not shown.
75 changes: 75 additions & 0 deletions test/tests/transfers/multiapp_conservative_transfer/master.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]

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

[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]

[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]

[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]

[MultiApps]
[./sub]
type = FullSolveMultiApp
input_files = sub.i
execute_on = timestep_end
[../]
[]

[Postprocessors]
[./from_postprocessor]
type = ElementIntegralVariablePostprocessor
variable = u
execute_on = 'INITIAL nonlinear TIMESTEP_END'
[../]
[]

[Transfers]
[./to_sub]
type = MultiAppCopyTransfer
direction = to_multiapp
source_variable = u
variable = u
preserve_transfer = true
multi_app = sub
[../]
[]

[Outputs]
exodus = true
[./console]
type = Console
execute_postprocessors_on = 'INITIAL nonlinear TIMESTEP_END'
[../]
[]
57 changes: 57 additions & 0 deletions test/tests/transfers/multiapp_conservative_transfer/sub.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]

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

[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]

[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]

[Postprocessors]
[./to_postprocessor]
type = ElementIntegralVariablePostprocessor
variable = u
execute_on = 'INITIAL nonlinear TIMESTEP_END'
[../]
[]

[Problem]
type = FEProblem
[]

[Executioner]
type = Steady
solve_type = 'PJFNK'
nl_abs_tol = 1e-12
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]

[Outputs]
exodus = true
[]
11 changes: 11 additions & 0 deletions test/tests/transfers/multiapp_conservative_transfer/tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Tests]
issues = '#12948'
design = '/MultiAppCopyTransfer.md'
[./conservative_transfer]
# Tests transfer between linear Lagrange nonlinear variable
type = Exodiff
input = master.i
exodiff = 'master_out.e master_out_sub0.e'
requirement = 'MOOSE shall support conservative transfers'
[../]
[]

0 comments on commit a6af7a9

Please sign in to comment.