- ordersThe order of each series. These must be defined as "x y z" for Cartesian, and "z disc" for CylindricalDuo.
C++ Type:std::vector<unsigned int>
Controllable:No
Description:The order of each series. These must be defined as "x y z" for Cartesian, and "z disc" for CylindricalDuo.
- series_typeThe type of function series to construct.
C++ Type:MooseEnum
Controllable:No
Description:The type of function series to construct.
Function Series
This function uses a convolution of functional series (functional expansion or FX) to create a 1D, 2D, or 3D function
Description
This Function
is the workhorse of the Functional Expansion Tools module. It bridges the gap between the functional series and the associated coefficients. For example, it provides access to the orthonormalized function series that the UserObject
classes need to evaluate a functional expansion. It also provides the standard function series that are required to couple FXs to the solvers (AuxKernels
, BCs
, etc...). As such, it is configured with correlation parameters. These includes physical boundaries, series types, and series' orders.
The coefficients are provided through implementing MutableCoefficientsFunctionInterface
, and the function series are provided by composition (member variable) via CompositeSeriesBasisInterface
.
There are generation_type
and expansion_type
parameters provided by FunctionSeries
that are passed on to the single series (Zernike
, Legendre
, ...). The aforementioned parameters are MooseEnum
s with (at the time of writing) possible values of orthonormal
, standard
, and sqrt_mu
. If the user does not make any specification in the input file, then generation_type
defaults to orthonormal
and expansion_type
defaults to standard
. Note that the combination of generation and expansion must together apply the square of the orthonormalization coefficient (see the work of David Griesheimer for more detail). sqrt_mu
series generation/expansion applies the orthonormalization constant. orthonormal
series generation/expansion applies the square of the orthonormalization constant. standard
series generation/expansion does not apply any factor. Consequently, valid combinations include: 1) orthonormal
for generation and standard
for expansion (the default), 2) sqrt_mu
for both generation and expansion, and 3) standard
for generation and orthonormal
for expansion. We suggest that users stick with the defaults unless coupling with external codes that require different normalizations.
Example Input File Syntax
[Functions]
[./FX_Basis_Value_Main]
type = FunctionSeries
series_type = Cartesian
orders = '3'
physical_bounds = '0.0 10.0'
x = Legendre
[../]
[]
(modules/functional_expansion_tools/examples/1D_volumetric_Cartesian/main.i)[Functions]
[./FX_Basis_Value_Main]
type = FunctionSeries
series_type = Cartesian
orders = '3 4 5'
physical_bounds = '0.0 10.0 1.0 11.0 2.0 12.0'
x = Legendre
y = Legendre
z = Legendre
[../]
[]
(modules/functional_expansion_tools/examples/3D_volumetric_Cartesian/main.i)[Functions]
[./FX_Basis_Value_Main]
type = FunctionSeries
series_type = CylindricalDuo
orders = '5 3' # Axial first, then (r, t) FX
physical_bounds = '-2.5 2.5 0 0 1' # z_min z_max x_center y_center radius
z = Legendre # Axial in z
disc = Zernike # (r, t) default to unit disc in x-y plane
[../]
[]
(modules/functional_expansion_tools/examples/3D_volumetric_cylindrical/main.i)[Functions]
[./FX_Basis_Value_Main]
type = FunctionSeries
series_type = Cartesian
orders = '3'
physical_bounds = '0.0 10.0'
x = Legendre
generation_type = 'sqrt_mu'
expansion_type = 'sqrt_mu'
[../]
[]
(modules/functional_expansion_tools/test/tests/standard_use/volume_coupling_custom_norm.i)Input Parameters
- coefficientsCoefficients required by the function.
C++ Type:std::vector<double>
Controllable:No
Description:Coefficients required by the function.
- discThe series to use for the disc. Its direction is determined by orthogonality to the declared direction of the axis.
C++ Type:MooseEnum
Options:Zernike
Controllable:No
Description:The series to use for the disc. Its direction is determined by orthogonality to the declared direction of the axis.
- enable_cacheFalseEnables cached function evaluations. Recommended only if this function is used directly in a BC or Kernel. This will be enabled automatically if any of the FX-based BCs are used.
Default:False
C++ Type:bool
Controllable:No
Description:Enables cached function evaluations. Recommended only if this function is used directly in a BC or Kernel. This will be enabled automatically if any of the FX-based BCs are used.
- execute_onLINEARThe list of flag(s) indicating when this object should be executed, the available options include FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, NONLINEAR, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM.
Default:LINEAR
C++ Type:ExecFlagEnum
Options:FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, NONLINEAR, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM
Controllable:No
Description:The list of flag(s) indicating when this object should be executed, the available options include FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, NONLINEAR, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM.
- expansion_typestandardThe normalization used for expansion of the basis functions
Default:standard
C++ Type:MooseEnum
Options:orthonormal, sqrt_mu, standard
Controllable:No
Description:The normalization used for expansion of the basis functions
- generation_typeorthonormalThe normalization used for generation of the basis function coefficients
Default:orthonormal
C++ Type:MooseEnum
Options:orthonormal, sqrt_mu, standard
Controllable:No
Description:The normalization used for generation of the basis function coefficients
- physical_boundsThe physical bounds of the function series. These must be defined as "x_min x_max y_min y_max z_min z_max" for Cartesian, and "axial_min axial_max disc_center1 disc_center2 radius" for CylindricalDuo
C++ Type:std::vector<double>
Controllable:No
Description:The physical bounds of the function series. These must be defined as "x_min x_max y_min y_max z_min z_max" for Cartesian, and "axial_min axial_max disc_center1 disc_center2 radius" for CylindricalDuo
- print_when_setFalsePrint the array of coefficients when set
Default:False
C++ Type:bool
Controllable:No
Description:Print the array of coefficients when set
- respect_timeFalseEnable to clear the cache at each new time step.
Default:False
C++ Type:bool
Controllable:No
Description:Enable to clear the cache at each new time step.
- xThe series to use for the x-direction.
C++ Type:MooseEnum
Options:Legendre
Controllable:No
Description:The series to use for the x-direction.
- yThe series to use for the y-direction.
C++ Type:MooseEnum
Options:Legendre
Controllable:No
Description:The series to use for the y-direction.
- zThe series to use for the z-direction.
C++ Type:MooseEnum
Options:Legendre
Controllable:No
Description:The series to use for the z-direction.
Optional Parameters
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector<std::string>
Controllable:No
Description:Adds user-defined labels for accessing object parameters via control logic.
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Controllable:No
Description:Set the enabled status of the MooseObject.
Advanced Parameters
Input Files
- (modules/functional_expansion_tools/test/tests/errors/multiapp_bad_user_object.i)
- (modules/functional_expansion_tools/examples/2D_interface_no_material/main.i)
- (modules/functional_expansion_tools/test/tests/errors/multiapp_incompatible_orders.i)
- (modules/functional_expansion_tools/examples/1D_volumetric_Cartesian/sub.i)
- (modules/functional_expansion_tools/examples/2D_interface_different_submesh/sub.i)
- (modules/functional_expansion_tools/test/tests/errors/invalid_order.i)
- (modules/functional_expansion_tools/examples/3D_volumetric_Cartesian_direct/sub.i)
- (modules/functional_expansion_tools/test/tests/errors/missing_series_x.i)
- (modules/functional_expansion_tools/test/tests/standard_use/volume_coupled.i)
- (modules/functional_expansion_tools/examples/2D_interface_different_submesh/main.i)
- (modules/functional_expansion_tools/test/tests/standard_use/interface_sub.i)
- (modules/functional_expansion_tools/examples/3D_volumetric_Cartesian_direct/main.i)
- (modules/functional_expansion_tools/examples/2D_interface/sub.i)
- (modules/functional_expansion_tools/test/tests/errors/multiapp_missing_sub_object.i)
- (modules/functional_expansion_tools/examples/3D_volumetric_Cartesian/sub.i)
- (modules/functional_expansion_tools/test/tests/standard_use/multiapp_different_physical_boundaries.i)
- (modules/functional_expansion_tools/test/tests/standard_use/multiapp_print_coefficients.i)
- (modules/functional_expansion_tools/test/tests/errors/multiapp_sub.i)
- (modules/functional_expansion_tools/test/tests/standard_use/interface_coupled.i)
- (modules/functional_expansion_tools/examples/2D_volumetric_Cartesian/main.i)
- (modules/functional_expansion_tools/examples/2D_interface_no_material/sub.i)
- (modules/functional_expansion_tools/test/tests/standard_use/volume_sub.i)
- (modules/functional_expansion_tools/examples/3D_volumetric_cylindrical_subapp_mesh_refine/sub.i)
- (modules/functional_expansion_tools/test/tests/errors/multiple_series_duo.i)
- (modules/functional_expansion_tools/test/tests/standard_use/volume_coupling_custom_norm_sub.i)
- (modules/functional_expansion_tools/examples/2D_volumetric_Cartesian/sub.i)
- (modules/functional_expansion_tools/examples/3D_volumetric_Cartesian/main.i)
- (modules/functional_expansion_tools/test/tests/errors/multiapp_missing_local_object.i)
- (modules/functional_expansion_tools/test/tests/standard_use/volume_coupling_custom_norm.i)
- (modules/functional_expansion_tools/examples/2D_interface/main.i)
- (modules/functional_expansion_tools/examples/3D_volumetric_Cartesian_different_submesh/sub.i)
- (modules/functional_expansion_tools/test/tests/standard_use/neglect_invalid_enum.i)
- (modules/functional_expansion_tools/examples/3D_volumetric_Cartesian_different_submesh/main.i)
- (modules/functional_expansion_tools/examples/3D_volumetric_cylindrical/sub.i)
- (modules/functional_expansion_tools/examples/3D_volumetric_cylindrical/main.i)
- (modules/functional_expansion_tools/test/tests/errors/missing_series_duo_disc.i)
- (modules/functional_expansion_tools/test/tests/standard_use/multiapp_sub.i)
- (modules/functional_expansion_tools/test/tests/errors/invalid_bounds_length.i)
- (modules/functional_expansion_tools/examples/1D_volumetric_Cartesian/main.i)
- (modules/functional_expansion_tools/test/tests/errors/multiapp_bad_function_series.i)
- (modules/functional_expansion_tools/test/tests/errors/missing_series_duo_axis.i)
- (modules/functional_expansion_tools/examples/3D_volumetric_cylindrical_subapp_mesh_refine/main.i)
(modules/functional_expansion_tools/examples/1D_volumetric_Cartesian/main.i)
# Basic example coupling a master and sub app in a 1D Cartesian volume.
#
# The master app provides field values to the sub app via Functional Expansions, which then performs
# its calculations. The sub app's solution field values are then transferred back to the master app
# and coupled into the solution of the master app solution.
#
# This example couples Functional Expansions via AuxVariable.
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0.0
xmax = 10.0
nx = 15
[]
[Variables]
[./m]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./s_in]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff_m]
type = HeatConduction
variable = m
[../]
[./time_diff_m]
type = HeatConductionTimeDerivative
variable = m
[../]
[./s_in] # Add in the contribution from the SubApp
type = CoupledForce
variable = m
v = s_in
[../]
[]
[AuxKernels]
[./reconstruct_s_in]
type = FunctionSeriesToAux
variable = s_in
function = FX_Basis_Value_Main
[../]
[]
[Materials]
[./Unobtanium]
type = GenericConstantMaterial
prop_names = 'thermal_conductivity specific_heat density'
prop_values = '1.0 1.0 1.0' # W/(cm K), J/(g K), g/cm^3
[../]
[]
[ICs]
[./start_m]
type = ConstantIC
variable = m
value = 1
[../]
[]
[BCs]
[./surround]
type = DirichletBC
variable = m
value = 1
boundary = 'left right'
[../]
[]
[Functions]
[./FX_Basis_Value_Main]
type = FunctionSeries
series_type = Cartesian
orders = '3'
physical_bounds = '0.0 10.0'
x = Legendre
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Main]
type = FXVolumeUserObject
function = FX_Basis_Value_Main
variable = m
[../]
[]
[Postprocessors]
[./average_value]
type = ElementAverageValue
variable = m
[../]
[./peak_value]
type = ElementExtremeValue
value_type = max
variable = m
[../]
[./picard_iterations]
type = NumFixedPointIterations
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
fixed_point_max_its = 30
nl_rel_tol = 1e-8
nl_abs_tol = 1e-9
fixed_point_rel_tol = 1e-8
fixed_point_abs_tol = 1e-9
[]
[Outputs]
exodus = true
[]
[MultiApps]
[./FXTransferApp]
type = TransientMultiApp
input_files = sub.i
[../]
[]
[Transfers]
[./ValueToSub]
type = MultiAppFXTransfer
to_multi_app = FXTransferApp
this_app_object_name = FX_Value_UserObject_Main
multi_app_object_name = FX_Basis_Value_Sub
[../]
[./ValueToMe]
type = MultiAppFXTransfer
from_multi_app = FXTransferApp
this_app_object_name = FX_Basis_Value_Main
multi_app_object_name = FX_Value_UserObject_Sub
[../]
[]
(modules/functional_expansion_tools/examples/3D_volumetric_Cartesian/main.i)
# Basic example coupling a master and sub app in a 3D Cartesian volume.
#
# The master app provides field values to the sub app via Functional Expansions, which then performs
# its calculations. The sub app's solution field values are then transferred back to the master app
# and coupled into the solution of the master app solution.
#
# This example couples Functional Expansions via AuxVariable.
#
# Note: this problem is not light, and may take a few minutes to solve.
[Mesh]
type = GeneratedMesh
dim = 3
xmin = 0.0
xmax = 10.0
nx = 15
ymin = 1.0
ymax = 11.0
ny = 25
zmin = 2.0
zmax = 12.0
nz = 35
[]
[Variables]
[./m]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./s_in]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff_m]
type = HeatConduction
variable = m
[../]
[./time_diff_m]
type = HeatConductionTimeDerivative
variable = m
[../]
[./s_in] # Add in the contribution from the SubApp
type = CoupledForce
variable = m
v = s_in
[../]
[]
[AuxKernels]
[./reconstruct_s_in]
type = FunctionSeriesToAux
variable = s_in
function = FX_Basis_Value_Main
[../]
[]
[Materials]
[./Unobtanium]
type = GenericConstantMaterial
prop_names = 'thermal_conductivity specific_heat density'
prop_values = '1.0 1.0 1.0' # W/(cm K), J/(g K), g/cm^3
[../]
[]
[ICs]
[./start_m]
type = ConstantIC
variable = m
value = 1
[../]
[]
[BCs]
[./surround]
type = DirichletBC
variable = m
value = 1
boundary = 'top bottom left right front back'
[../]
[]
[Functions]
[./FX_Basis_Value_Main]
type = FunctionSeries
series_type = Cartesian
orders = '3 4 5'
physical_bounds = '0.0 10.0 1.0 11.0 2.0 12.0'
x = Legendre
y = Legendre
z = Legendre
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Main]
type = FXVolumeUserObject
function = FX_Basis_Value_Main
variable = m
[../]
[]
[Postprocessors]
[./average_value]
type = ElementAverageValue
variable = m
[../]
[./peak_value]
type = ElementExtremeValue
value_type = max
variable = m
[../]
[./picard_iterations]
type = NumFixedPointIterations
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
fixed_point_max_its = 30
nl_rel_tol = 1e-8
nl_abs_tol = 1e-9
fixed_point_rel_tol = 1e-8
fixed_point_abs_tol = 1e-9
[]
[Outputs]
exodus = true
[]
[MultiApps]
[./FXTransferApp]
type = TransientMultiApp
input_files = sub.i
[../]
[]
[Transfers]
[./ValueToSub]
type = MultiAppFXTransfer
to_multi_app = FXTransferApp
this_app_object_name = FX_Value_UserObject_Main
multi_app_object_name = FX_Basis_Value_Sub
[../]
[./ValueToMe]
type = MultiAppFXTransfer
from_multi_app = FXTransferApp
this_app_object_name = FX_Basis_Value_Main
multi_app_object_name = FX_Value_UserObject_Sub
[../]
[]
(modules/functional_expansion_tools/examples/3D_volumetric_cylindrical/main.i)
# Basic example coupling a master and sub app in a 3D cylindrical mesh from an input file
#
# The master app provides field values to the sub app via Functional Expansions, which then performs
# its calculations. The sub app's solution field values are then transferred back to the master app
# and coupled into the solution of the master app solution.
#
# This example couples Functional Expansions via AuxVariable, the recommended approach.
#
# Note: this problem is not light, and may take a few minutes to solve.
[Mesh]
type = FileMesh
file = cyl-tet.e
[]
[Variables]
[./m]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./s_in]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff_m]
type = HeatConduction
variable = m
[../]
[./time_diff_m]
type = HeatConductionTimeDerivative
variable = m
[../]
[./s_in] # Add in the contribution from the SubApp
type = CoupledForce
variable = m
v = s_in
[../]
[]
[AuxKernels]
[./reconstruct_s_in]
type = FunctionSeriesToAux
variable = s_in
function = FX_Basis_Value_Main
[../]
[]
[Materials]
[./Unobtanium]
type = GenericConstantMaterial
prop_names = 'thermal_conductivity specific_heat density'
prop_values = '1.0 1.0 1.0' # W/(cm K), J/(g K), g/cm^3
[../]
[]
[ICs]
[./start_m]
type = ConstantIC
variable = m
value = 1
[../]
[]
[BCs]
[./surround]
type = DirichletBC
variable = m
value = 1
boundary = 'top bottom outside'
[../]
[]
[Functions]
[./FX_Basis_Value_Main]
type = FunctionSeries
series_type = CylindricalDuo
orders = '5 3' # Axial first, then (r, t) FX
physical_bounds = '-2.5 2.5 0 0 1' # z_min z_max x_center y_center radius
z = Legendre # Axial in z
disc = Zernike # (r, t) default to unit disc in x-y plane
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Main]
type = FXVolumeUserObject
function = FX_Basis_Value_Main
variable = m
[../]
[]
[Postprocessors]
[./average_value]
type = ElementAverageValue
variable = m
[../]
[./peak_value]
type = ElementExtremeValue
value_type = max
variable = m
[../]
[./picard_iterations]
type = NumFixedPointIterations
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
fixed_point_max_its = 30
nl_rel_tol = 1e-8
nl_abs_tol = 1e-9
fixed_point_rel_tol = 1e-8
fixed_point_abs_tol = 1e-9
[]
[Outputs]
exodus = true
[]
[MultiApps]
[./FXTransferApp]
type = TransientMultiApp
input_files = sub.i
[../]
[]
[Transfers]
[./ValueToSub]
type = MultiAppFXTransfer
to_multi_app = FXTransferApp
this_app_object_name = FX_Value_UserObject_Main
multi_app_object_name = FX_Basis_Value_Sub
[../]
[./ValueToMe]
type = MultiAppFXTransfer
from_multi_app = FXTransferApp
this_app_object_name = FX_Basis_Value_Main
multi_app_object_name = FX_Value_UserObject_Sub
[../]
[]
(modules/functional_expansion_tools/test/tests/standard_use/volume_coupling_custom_norm.i)
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0.0
xmax = 10.0
nx = 15
[]
[Variables]
[./m]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./s_in]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff_m]
type = Diffusion
variable = m
[../]
[./time_diff_m]
type = TimeDerivative
variable = m
[../]
[./s_in]
type = CoupledForce
variable = m
v = s_in
[../]
[]
[AuxKernels]
[./reconstruct_s_in]
type = FunctionSeriesToAux
variable = s_in
function = FX_Basis_Value_Main
[../]
[]
[ICs]
[./start_m]
type = ConstantIC
variable = m
value = 1
[../]
[]
[BCs]
[./surround]
type = DirichletBC
variable = m
value = 1
boundary = 'left right'
[../]
[]
[Functions]
[./FX_Basis_Value_Main]
type = FunctionSeries
series_type = Cartesian
orders = '3'
physical_bounds = '0.0 10.0'
x = Legendre
generation_type = 'sqrt_mu'
expansion_type = 'sqrt_mu'
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Main]
type = FXVolumeUserObject
function = FX_Basis_Value_Main
variable = m
[../]
[]
[Postprocessors]
[./average_value]
type = ElementAverageValue
variable = m
[../]
[./peak_value]
type = ElementExtremeValue
value_type = max
variable = m
[../]
[./picard_iterations]
type = NumFixedPointIterations
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
fixed_point_max_its = 30
nl_rel_tol = 1e-8
nl_abs_tol = 1e-9
fixed_point_rel_tol = 1e-8
fixed_point_abs_tol = 1e-9
[]
[Outputs]
exodus = true
file_base = 'volume_coupled_out'
[]
[MultiApps]
[./FXTransferApp]
type = TransientMultiApp
input_files = volume_coupling_custom_norm_sub.i
[../]
[]
[Transfers]
[./ValueToSub]
type = MultiAppFXTransfer
to_multi_app = FXTransferApp
this_app_object_name = FX_Value_UserObject_Main
multi_app_object_name = FX_Basis_Value_Sub
[../]
[./ValueToMe]
type = MultiAppFXTransfer
from_multi_app = FXTransferApp
this_app_object_name = FX_Basis_Value_Main
multi_app_object_name = FX_Value_UserObject_Sub
[../]
[]
(modules/functional_expansion_tools/test/tests/errors/multiapp_bad_user_object.i)
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0.0
xmax = 10.0
nx = 15
[]
[Variables]
[./m]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./s_in]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff_m]
type = Diffusion
variable = m
[../]
[./time_diff_m]
type = TimeDerivative
variable = m
[../]
[./s_in]
type = CoupledForce
variable = m
v = s_in
[../]
[]
[AuxKernels]
[./reconstruct_s_in]
type = FunctionSeriesToAux
variable = s_in
function = FX_Basis_Value_Main
[../]
[]
[ICs]
[./start_m]
type = ConstantIC
variable = m
value = 1
[../]
[]
[BCs]
[./surround]
type = DirichletBC
variable = m
value = 1
boundary = 'left right'
[../]
[]
[Functions]
[./FX_Basis_Value_Main]
type = FunctionSeries
series_type = Cartesian
orders = '3'
physical_bounds = '0.0 10.0'
x = Legendre
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Main]
type = FXVolumeUserObject
function = FX_Basis_Value_Main
variable = m
[../]
[./AnotheruserObject]
type = EmptyPostprocessor
[../]
[]
[Postprocessors]
[./average_value]
type = ElementAverageValue
variable = m
[../]
[./peak_value]
type = ElementExtremeValue
value_type = max
variable = m
[../]
[./picard_iterations]
type = NumFixedPointIterations
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
fixed_point_max_its = 30
nl_rel_tol = 1e-8
nl_abs_tol = 1e-9
fixed_point_rel_tol = 1e-8
fixed_point_abs_tol = 1e-9
[]
[MultiApps]
[./FXTransferApp]
type = TransientMultiApp
input_files = multiapp_sub.i
[../]
[]
[Transfers]
[./ValueToSub]
type = MultiAppFXTransfer
to_multi_app = FXTransferApp
this_app_object_name = AnotheruserObject
multi_app_object_name = FX_Basis_Value_Sub
[../]
[./ValueToMe]
type = MultiAppFXTransfer
from_multi_app = FXTransferApp
this_app_object_name = FX_Basis_Value_Main
multi_app_object_name = FX_Value_UserObject_Sub
[../]
[]
(modules/functional_expansion_tools/examples/2D_interface_no_material/main.i)
# Derived from the example '2D_interface' with the following differences:
#
# 1) No materials are used
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0.0
xmax = 0.4
nx = 6
ymin = 0.0
ymax = 10.0
ny = 20
[]
[Variables]
[./m]
[../]
[]
[Kernels]
[./diff_m]
type = Diffusion
variable = m
[../]
[./time_diff_m]
type = TimeDerivative
variable = m
[../]
[./source_m]
type = BodyForce
variable = m
value = 100
[../]
[]
[ICs]
[./start_m]
type = ConstantIC
value = 2
variable = m
[../]
[]
[BCs]
[./interface_value]
type = FXValueBC
variable = m
boundary = right
function = FX_Basis_Value_Main
[../]
[./interface_flux]
type = FXFluxBC
boundary = right
variable = m
function = FX_Basis_Flux_Main
[../]
[]
[Functions]
[./FX_Basis_Value_Main]
type = FunctionSeries
series_type = Cartesian
orders = '4'
physical_bounds = '0.0 10'
y = Legendre
[../]
[./FX_Basis_Flux_Main]
type = FunctionSeries
series_type = Cartesian
orders = '5'
physical_bounds = '0.0 10'
y = Legendre
[../]
[]
[UserObjects]
[./FX_Flux_UserObject_Main]
type = FXBoundaryFluxUserObject
function = FX_Basis_Flux_Main
variable = m
boundary = right
diffusivity = 0.1
[../]
[]
[Postprocessors]
[./average_interface_value]
type = SideAverageValue
variable = m
boundary = right
[../]
[./total_flux]
type = SideDiffusiveFluxIntegral
variable = m
boundary = right
diffusivity = 0.1
[../]
[./picard_iterations]
type = NumFixedPointIterations
execute_on = 'initial timestep_end'
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 1.0
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
fixed_point_max_its = 30
nl_rel_tol = 1e-8
nl_abs_tol = 1e-9
fixed_point_rel_tol = 1e-8
fixed_point_abs_tol = 1e-9
[]
[Outputs]
exodus = true
[]
[MultiApps]
[./FXTransferApp]
type = TransientMultiApp
input_files = sub.i
sub_cycling = true
[../]
[]
[Transfers]
[./FluxToSub]
type = MultiAppFXTransfer
to_multi_app = FXTransferApp
this_app_object_name = FX_Flux_UserObject_Main
multi_app_object_name = FX_Basis_Flux_Sub
[../]
[./ValueToMe]
type = MultiAppFXTransfer
from_multi_app = FXTransferApp
this_app_object_name = FX_Basis_Value_Main
multi_app_object_name = FX_Value_UserObject_Sub
[../]
[./FluxToMe]
type = MultiAppFXTransfer
from_multi_app = FXTransferApp
this_app_object_name = FX_Basis_Flux_Main
multi_app_object_name = FX_Flux_UserObject_Sub
[../]
[]
(modules/functional_expansion_tools/test/tests/errors/multiapp_incompatible_orders.i)
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0.0
xmax = 10.0
nx = 15
[]
[Variables]
[./m]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./s_in]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff_m]
type = Diffusion
variable = m
[../]
[./time_diff_m]
type = TimeDerivative
variable = m
[../]
[./s_in]
type = CoupledForce
variable = m
v = s_in
[../]
[]
[AuxKernels]
[./reconstruct_s_in]
type = FunctionSeriesToAux
variable = s_in
function = FX_Basis_Value_Main
[../]
[]
[ICs]
[./start_m]
type = ConstantIC
variable = m
value = 1
[../]
[]
[BCs]
[./surround]
type = DirichletBC
variable = m
value = 1
boundary = 'left right'
[../]
[]
[Functions]
[./FX_Basis_Value_Main]
type = FunctionSeries
series_type = Cartesian
orders = '36'
physical_bounds = '0.0 10.0'
x = Legendre
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Main]
type = FXVolumeUserObject
function = FX_Basis_Value_Main
variable = m
[../]
[]
[Postprocessors]
[./average_value]
type = ElementAverageValue
variable = m
[../]
[./peak_value]
type = ElementExtremeValue
value_type = max
variable = m
[../]
[./picard_iterations]
type = NumFixedPointIterations
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
fixed_point_max_its = 30
nl_rel_tol = 1e-8
nl_abs_tol = 1e-9
fixed_point_rel_tol = 1e-8
fixed_point_abs_tol = 1e-9
[]
[MultiApps]
[./FXTransferApp]
type = TransientMultiApp
input_files = multiapp_sub.i
[../]
[]
[Transfers]
[./ValueToSub]
type = MultiAppFXTransfer
to_multi_app = FXTransferApp
this_app_object_name = FX_Value_UserObject_Main
multi_app_object_name = FX_Basis_Value_Sub
[../]
[./ValueToMe]
type = MultiAppFXTransfer
from_multi_app = FXTransferApp
this_app_object_name = FX_Basis_Value_Main
multi_app_object_name = FX_Value_UserObject_Sub
[../]
[]
(modules/functional_expansion_tools/examples/1D_volumetric_Cartesian/sub.i)
# Basic example coupling a master and sub app in a 1D Cartesian volume.
#
# The master app provides field values to the sub app via Functional Expansions, which then performs
# its calculations. The sub app's solution field values are then transferred back to the master app
# and coupled into the solution of the master app solution.
#
# This example couples Functional Expansions via AuxVariable.
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0.0
xmax = 10.0
nx = 15
[]
# Non-copy transfers only work with AuxVariable, but nothing will be solved without a variable
# defined. The solution is to define an empty variable tha does nothing, but causes MOOSE to solve
# the AuxKernels that we need.
[Variables]
[./empty]
[../]
[]
[AuxVariables]
[./s]
order = FIRST
family = LAGRANGE
[../]
[./m_in]
order = FIRST
family = LAGRANGE
[../]
[]
# We must have a kernel for every variable, hence this null kernel to match the variable 'empty'
[Kernels]
[./null_kernel]
type = NullKernel
variable = empty
[../]
[]
[AuxKernels]
[./reconstruct_m_in]
type = FunctionSeriesToAux
function = FX_Basis_Value_Sub
variable = m_in
[../]
[./calculate_s] # Something to make 's' change each time, but allow a converging solution
type = ParsedAux
variable = s
coupled_variables = m_in
expression = '2*exp(-m_in/0.8)'
[../]
[]
[Functions]
[./FX_Basis_Value_Sub]
type = FunctionSeries
series_type = Cartesian
orders = '3'
physical_bounds = '0.0 10.0'
x = Legendre
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Sub]
type = FXVolumeUserObject
function = FX_Basis_Value_Sub
variable = s
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
(modules/functional_expansion_tools/examples/2D_interface_different_submesh/sub.i)
# Derived from the example '2D_interface' with the following differences:
#
# 1) The number of y divisions in the sub app is not the same as the master app
# 2) The subapp mesh is skewed in y
# 3) The Functional Expansion order for the flux term was increased to 7
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0.4
xmax = 2.4
nx = 30
ymin = 0.0
ymax = 10.0
ny = 23
bias_y = 1.2
[]
[Variables]
[./s]
[../]
[]
[Kernels]
[./diff_s]
type = HeatConduction
variable = s
[../]
[./time_diff_s]
type = HeatConductionTimeDerivative
variable = s
[../]
[]
[Materials]
[./Unobtanium]
type = GenericConstantMaterial
prop_names = 'thermal_conductivity specific_heat density'
prop_values = '1.0 1.0 1.0' # W/(cm K), J/(g K), g/cm^3
[../]
[]
[ICs]
[./start_s]
type = ConstantIC
value = 2
variable = s
[../]
[]
[BCs]
[./bottom]
type = DirichletBC
variable = s
boundary = bottom
value = 0.1
[../]
[./interface_flux]
type = FXFluxBC
boundary = left
variable = s
function = FX_Basis_Flux_Sub
[../]
[]
[Functions]
[./FX_Basis_Value_Sub]
type = FunctionSeries
series_type = Cartesian
orders = '4'
physical_bounds = '0.0 10'
y = Legendre
[../]
[./FX_Basis_Flux_Sub]
type = FunctionSeries
series_type = Cartesian
orders = '7'
physical_bounds = '0.0 10'
y = Legendre
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Sub]
type = FXBoundaryValueUserObject
function = FX_Basis_Value_Sub
variable = s
boundary = left
[../]
[./FX_Flux_UserObject_Sub]
type = FXBoundaryFluxUserObject
function = FX_Basis_Flux_Sub
variable = s
boundary = left
diffusivity = thermal_conductivity
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 1.0
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
(modules/functional_expansion_tools/test/tests/errors/invalid_order.i)
[Mesh]
type = GeneratedMesh
dim = 3
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diffusion]
type = Diffusion
variable = u
[../]
[]
[Functions]
[./series]
type = FunctionSeries
series_type = Cartesian
x = Legendre
disc = Zernike
orders = '0 1'
physical_bounds = '-1 1 0 3'
[../]
[]
[Executioner]
type = Steady
[]
(modules/functional_expansion_tools/examples/3D_volumetric_Cartesian_direct/sub.i)
# Derived from the example '3D_volumetric_Cartesian' with the following differences:
#
# 1) The coupling is performed via BodyForce instead of the
# FunctionSeriesToAux+CoupledForce approach
[Mesh]
type = GeneratedMesh
dim = 3
xmin = 0.0
xmax = 10.0
nx = 15
ymin = 1.0
ymax = 11.0
ny = 25
zmin = 2.0
zmax = 12.0
nz = 35
[]
# Non-copy transfers only work with AuxVariable, but nothing will be solved without a variable
# defined. The solution is to define an empty variable tha does nothing, but causes MOOSE to solve
# the AuxKernels that we need.
[Variables]
[./empty]
[../]
[]
[AuxVariables]
[./s]
order = FIRST
family = LAGRANGE
[../]
[./m_in]
order = FIRST
family = LAGRANGE
[../]
[]
# We must have a kernel for every variable, hence this null kernel to match the variable 'empty'
[Kernels]
[./null_kernel]
type = NullKernel
variable = empty
[../]
[]
[AuxKernels]
[./reconstruct_m_in]
type = FunctionSeriesToAux
function = FX_Basis_Value_Sub
variable = m_in
[../]
[./calculate_s] # Something to make 's' change each time, but allow a converging solution
type = ParsedAux
variable = s
coupled_variables = m_in
expression = '2*exp(-m_in/0.8)'
[../]
[]
[Functions]
[./FX_Basis_Value_Sub]
type = FunctionSeries
series_type = Cartesian
orders = '3 4 5'
physical_bounds = '0.0 10.0 1.0 11.0 2.0 12.0'
x = Legendre
y = Legendre
z = Legendre
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Sub]
type = FXVolumeUserObject
function = FX_Basis_Value_Sub
variable = s
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
(modules/functional_expansion_tools/test/tests/errors/missing_series_x.i)
[Mesh]
type = GeneratedMesh
dim = 1
[]
[Functions]
[./series]
type = FunctionSeries
series_type = Cartesian
orders = '0'
physical_bounds = '-1 1'
[../]
[]
[Executioner]
type = Steady
[]
[Problem]
solve = false
[]
(modules/functional_expansion_tools/test/tests/standard_use/volume_coupled.i)
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0.0
xmax = 10.0
nx = 15
[]
[Variables]
[./m]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./s_in]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff_m]
type = Diffusion
variable = m
[../]
[./time_diff_m]
type = TimeDerivative
variable = m
[../]
[./s_in]
type = CoupledForce
variable = m
v = s_in
[../]
[]
[AuxKernels]
[./reconstruct_s_in]
type = FunctionSeriesToAux
variable = s_in
function = FX_Basis_Value_Main
[../]
[]
[ICs]
[./start_m]
type = ConstantIC
variable = m
value = 1
[../]
[]
[BCs]
[./surround]
type = DirichletBC
variable = m
value = 1
boundary = 'left right'
[../]
[]
[Functions]
[./FX_Basis_Value_Main]
type = FunctionSeries
series_type = Cartesian
orders = '3'
physical_bounds = '0.0 10.0'
x = Legendre
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Main]
type = FXVolumeUserObject
function = FX_Basis_Value_Main
variable = m
[../]
[]
[Postprocessors]
[./average_value]
type = ElementAverageValue
variable = m
[../]
[./peak_value]
type = ElementExtremeValue
value_type = max
variable = m
[../]
[./picard_iterations]
type = NumFixedPointIterations
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
fixed_point_max_its = 30
nl_rel_tol = 1e-8
nl_abs_tol = 1e-9
fixed_point_rel_tol = 1e-8
fixed_point_abs_tol = 1e-9
[]
[Outputs]
exodus = true
[]
[MultiApps]
[./FXTransferApp]
type = TransientMultiApp
input_files = volume_sub.i
[../]
[]
[Transfers]
[./ValueToSub]
type = MultiAppFXTransfer
to_multi_app = FXTransferApp
this_app_object_name = FX_Value_UserObject_Main
multi_app_object_name = FX_Basis_Value_Sub
[../]
[./ValueToMe]
type = MultiAppFXTransfer
from_multi_app = FXTransferApp
this_app_object_name = FX_Basis_Value_Main
multi_app_object_name = FX_Value_UserObject_Sub
[../]
[]
(modules/functional_expansion_tools/examples/2D_interface_different_submesh/main.i)
# Derived from the example '2D_interface' with the following differences:
#
# 1) The number of y divisions in the sub app is not the same as the master app
# 2) The subapp mesh is skewed in y
# 3) The Functional Expansion order for the flux term was increased to 7
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0.0
xmax = 0.4
nx = 6
ymin = 0.0
ymax = 10.0
ny = 20
[]
[Variables]
[./m]
[../]
[]
[Kernels]
[./diff_m]
type = HeatConduction
variable = m
[../]
[./time_diff_m]
type = HeatConductionTimeDerivative
variable = m
[../]
[./source_m]
type = BodyForce
variable = m
value = 100
[../]
[]
[Materials]
[./Impervium]
type = GenericConstantMaterial
prop_names = 'thermal_conductivity specific_heat density'
prop_values = '0.00001 50.0 100.0' # W/(cm K), J/(g K), g/cm^3
[../]
[]
[ICs]
[./start_m]
type = ConstantIC
value = 2
variable = m
[../]
[]
[BCs]
[./interface_value]
type = FXValueBC
variable = m
boundary = right
function = FX_Basis_Value_Main
[../]
[./interface_flux]
type = FXFluxBC
boundary = right
variable = m
function = FX_Basis_Flux_Main
[../]
[]
[Functions]
[./FX_Basis_Value_Main]
type = FunctionSeries
series_type = Cartesian
orders = '4'
physical_bounds = '0.0 10'
y = Legendre
[../]
[./FX_Basis_Flux_Main]
type = FunctionSeries
series_type = Cartesian
orders = '7'
physical_bounds = '0.0 10'
y = Legendre
[../]
[]
[UserObjects]
[./FX_Flux_UserObject_Main]
type = FXBoundaryFluxUserObject
function = FX_Basis_Flux_Main
variable = m
boundary = right
diffusivity = thermal_conductivity
[../]
[]
[Postprocessors]
[./average_interface_value]
type = SideAverageValue
variable = m
boundary = right
[../]
[./total_flux]
type = SideDiffusiveFluxIntegral
variable = m
boundary = right
diffusivity = thermal_conductivity
[../]
[./picard_iterations]
type = NumFixedPointIterations
execute_on = 'initial timestep_end'
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 1.0
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
fixed_point_max_its = 30
nl_rel_tol = 1e-8
nl_abs_tol = 1e-9
fixed_point_rel_tol = 1e-8
fixed_point_abs_tol = 1e-9
[]
[Outputs]
exodus = true
[]
[MultiApps]
[./FXTransferApp]
type = TransientMultiApp
input_files = sub.i
sub_cycling = true
[../]
[]
[Transfers]
[./FluxToSub]
type = MultiAppFXTransfer
to_multi_app = FXTransferApp
this_app_object_name = FX_Flux_UserObject_Main
multi_app_object_name = FX_Basis_Flux_Sub
[../]
[./ValueToMe]
type = MultiAppFXTransfer
from_multi_app = FXTransferApp
this_app_object_name = FX_Basis_Value_Main
multi_app_object_name = FX_Value_UserObject_Sub
[../]
[./FluxToMe]
type = MultiAppFXTransfer
from_multi_app = FXTransferApp
this_app_object_name = FX_Basis_Flux_Main
multi_app_object_name = FX_Flux_UserObject_Sub
[../]
[]
(modules/functional_expansion_tools/test/tests/standard_use/interface_sub.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0.4
xmax = 2.4
nx = 30
ymin = 0.0
ymax = 10.0
ny = 20
[]
[Variables]
[./s]
[../]
[]
[Kernels]
[./diff_s]
type = Diffusion
variable = s
[../]
[./time_diff_s]
type = TimeDerivative
variable = s
[../]
[]
[ICs]
[./start_s]
type = ConstantIC
value = 2
variable = s
[../]
[]
[BCs]
[./bottom]
type = DirichletBC
variable = s
boundary = bottom
value = 0.1
[../]
[./interface_flux]
type = FXFluxBC
boundary = left
variable = s
function = FX_Basis_Flux_Sub
[../]
[]
[Functions]
[./FX_Basis_Value_Sub]
type = FunctionSeries
series_type = Cartesian
orders = '4'
physical_bounds = '0.0 10'
y = Legendre
[../]
[./FX_Basis_Flux_Sub]
type = FunctionSeries
series_type = Cartesian
orders = '5'
physical_bounds = '0.0 10'
y = Legendre
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Sub]
type = FXBoundaryValueUserObject
function = FX_Basis_Value_Sub
variable = s
boundary = left
[../]
[./FX_Flux_UserObject_Sub]
type = FXBoundaryFluxUserObject
function = FX_Basis_Flux_Sub
variable = s
boundary = left
diffusivity = 1.0
[../]
[]
[Executioner]
type = Transient
num_steps = 4
dt = 1.0
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
(modules/functional_expansion_tools/examples/3D_volumetric_Cartesian_direct/main.i)
# Derived from the example '3D_volumetric_Cartesian' with the following differences:
#
# 1) The coupling is performed via BodyForce instead of the
# FunctionSeriesToAux+CoupledForce approach
[Mesh]
type = GeneratedMesh
dim = 3
xmin = 0.0
xmax = 10.0
nx = 15
ymin = 1.0
ymax = 11.0
ny = 25
zmin = 2.0
zmax = 12.0
nz = 35
[]
[Variables]
[./m]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff_m]
type = HeatConduction
variable = m
[../]
[./time_diff_m]
type = HeatConductionTimeDerivative
variable = m
[../]
[./s_in] # Add in the contribution from the SubApp
type = BodyForce
variable = m
function = FX_Basis_Value_Main
[../]
[]
[Materials]
[./Unobtanium]
type = GenericConstantMaterial
prop_names = 'thermal_conductivity specific_heat density'
prop_values = '1.0 1.0 1.0' # W/(cm K), J/(g K), g/cm^3
[../]
[]
[ICs]
[./start_m]
type = ConstantIC
variable = m
value = 1
[../]
[]
[BCs]
[./surround]
type = DirichletBC
variable = m
value = 1
boundary = 'top bottom left right front back'
[../]
[]
[Functions]
[./FX_Basis_Value_Main]
type = FunctionSeries
series_type = Cartesian
orders = '3 4 5'
physical_bounds = '0.0 10.0 1.0 11.0 2.0 12.0'
x = Legendre
y = Legendre
z = Legendre
enable_cache = true
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Main]
type = FXVolumeUserObject
function = FX_Basis_Value_Main
variable = m
[../]
[]
[Postprocessors]
[./average_value]
type = ElementAverageValue
variable = m
[../]
[./peak_value]
type = ElementExtremeValue
value_type = max
variable = m
[../]
[./picard_iterations]
type = NumFixedPointIterations
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
fixed_point_max_its = 30
nl_rel_tol = 1e-8
nl_abs_tol = 1e-9
fixed_point_rel_tol = 1e-8
fixed_point_abs_tol = 1e-9
[]
[Outputs]
exodus = true
[]
[MultiApps]
[./FXTransferApp]
type = TransientMultiApp
input_files = sub.i
[../]
[]
[Transfers]
[./ValueToSub]
type = MultiAppFXTransfer
to_multi_app = FXTransferApp
this_app_object_name = FX_Value_UserObject_Main
multi_app_object_name = FX_Basis_Value_Sub
[../]
[./ValueToMe]
type = MultiAppFXTransfer
from_multi_app = FXTransferApp
this_app_object_name = FX_Basis_Value_Main
multi_app_object_name = FX_Value_UserObject_Sub
[../]
[]
(modules/functional_expansion_tools/examples/2D_interface/sub.i)
# Basic example coupling a master and sub app at an interface in a 2D model.
# The master app provides a flux term to the sub app via Functional Expansions, which then performs
# its calculations. The sub app's interface conditions, both value and flux, are transferred back
# to the master app
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0.4
xmax = 2.4
nx = 30
ymin = 0.0
ymax = 10.0
ny = 20
[]
[Variables]
[./s]
[../]
[]
[Kernels]
[./diff_s]
type = HeatConduction
variable = s
[../]
[./time_diff_s]
type = HeatConductionTimeDerivative
variable = s
[../]
[]
[Materials]
[./Unobtanium]
type = GenericConstantMaterial
prop_names = 'thermal_conductivity specific_heat density'
prop_values = '1.0 1.0 1.0' # W/(cm K), J/(g K), g/cm^3
[../]
[]
[ICs]
[./start_s]
type = ConstantIC
value = 2
variable = s
[../]
[]
[BCs]
[./bottom]
type = DirichletBC
variable = s
boundary = bottom
value = 0.1
[../]
[./interface_flux]
type = FXFluxBC
boundary = left
variable = s
function = FX_Basis_Flux_Sub
[../]
[]
[Functions]
[./FX_Basis_Value_Sub]
type = FunctionSeries
series_type = Cartesian
orders = '4'
physical_bounds = '0.0 10'
y = Legendre
[../]
[./FX_Basis_Flux_Sub]
type = FunctionSeries
series_type = Cartesian
orders = '5'
physical_bounds = '0.0 10'
y = Legendre
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Sub]
type = FXBoundaryValueUserObject
function = FX_Basis_Value_Sub
variable = s
boundary = left
[../]
[./FX_Flux_UserObject_Sub]
type = FXBoundaryFluxUserObject
function = FX_Basis_Flux_Sub
variable = s
boundary = left
diffusivity = thermal_conductivity
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 1.0
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
(modules/functional_expansion_tools/test/tests/errors/multiapp_missing_sub_object.i)
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0.0
xmax = 10.0
nx = 15
[]
[Variables]
[./m]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./s_in]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff_m]
type = Diffusion
variable = m
[../]
[./time_diff_m]
type = TimeDerivative
variable = m
[../]
[./s_in]
type = CoupledForce
variable = m
v = s_in
[../]
[]
[AuxKernels]
[./reconstruct_s_in]
type = FunctionSeriesToAux
variable = s_in
function = FX_Basis_Value_Main
[../]
[]
[ICs]
[./start_m]
type = ConstantIC
variable = m
value = 1
[../]
[]
[BCs]
[./surround]
type = DirichletBC
variable = m
value = 1
boundary = 'left right'
[../]
[]
[Functions]
[./FX_Basis_Value_Main]
type = FunctionSeries
series_type = Cartesian
orders = '3'
physical_bounds = '0.0 10.0'
x = Legendre
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Main]
type = FXVolumeUserObject
function = FX_Basis_Value_Main
variable = m
[../]
[]
[Postprocessors]
[./average_value]
type = ElementAverageValue
variable = m
[../]
[./peak_value]
type = ElementExtremeValue
value_type = max
variable = m
[../]
[./picard_iterations]
type = NumFixedPointIterations
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
fixed_point_max_its = 30
nl_rel_tol = 1e-8
nl_abs_tol = 1e-9
fixed_point_rel_tol = 1e-8
fixed_point_abs_tol = 1e-9
[]
[MultiApps]
[./FXTransferApp]
type = TransientMultiApp
input_files = multiapp_sub.i
[../]
[]
[Transfers]
[./ValueToSub]
type = MultiAppFXTransfer
to_multi_app = FXTransferApp
this_app_object_name = FX_Value_UserObject_Main
multi_app_object_name = FX_Basis_Value
[../]
[./ValueToMe]
type = MultiAppFXTransfer
from_multi_app = FXTransferApp
this_app_object_name = FX_Basis_Value_Main
multi_app_object_name = FX_Value_UserObject_Sub
[../]
[]
(modules/functional_expansion_tools/examples/3D_volumetric_Cartesian/sub.i)
# Basic example coupling a master and sub app in a 3D Cartesian volume.
#
# The master app provides field values to the sub app via Functional Expansions, which then performs
# its calculations. The sub app's solution field values are then transferred back to the master app
# and coupled into the solution of the master app solution.
#
# This example couples Functional Expansions via AuxVariable.
#
# Note: this problem is not light, and may take a few minutes to solve.
[Mesh]
type = GeneratedMesh
dim = 3
xmin = 0.0
xmax = 10.0
nx = 15
ymin = 1.0
ymax = 11.0
ny = 25
zmin = 2.0
zmax = 12.0
nz = 35
[]
# Non-copy transfers only work with AuxVariable, but nothing will be solved without a variable
# defined. The solution is to define an empty variable tha does nothing, but causes MOOSE to solve
# the AuxKernels that we need.
[Variables]
[./empty]
[../]
[]
[AuxVariables]
[./s]
order = FIRST
family = LAGRANGE
[../]
[./m_in]
order = FIRST
family = LAGRANGE
[../]
[]
# We must have a kernel for every variable, hence this null kernel to match the variable 'empty'
[Kernels]
[./null_kernel]
type = NullKernel
variable = empty
[../]
[]
[AuxKernels]
[./reconstruct_m_in]
type = FunctionSeriesToAux
function = FX_Basis_Value_Sub
variable = m_in
[../]
[./calculate_s] # Something to make 's' change each time, but allow a converging solution
type = ParsedAux
variable = s
coupled_variables = m_in
expression = '2*exp(-m_in/0.8)'
[../]
[]
[Functions]
[./FX_Basis_Value_Sub]
type = FunctionSeries
series_type = Cartesian
orders = '3 4 5'
physical_bounds = '0.0 10.0 1.0 11.0 2.0 12.0'
x = Legendre
y = Legendre
z = Legendre
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Sub]
type = FXVolumeUserObject
function = FX_Basis_Value_Sub
variable = s
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
(modules/functional_expansion_tools/test/tests/standard_use/multiapp_different_physical_boundaries.i)
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0.0
xmax = 10.0
nx = 15
[]
[Variables]
[./m]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./s_in]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff_m]
type = Diffusion
variable = m
[../]
[./time_diff_m]
type = TimeDerivative
variable = m
[../]
[./s_in]
type = CoupledForce
variable = m
v = s_in
[../]
[]
[AuxKernels]
[./reconstruct_s_in]
type = FunctionSeriesToAux
variable = s_in
function = FX_Basis_Value_Main
[../]
[]
[ICs]
[./start_m]
type = ConstantIC
variable = m
value = 1
[../]
[]
[BCs]
[./surround]
type = DirichletBC
variable = m
value = 1
boundary = 'left right'
[../]
[]
[Functions]
[./FX_Basis_Value_Main]
type = FunctionSeries
series_type = Cartesian
orders = '3'
physical_bounds = '1.0 9.0'
x = Legendre
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Main]
type = FXVolumeUserObject
function = FX_Basis_Value_Main
variable = m
[../]
[]
[Postprocessors]
[./average_value]
type = ElementAverageValue
variable = m
[../]
[./peak_value]
type = ElementExtremeValue
value_type = max
variable = m
[../]
[./picard_iterations]
type = NumFixedPointIterations
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
fixed_point_max_its = 30
nl_rel_tol = 1e-8
nl_abs_tol = 1e-9
fixed_point_rel_tol = 1e-8
fixed_point_abs_tol = 1e-9
[]
[Outputs]
exodus = true
[]
[MultiApps]
[./FXTransferApp]
type = TransientMultiApp
input_files = multiapp_sub.i
[../]
[]
[Transfers]
[./ValueToSub]
type = MultiAppFXTransfer
to_multi_app = FXTransferApp
this_app_object_name = FX_Value_UserObject_Main
multi_app_object_name = FX_Basis_Value_Sub
[../]
[./ValueToMe]
type = MultiAppFXTransfer
from_multi_app = FXTransferApp
this_app_object_name = FX_Basis_Value_Main
multi_app_object_name = FX_Value_UserObject_Sub
[../]
[]
(modules/functional_expansion_tools/test/tests/standard_use/multiapp_print_coefficients.i)
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0.0
xmax = 10.0
nx = 15
[]
[Variables]
[./m]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./s_in]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff_m]
type = Diffusion
variable = m
[../]
[./time_diff_m]
type = TimeDerivative
variable = m
[../]
[./s_in]
type = CoupledForce
variable = m
v = s_in
[../]
[]
[AuxKernels]
[./reconstruct_s_in]
type = FunctionSeriesToAux
variable = s_in
function = FX_Basis_Value_Main
[../]
[]
[ICs]
[./start_m]
type = ConstantIC
variable = m
value = 1
[../]
[]
[BCs]
[./surround]
type = DirichletBC
variable = m
value = 1
boundary = 'left right'
[../]
[]
[Functions]
[./FX_Basis_Value_Main]
type = FunctionSeries
series_type = Cartesian
orders = '3'
physical_bounds = '0.0 10.0'
x = Legendre
print_when_set = true # Print coefficients when a MultiAppFXTransfer is executed
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Main]
type = FXVolumeUserObject
function = FX_Basis_Value_Main
variable = m
print_state = true # Print after the FX coefficients are computer
print_when_set = true # Print coefficients when a MultiAppFXTransfer is executed
[../]
[]
[Postprocessors]
[./average_value]
type = ElementAverageValue
variable = m
[../]
[./peak_value]
type = ElementExtremeValue
value_type = max
variable = m
[../]
[./picard_iterations]
type = NumFixedPointIterations
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
fixed_point_max_its = 30
nl_rel_tol = 1e-8
nl_abs_tol = 1e-9
fixed_point_rel_tol = 1e-8
fixed_point_abs_tol = 1e-9
[]
[Outputs]
exodus = true
[]
[MultiApps]
[./FXTransferApp]
type = TransientMultiApp
input_files = multiapp_sub.i
[../]
[]
[Transfers]
[./ValueToSub]
type = MultiAppFXTransfer
to_multi_app = FXTransferApp
this_app_object_name = FX_Value_UserObject_Main
multi_app_object_name = FX_Basis_Value_Sub
[../]
[./ValueToMe]
type = MultiAppFXTransfer
from_multi_app = FXTransferApp
this_app_object_name = FX_Basis_Value_Main
multi_app_object_name = FX_Value_UserObject_Sub
[../]
[]
(modules/functional_expansion_tools/test/tests/errors/multiapp_sub.i)
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0.0
xmax = 10.0
nx = 15
[]
[Variables]
[./empty]
[../]
[]
[AuxVariables]
[./s]
order = FIRST
family = LAGRANGE
[../]
[./m_in]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./null_kernel]
type = NullKernel
variable = empty
[../]
[]
[AuxKernels]
[./reconstruct_m_in]
type = FunctionSeriesToAux
function = FX_Basis_Value_Sub
variable = m_in
[../]
[./calculate_s]
type = ParsedAux
variable = s
coupled_variables = m_in
expression = '2*exp(-m_in/0.8)'
[../]
[]
[Functions]
[./FX_Basis_Value_Sub]
type = FunctionSeries
series_type = Cartesian
orders = '3'
physical_bounds = '0.0 10.0'
x = Legendre
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Sub]
type = FXVolumeUserObject
function = FX_Basis_Value_Sub
variable = s
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
(modules/functional_expansion_tools/test/tests/standard_use/interface_coupled.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0.0
xmax = 0.4
nx = 6
ymin = 0.0
ymax = 10.0
ny = 20
[]
[Variables]
[./m]
[../]
[]
[Kernels]
[./diff_m]
type = Diffusion
variable = m
[../]
[./time_diff_m]
type = TimeDerivative
variable = m
[../]
[./source_m]
type = BodyForce
variable = m
value = 100
[../]
[]
[ICs]
[./start_m]
type = ConstantIC
value = 2
variable = m
[../]
[]
[BCs]
[./interface_value]
type = FXValueBC
variable = m
boundary = right
function = FX_Basis_Value_Main
[../]
[./interface_flux]
type = FXFluxBC
boundary = right
variable = m
function = FX_Basis_Flux_Main
[../]
[]
[Functions]
[./FX_Basis_Value_Main]
type = FunctionSeries
series_type = Cartesian
orders = '4'
physical_bounds = '0.0 10'
y = Legendre
[../]
[./FX_Basis_Flux_Main]
type = FunctionSeries
series_type = Cartesian
orders = '5'
physical_bounds = '0.0 10'
y = Legendre
[../]
[]
[UserObjects]
[./FX_Flux_UserObject_Main]
type = FXBoundaryFluxUserObject
function = FX_Basis_Flux_Main
variable = m
boundary = right
diffusivity = 0.1
[../]
[]
[Postprocessors]
[./average_interface_value]
type = SideAverageValue
variable = m
boundary = right
[../]
[./total_flux]
type = SideDiffusiveFluxIntegral
variable = m
boundary = right
diffusivity = 0.1
[../]
[./picard_iterations]
type = NumFixedPointIterations
execute_on = 'initial timestep_end'
[../]
[]
[Executioner]
type = Transient
num_steps = 4
dt = 1.0
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
fixed_point_max_its = 30
nl_rel_tol = 1e-8
nl_abs_tol = 1e-9
fixed_point_rel_tol = 1e-8
fixed_point_abs_tol = 1e-9
[]
[Outputs]
exodus = true
[]
[MultiApps]
[./FXTransferApp]
type = TransientMultiApp
input_files = interface_sub.i
sub_cycling = true
[../]
[]
[Transfers]
[./FluxToSub]
type = MultiAppFXTransfer
to_multi_app = FXTransferApp
this_app_object_name = FX_Flux_UserObject_Main
multi_app_object_name = FX_Basis_Flux_Sub
[../]
[./ValueToMe]
type = MultiAppFXTransfer
from_multi_app = FXTransferApp
this_app_object_name = FX_Basis_Value_Main
multi_app_object_name = FX_Value_UserObject_Sub
[../]
[./FluxToMe]
type = MultiAppFXTransfer
from_multi_app = FXTransferApp
this_app_object_name = FX_Basis_Flux_Main
multi_app_object_name = FX_Flux_UserObject_Sub
[../]
[]
(modules/functional_expansion_tools/examples/2D_volumetric_Cartesian/main.i)
# Basic example coupling a master and sub app in a 2D Cartesian volume.
#
# The master app provides field values to the sub app via Functional Expansions, which then performs
# its calculations. The sub app's solution field values are then transferred back to the master app
# and coupled into the solution of the master app solution.
#
# This example couples Functional Expansions via AuxVariable.
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0.0
xmax = 10.0
nx = 15
ymin = 1.0
ymax = 11.0
ny = 25
[]
[Variables]
[./m]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./s_in]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff_m]
type = HeatConduction
variable = m
[../]
[./time_diff_m]
type = HeatConductionTimeDerivative
variable = m
[../]
[./s_in] # Add in the contribution from the SubApp
type = CoupledForce
variable = m
v = s_in
[../]
[]
[AuxKernels]
[./reconstruct_s_in]
type = FunctionSeriesToAux
variable = s_in
function = FX_Basis_Value_Main
[../]
[]
[Materials]
[./Unobtanium]
type = GenericConstantMaterial
prop_names = 'thermal_conductivity specific_heat density'
prop_values = '1.0 1.0 1.0' # W/(cm K), J/(g K), g/cm^3
[../]
[]
[ICs]
[./start_m]
type = ConstantIC
variable = m
value = 1
[../]
[]
[BCs]
[./surround]
type = DirichletBC
variable = m
value = 1
boundary = 'top bottom left right'
[../]
[]
[Functions]
[./FX_Basis_Value_Main]
type = FunctionSeries
series_type = Cartesian
orders = '3 4'
physical_bounds = '0.0 10.0 1.0 11.0'
x = Legendre
y = Legendre
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Main]
type = FXVolumeUserObject
function = FX_Basis_Value_Main
variable = m
[../]
[]
[Postprocessors]
[./average_value]
type = ElementAverageValue
variable = m
[../]
[./peak_value]
type = ElementExtremeValue
value_type = max
variable = m
[../]
[./picard_iterations]
type = NumFixedPointIterations
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
fixed_point_max_its = 30
nl_rel_tol = 1e-8
nl_abs_tol = 1e-9
fixed_point_rel_tol = 1e-8
fixed_point_abs_tol = 1e-9
[]
[Outputs]
exodus = true
[]
[MultiApps]
[./FXTransferApp]
type = TransientMultiApp
input_files = sub.i
[../]
[]
[Transfers]
[./ValueToSub]
type = MultiAppFXTransfer
to_multi_app = FXTransferApp
this_app_object_name = FX_Value_UserObject_Main
multi_app_object_name = FX_Basis_Value_Sub
[../]
[./ValueToMe]
type = MultiAppFXTransfer
from_multi_app = FXTransferApp
this_app_object_name = FX_Basis_Value_Main
multi_app_object_name = FX_Value_UserObject_Sub
[../]
[]
(modules/functional_expansion_tools/examples/2D_interface_no_material/sub.i)
# Derived from the example '2D_interface' with the following differences:
#
# 1) No materials are used
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0.4
xmax = 2.4
nx = 30
ymin = 0.0
ymax = 10.0
ny = 20
[]
[Variables]
[./s]
[../]
[]
[Kernels]
[./diff_s]
type = Diffusion
variable = s
[../]
[./time_diff_s]
type = TimeDerivative
variable = s
[../]
[]
[ICs]
[./start_s]
type = ConstantIC
value = 2
variable = s
[../]
[]
[BCs]
[./bottom]
type = DirichletBC
variable = s
boundary = bottom
value = 0.1
[../]
[./interface_flux]
type = FXFluxBC
boundary = left
variable = s
function = FX_Basis_Flux_Sub
[../]
[]
[Functions]
[./FX_Basis_Value_Sub]
type = FunctionSeries
series_type = Cartesian
orders = '4'
physical_bounds = '0.0 10'
y = Legendre
[../]
[./FX_Basis_Flux_Sub]
type = FunctionSeries
series_type = Cartesian
orders = '5'
physical_bounds = '0.0 10'
y = Legendre
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Sub]
type = FXBoundaryValueUserObject
function = FX_Basis_Value_Sub
variable = s
boundary = left
[../]
[./FX_Flux_UserObject_Sub]
type = FXBoundaryFluxUserObject
function = FX_Basis_Flux_Sub
variable = s
boundary = left
diffusivity = 1.0
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 1.0
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
(modules/functional_expansion_tools/test/tests/standard_use/volume_sub.i)
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0.0
xmax = 10.0
nx = 15
[]
[Variables]
[./empty]
[../]
[]
[AuxVariables]
[./s]
order = FIRST
family = LAGRANGE
[../]
[./m_in]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./null_kernel]
type = NullKernel
variable = empty
[../]
[]
[AuxKernels]
[./reconstruct_m_in]
type = FunctionSeriesToAux
function = FX_Basis_Value_Sub
variable = m_in
[../]
[./calculate_s]
type = ParsedAux
variable = s
coupled_variables = m_in
expression = '2*exp(-m_in/0.8)'
[../]
[]
[Functions]
[./FX_Basis_Value_Sub]
type = FunctionSeries
series_type = Cartesian
orders = '3'
physical_bounds = '0.0 10.0'
x = Legendre
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Sub]
type = FXVolumeUserObject
function = FX_Basis_Value_Sub
variable = s
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
(modules/functional_expansion_tools/examples/3D_volumetric_cylindrical_subapp_mesh_refine/sub.i)
# Derived from the example '3D_volumetric_cylindrical' with the following differences:
#
# 1) The model mesh is refined in the MasterApp by 1
# 2) Mesh adaptivity is enabled for the SubApp
# 3) Output from the SubApp is enabled so that the mesh changes can be visualized
[Mesh]
type = FileMesh
file = cyl-tet.e
[]
[Adaptivity]
marker = errorfrac
steps = 2
[./Indicators]
[./error]
type = GradientJumpIndicator
variable = s
outputs = none
[../]
[../]
[./Markers]
[./errorfrac]
type = ErrorFractionMarker
refine = 0.4
coarsen = 0.1
indicator = error
outputs = none
[../]
[../]
[]
# Non-copy transfers only work with AuxVariable, but nothing will be solved without a variable
# defined. The solution is to define an empty variable tha does nothing, but causes MOOSE to solve
# the AuxKernels that we need.
[Variables]
[./empty]
[../]
[]
[AuxVariables]
[./s]
order = FIRST
family = LAGRANGE
[../]
[./m_in]
order = FIRST
family = LAGRANGE
[../]
[]
# We must have a kernel for every variable, hence this null kernel to match the variable 'empty'
[Kernels]
[./null_kernel]
type = NullKernel
variable = empty
[../]
[]
[AuxKernels]
[./reconstruct_m_in]
type = FunctionSeriesToAux
function = FX_Basis_Value_Sub
variable = m_in
[../]
[./calculate_s] # Something to make 's' change each time, but allow a converging solution
type = ParsedAux
variable = s
coupled_variables = m_in
expression = '2*exp(-m_in/0.8)'
[../]
[]
[Functions]
[./FX_Basis_Value_Sub]
type = FunctionSeries
series_type = CylindricalDuo
orders = '5 3' # Axial first, then (r, t) FX
physical_bounds = '-2.5 2.5 0 0 1' # z_min z_max x_center y_center radius
z = Legendre # Axial in z
disc = Zernike # (r, t) default to unit disc in x-y plane
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Sub]
type = FXVolumeUserObject
function = FX_Basis_Value_Sub
variable = s
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
file_base = sub
[]
(modules/functional_expansion_tools/test/tests/errors/multiple_series_duo.i)
[Mesh]
type = GeneratedMesh
dim = 3
[]
[Functions]
[./series]
type = FunctionSeries
series_type = CylindricalDuo
orders = '0 1'
physical_bounds = '-1.0 1.0 0.0 0.0 1'
x = Legendre
disc = Zernike
y = Legendre
[../]
[]
[Executioner]
type = Steady
[]
[Problem]
solve = false
[]
(modules/functional_expansion_tools/test/tests/standard_use/volume_coupling_custom_norm_sub.i)
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0.0
xmax = 10.0
nx = 15
[]
[Variables]
[./empty]
[../]
[]
[AuxVariables]
[./s]
order = FIRST
family = LAGRANGE
[../]
[./m_in]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./null_kernel]
type = NullKernel
variable = empty
[../]
[]
[AuxKernels]
[./reconstruct_m_in]
type = FunctionSeriesToAux
function = FX_Basis_Value_Sub
variable = m_in
[../]
[./calculate_s]
type = ParsedAux
variable = s
coupled_variables = m_in
expression = '2*exp(-m_in/0.8)'
[../]
[]
[Functions]
[./FX_Basis_Value_Sub]
type = FunctionSeries
series_type = Cartesian
orders = '3'
physical_bounds = '0.0 10.0'
x = Legendre
generation_type = 'sqrt_mu'
expansion_type = 'sqrt_mu'
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Sub]
type = FXVolumeUserObject
function = FX_Basis_Value_Sub
variable = s
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
(modules/functional_expansion_tools/examples/2D_volumetric_Cartesian/sub.i)
# Basic example coupling a master and sub app in a 2D Cartesian volume.
#
# The master app provides field values to the sub app via Functional Expansions, which then performs
# its calculations. The sub app's solution field values are then transferred back to the master app
# and coupled into the solution of the master app solution.
#
# This example couples Functional Expansions via AuxVariable.
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0.0
xmax = 10.0
nx = 15
ymin = 1.0
ymax = 11.0
ny = 25
[]
# Non-copy transfers only work with AuxVariable, but nothing will be solved without a variable
# defined. The solution is to define an empty variable tha does nothing, but causes MOOSE to solve
# the AuxKernels that we need.
[Variables]
[./empty]
[../]
[]
[AuxVariables]
[./s]
order = FIRST
family = LAGRANGE
[../]
[./m_in]
order = FIRST
family = LAGRANGE
[../]
[]
# We must have a kernel for every variable, hence this null kernel to match the variable 'empty'
[Kernels]
[./null_kernel]
type = NullKernel
variable = empty
[../]
[]
[AuxKernels]
[./reconstruct_m_in]
type = FunctionSeriesToAux
function = FX_Basis_Value_Sub
variable = m_in
[../]
[./calculate_s] # Something to make 's' change each time, but allow a converging solution
type = ParsedAux
variable = s
coupled_variables = m_in
expression = '2*exp(-m_in/0.8)'
[../]
[]
[Functions]
[./FX_Basis_Value_Sub]
type = FunctionSeries
series_type = Cartesian
orders = '3 4'
physical_bounds = '0.0 10.0 1.0 11.0'
x = Legendre
y = Legendre
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Sub]
type = FXVolumeUserObject
function = FX_Basis_Value_Sub
variable = s
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
(modules/functional_expansion_tools/examples/3D_volumetric_Cartesian/main.i)
# Basic example coupling a master and sub app in a 3D Cartesian volume.
#
# The master app provides field values to the sub app via Functional Expansions, which then performs
# its calculations. The sub app's solution field values are then transferred back to the master app
# and coupled into the solution of the master app solution.
#
# This example couples Functional Expansions via AuxVariable.
#
# Note: this problem is not light, and may take a few minutes to solve.
[Mesh]
type = GeneratedMesh
dim = 3
xmin = 0.0
xmax = 10.0
nx = 15
ymin = 1.0
ymax = 11.0
ny = 25
zmin = 2.0
zmax = 12.0
nz = 35
[]
[Variables]
[./m]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./s_in]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff_m]
type = HeatConduction
variable = m
[../]
[./time_diff_m]
type = HeatConductionTimeDerivative
variable = m
[../]
[./s_in] # Add in the contribution from the SubApp
type = CoupledForce
variable = m
v = s_in
[../]
[]
[AuxKernels]
[./reconstruct_s_in]
type = FunctionSeriesToAux
variable = s_in
function = FX_Basis_Value_Main
[../]
[]
[Materials]
[./Unobtanium]
type = GenericConstantMaterial
prop_names = 'thermal_conductivity specific_heat density'
prop_values = '1.0 1.0 1.0' # W/(cm K), J/(g K), g/cm^3
[../]
[]
[ICs]
[./start_m]
type = ConstantIC
variable = m
value = 1
[../]
[]
[BCs]
[./surround]
type = DirichletBC
variable = m
value = 1
boundary = 'top bottom left right front back'
[../]
[]
[Functions]
[./FX_Basis_Value_Main]
type = FunctionSeries
series_type = Cartesian
orders = '3 4 5'
physical_bounds = '0.0 10.0 1.0 11.0 2.0 12.0'
x = Legendre
y = Legendre
z = Legendre
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Main]
type = FXVolumeUserObject
function = FX_Basis_Value_Main
variable = m
[../]
[]
[Postprocessors]
[./average_value]
type = ElementAverageValue
variable = m
[../]
[./peak_value]
type = ElementExtremeValue
value_type = max
variable = m
[../]
[./picard_iterations]
type = NumFixedPointIterations
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
fixed_point_max_its = 30
nl_rel_tol = 1e-8
nl_abs_tol = 1e-9
fixed_point_rel_tol = 1e-8
fixed_point_abs_tol = 1e-9
[]
[Outputs]
exodus = true
[]
[MultiApps]
[./FXTransferApp]
type = TransientMultiApp
input_files = sub.i
[../]
[]
[Transfers]
[./ValueToSub]
type = MultiAppFXTransfer
to_multi_app = FXTransferApp
this_app_object_name = FX_Value_UserObject_Main
multi_app_object_name = FX_Basis_Value_Sub
[../]
[./ValueToMe]
type = MultiAppFXTransfer
from_multi_app = FXTransferApp
this_app_object_name = FX_Basis_Value_Main
multi_app_object_name = FX_Value_UserObject_Sub
[../]
[]
(modules/functional_expansion_tools/test/tests/errors/multiapp_missing_local_object.i)
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0.0
xmax = 10.0
nx = 15
[]
[Variables]
[./m]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./s_in]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff_m]
type = Diffusion
variable = m
[../]
[./time_diff_m]
type = TimeDerivative
variable = m
[../]
[./s_in]
type = CoupledForce
variable = m
v = s_in
[../]
[]
[AuxKernels]
[./reconstruct_s_in]
type = FunctionSeriesToAux
variable = s_in
function = FX_Basis_Value_Main
[../]
[]
[ICs]
[./start_m]
type = ConstantIC
variable = m
value = 1
[../]
[]
[BCs]
[./surround]
type = DirichletBC
variable = m
value = 1
boundary = 'left right'
[../]
[]
[Functions]
[./FX_Basis_Value_Main]
type = FunctionSeries
series_type = Cartesian
orders = '3'
physical_bounds = '0.0 10.0'
x = Legendre
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Main]
type = FXVolumeUserObject
function = FX_Basis_Value_Main
variable = m
[../]
[]
[Postprocessors]
[./average_value]
type = ElementAverageValue
variable = m
[../]
[./peak_value]
type = ElementExtremeValue
value_type = max
variable = m
[../]
[./picard_iterations]
type = NumFixedPointIterations
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
fixed_point_max_its = 30
nl_rel_tol = 1e-8
nl_abs_tol = 1e-9
fixed_point_rel_tol = 1e-8
fixed_point_abs_tol = 1e-9
[]
[MultiApps]
[./FXTransferApp]
type = TransientMultiApp
input_files = multiapp_sub.i
[../]
[]
[Transfers]
[./ValueToSub]
type = MultiAppFXTransfer
to_multi_app = FXTransferApp
this_app_object_name = FX_Value_UserObject
multi_app_object_name = FX_Basis_Value_Sub
[../]
[./ValueToMe]
type = MultiAppFXTransfer
from_multi_app = FXTransferApp
this_app_object_name = FX_Basis_Value_Main
multi_app_object_name = FX_Value_UserObject_Sub
[../]
[]
(modules/functional_expansion_tools/test/tests/standard_use/volume_coupling_custom_norm.i)
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0.0
xmax = 10.0
nx = 15
[]
[Variables]
[./m]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./s_in]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff_m]
type = Diffusion
variable = m
[../]
[./time_diff_m]
type = TimeDerivative
variable = m
[../]
[./s_in]
type = CoupledForce
variable = m
v = s_in
[../]
[]
[AuxKernels]
[./reconstruct_s_in]
type = FunctionSeriesToAux
variable = s_in
function = FX_Basis_Value_Main
[../]
[]
[ICs]
[./start_m]
type = ConstantIC
variable = m
value = 1
[../]
[]
[BCs]
[./surround]
type = DirichletBC
variable = m
value = 1
boundary = 'left right'
[../]
[]
[Functions]
[./FX_Basis_Value_Main]
type = FunctionSeries
series_type = Cartesian
orders = '3'
physical_bounds = '0.0 10.0'
x = Legendre
generation_type = 'sqrt_mu'
expansion_type = 'sqrt_mu'
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Main]
type = FXVolumeUserObject
function = FX_Basis_Value_Main
variable = m
[../]
[]
[Postprocessors]
[./average_value]
type = ElementAverageValue
variable = m
[../]
[./peak_value]
type = ElementExtremeValue
value_type = max
variable = m
[../]
[./picard_iterations]
type = NumFixedPointIterations
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
fixed_point_max_its = 30
nl_rel_tol = 1e-8
nl_abs_tol = 1e-9
fixed_point_rel_tol = 1e-8
fixed_point_abs_tol = 1e-9
[]
[Outputs]
exodus = true
file_base = 'volume_coupled_out'
[]
[MultiApps]
[./FXTransferApp]
type = TransientMultiApp
input_files = volume_coupling_custom_norm_sub.i
[../]
[]
[Transfers]
[./ValueToSub]
type = MultiAppFXTransfer
to_multi_app = FXTransferApp
this_app_object_name = FX_Value_UserObject_Main
multi_app_object_name = FX_Basis_Value_Sub
[../]
[./ValueToMe]
type = MultiAppFXTransfer
from_multi_app = FXTransferApp
this_app_object_name = FX_Basis_Value_Main
multi_app_object_name = FX_Value_UserObject_Sub
[../]
[]
(modules/functional_expansion_tools/examples/2D_interface/main.i)
# Basic example coupling a master and sub app at an interface in a 2D model.
# The master app provides a flux term to the sub app via Functional Expansions, which then performs
# its calculations. The sub app's interface conditions, both value and flux, are transferred back
# to the master app
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0.0
xmax = 0.4
nx = 6
ymin = 0.0
ymax = 10.0
ny = 20
[]
[Variables]
[./m]
[../]
[]
[Kernels]
[./diff_m]
type = HeatConduction
variable = m
[../]
[./time_diff_m]
type = HeatConductionTimeDerivative
variable = m
[../]
[./source_m]
type = BodyForce
variable = m
value = 100
[../]
[]
[Materials]
[./Impervium]
type = GenericConstantMaterial
prop_names = 'thermal_conductivity specific_heat density'
prop_values = '0.00001 50.0 100.0' # W/(cm K), J/(g K), g/cm^3
[../]
[]
[ICs]
[./start_m]
type = ConstantIC
value = 2
variable = m
[../]
[]
[BCs]
[./interface_value]
type = FXValueBC
variable = m
boundary = right
function = FX_Basis_Value_Main
[../]
[./interface_flux]
type = FXFluxBC
boundary = right
variable = m
function = FX_Basis_Flux_Main
[../]
[]
[Functions]
[./FX_Basis_Value_Main]
type = FunctionSeries
series_type = Cartesian
orders = '4'
physical_bounds = '0.0 10'
y = Legendre
[../]
[./FX_Basis_Flux_Main]
type = FunctionSeries
series_type = Cartesian
orders = '5'
physical_bounds = '0.0 10'
y = Legendre
[../]
[]
[UserObjects]
[./FX_Flux_UserObject_Main]
type = FXBoundaryFluxUserObject
function = FX_Basis_Flux_Main
variable = m
boundary = right
diffusivity = thermal_conductivity
[../]
[]
[Postprocessors]
[./average_interface_value]
type = SideAverageValue
variable = m
boundary = right
[../]
[./total_flux]
type = SideDiffusiveFluxIntegral
variable = m
boundary = right
diffusivity = thermal_conductivity
[../]
[./picard_iterations]
type = NumFixedPointIterations
execute_on = 'initial timestep_end'
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 1.0
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
fixed_point_max_its = 30
nl_rel_tol = 1e-8
nl_abs_tol = 1e-9
fixed_point_rel_tol = 1e-8
fixed_point_abs_tol = 1e-9
[]
[Outputs]
exodus = true
[]
[MultiApps]
[./FXTransferApp]
type = TransientMultiApp
input_files = sub.i
sub_cycling = true
[../]
[]
[Transfers]
[./FluxToSub]
type = MultiAppFXTransfer
to_multi_app = FXTransferApp
this_app_object_name = FX_Flux_UserObject_Main
multi_app_object_name = FX_Basis_Flux_Sub
[../]
[./ValueToMe]
type = MultiAppFXTransfer
from_multi_app = FXTransferApp
this_app_object_name = FX_Basis_Value_Main
multi_app_object_name = FX_Value_UserObject_Sub
[../]
[./FluxToMe]
type = MultiAppFXTransfer
from_multi_app = FXTransferApp
this_app_object_name = FX_Basis_Flux_Main
multi_app_object_name = FX_Flux_UserObject_Sub
[../]
[]
(modules/functional_expansion_tools/examples/3D_volumetric_Cartesian_different_submesh/sub.i)
# Derived from the example '3D_volumetric_Cartesian' with the following differences:
#
# 1) The number of x and y divisions in the sub app is not the same as the master app
# 2) The subapp mesh is skewed in x and z
[Mesh]
type = GeneratedMesh
dim = 3
xmin = 0.0
xmax = 10.0
nx = 23
bias_x = 1.2
ymin = 1.0
ymax = 11.0
ny = 33
zmin = 2.0
zmax = 12.0
nz = 35
bias_z = 0.8
[]
# Non-copy transfers only work with AuxVariable, but nothing will be solved without a variable
# defined. The solution is to define an empty variable tha does nothing, but causes MOOSE to solve
# the AuxKernels that we need.
[Variables]
[./empty]
[../]
[]
[AuxVariables]
[./s]
order = FIRST
family = LAGRANGE
[../]
[./m_in]
order = FIRST
family = LAGRANGE
[../]
[]
# We must have a kernel for every variable, hence this null kernel to match the variable 'empty'
[Kernels]
[./null_kernel]
type = NullKernel
variable = empty
[../]
[]
[AuxKernels]
[./reconstruct_m_in]
type = FunctionSeriesToAux
function = FX_Basis_Value_Sub
variable = m_in
[../]
[./calculate_s] # Something to make 's' change each time, but allow a converging solution
type = ParsedAux
variable = s
coupled_variables = m_in
expression = '2*exp(-m_in/0.8)'
[../]
[]
[Functions]
[./FX_Basis_Value_Sub]
type = FunctionSeries
series_type = Cartesian
orders = '3 4 5'
physical_bounds = '0.0 10.0 1.0 11.0 2.0 12.0'
x = Legendre
y = Legendre
z = Legendre
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Sub]
type = FXVolumeUserObject
function = FX_Basis_Value_Sub
variable = s
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
(modules/functional_expansion_tools/test/tests/standard_use/neglect_invalid_enum.i)
[Mesh]
type = GeneratedMesh
dim = 1
xmin = -1
xmax = 1
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diffusion]
type = Diffusion
variable = u
[../]
[]
[Functions]
[./series]
type = FunctionSeries
series_type = Cartesian
x = Legendre
disc = Zernike
orders = '0'
physical_bounds = '-1 1'
[../]
[]
[Executioner]
type = Steady
[]
(modules/functional_expansion_tools/examples/3D_volumetric_Cartesian_different_submesh/main.i)
# Derived from the example '3D_volumetric_Cartesian' with the following differences:
#
# 1) The number of x and y divisions in the sub app is not the same as the master app
# 2) The subapp mesh is skewed in x and z
[Mesh]
type = GeneratedMesh
dim = 3
xmin = 0.0
xmax = 10.0
nx = 15
ymin = 1.0
ymax = 11.0
ny = 25
zmin = 2.0
zmax = 12.0
nz = 35
[]
[Variables]
[./m]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./s_in]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff_m]
type = HeatConduction
variable = m
[../]
[./time_diff_m]
type = HeatConductionTimeDerivative
variable = m
[../]
[./s_in] # Add in the contribution from the SubApp
type = CoupledForce
variable = m
v = s_in
[../]
[]
[AuxKernels]
[./reconstruct_s_in]
type = FunctionSeriesToAux
variable = s_in
function = FX_Basis_Value_Main
[../]
[]
[Materials]
[./Unobtanium]
type = GenericConstantMaterial
prop_names = 'thermal_conductivity specific_heat density'
prop_values = '1.0 1.0 1.0' # W/(cm K), J/(g K), g/cm^3
[../]
[]
[ICs]
[./start_m]
type = ConstantIC
variable = m
value = 1
[../]
[]
[BCs]
[./surround]
type = DirichletBC
variable = m
value = 1
boundary = 'top bottom left right front back'
[../]
[]
[Functions]
[./FX_Basis_Value_Main]
type = FunctionSeries
series_type = Cartesian
orders = '3 4 5'
physical_bounds = '0.0 10.0 1.0 11.0 2.0 12.0'
x = Legendre
y = Legendre
z = Legendre
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Main]
type = FXVolumeUserObject
function = FX_Basis_Value_Main
variable = m
[../]
[]
[Postprocessors]
[./average_value]
type = ElementAverageValue
variable = m
[../]
[./peak_value]
type = ElementExtremeValue
value_type = max
variable = m
[../]
[./picard_iterations]
type = NumFixedPointIterations
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
fixed_point_max_its = 30
nl_rel_tol = 1e-8
nl_abs_tol = 1e-9
fixed_point_rel_tol = 1e-8
fixed_point_abs_tol = 1e-9
[]
[Outputs]
exodus = true
[]
[MultiApps]
[./FXTransferApp]
type = TransientMultiApp
input_files = sub.i
[../]
[]
[Transfers]
[./ValueToSub]
type = MultiAppFXTransfer
to_multi_app = FXTransferApp
this_app_object_name = FX_Value_UserObject_Main
multi_app_object_name = FX_Basis_Value_Sub
[../]
[./ValueToMe]
type = MultiAppFXTransfer
from_multi_app = FXTransferApp
this_app_object_name = FX_Basis_Value_Main
multi_app_object_name = FX_Value_UserObject_Sub
[../]
[]
(modules/functional_expansion_tools/examples/3D_volumetric_cylindrical/sub.i)
# Basic example coupling a master and sub app in a 3D cylindrical mesh from an input file
#
# The master app provides field values to the sub app via Functional Expansions, which then performs
# its calculations. The sub app's solution field values are then transferred back to the master app
# and coupled into the solution of the master app solution.
#
# This example couples Functional Expansions via AuxVariable, the recommended approach.
#
# Note: this problem is not light, and may take a few minutes to solve.
[Mesh]
type = FileMesh
file = cyl-tet.e
[]
# Non-copy transfers only work with AuxVariable, but nothing will be solved without a variable
# defined. The solution is to define an empty variable tha does nothing, but causes MOOSE to solve
# the AuxKernels that we need.
[Variables]
[./empty]
[../]
[]
[AuxVariables]
[./s]
order = FIRST
family = LAGRANGE
[../]
[./m_in]
order = FIRST
family = LAGRANGE
[../]
[]
# We must have a kernel for every variable, hence this null kernel to match the variable 'empty'
[Kernels]
[./null_kernel]
type = NullKernel
variable = empty
[../]
[]
[AuxKernels]
[./reconstruct_m_in]
type = FunctionSeriesToAux
function = FX_Basis_Value_Sub
variable = m_in
[../]
[./calculate_s] # Something to make 's' change each time, but allow a converging solution
type = ParsedAux
variable = s
coupled_variables = m_in
expression = '2*exp(-m_in/0.8)'
[../]
[]
[Functions]
[./FX_Basis_Value_Sub]
type = FunctionSeries
series_type = CylindricalDuo
orders = '5 3' # Axial first, then (r, t) FX
physical_bounds = '-2.5 2.5 0 0 1' # z_min z_max x_center y_center radius
z = Legendre # Axial in z
disc = Zernike # (r, t) default to unit disc in x-y plane
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Sub]
type = FXVolumeUserObject
function = FX_Basis_Value_Sub
variable = s
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
(modules/functional_expansion_tools/examples/3D_volumetric_cylindrical/main.i)
# Basic example coupling a master and sub app in a 3D cylindrical mesh from an input file
#
# The master app provides field values to the sub app via Functional Expansions, which then performs
# its calculations. The sub app's solution field values are then transferred back to the master app
# and coupled into the solution of the master app solution.
#
# This example couples Functional Expansions via AuxVariable, the recommended approach.
#
# Note: this problem is not light, and may take a few minutes to solve.
[Mesh]
type = FileMesh
file = cyl-tet.e
[]
[Variables]
[./m]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./s_in]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff_m]
type = HeatConduction
variable = m
[../]
[./time_diff_m]
type = HeatConductionTimeDerivative
variable = m
[../]
[./s_in] # Add in the contribution from the SubApp
type = CoupledForce
variable = m
v = s_in
[../]
[]
[AuxKernels]
[./reconstruct_s_in]
type = FunctionSeriesToAux
variable = s_in
function = FX_Basis_Value_Main
[../]
[]
[Materials]
[./Unobtanium]
type = GenericConstantMaterial
prop_names = 'thermal_conductivity specific_heat density'
prop_values = '1.0 1.0 1.0' # W/(cm K), J/(g K), g/cm^3
[../]
[]
[ICs]
[./start_m]
type = ConstantIC
variable = m
value = 1
[../]
[]
[BCs]
[./surround]
type = DirichletBC
variable = m
value = 1
boundary = 'top bottom outside'
[../]
[]
[Functions]
[./FX_Basis_Value_Main]
type = FunctionSeries
series_type = CylindricalDuo
orders = '5 3' # Axial first, then (r, t) FX
physical_bounds = '-2.5 2.5 0 0 1' # z_min z_max x_center y_center radius
z = Legendre # Axial in z
disc = Zernike # (r, t) default to unit disc in x-y plane
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Main]
type = FXVolumeUserObject
function = FX_Basis_Value_Main
variable = m
[../]
[]
[Postprocessors]
[./average_value]
type = ElementAverageValue
variable = m
[../]
[./peak_value]
type = ElementExtremeValue
value_type = max
variable = m
[../]
[./picard_iterations]
type = NumFixedPointIterations
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
fixed_point_max_its = 30
nl_rel_tol = 1e-8
nl_abs_tol = 1e-9
fixed_point_rel_tol = 1e-8
fixed_point_abs_tol = 1e-9
[]
[Outputs]
exodus = true
[]
[MultiApps]
[./FXTransferApp]
type = TransientMultiApp
input_files = sub.i
[../]
[]
[Transfers]
[./ValueToSub]
type = MultiAppFXTransfer
to_multi_app = FXTransferApp
this_app_object_name = FX_Value_UserObject_Main
multi_app_object_name = FX_Basis_Value_Sub
[../]
[./ValueToMe]
type = MultiAppFXTransfer
from_multi_app = FXTransferApp
this_app_object_name = FX_Basis_Value_Main
multi_app_object_name = FX_Value_UserObject_Sub
[../]
[]
(modules/functional_expansion_tools/test/tests/errors/missing_series_duo_disc.i)
[Mesh]
type = GeneratedMesh
dim = 3
[]
[Functions]
[./series]
type = FunctionSeries
series_type = CylindricalDuo
orders = '0 1'
physical_bounds = '-1.0 1.0 0.0 0.0 1'
x = Legendre
[../]
[]
[Executioner]
type = Steady
[]
[Problem]
solve = false
[]
(modules/functional_expansion_tools/test/tests/standard_use/multiapp_sub.i)
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0.0
xmax = 10.0
nx = 15
[]
[Variables]
[./empty]
[../]
[]
[AuxVariables]
[./s]
order = FIRST
family = LAGRANGE
[../]
[./m_in]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./null_kernel]
type = NullKernel
variable = empty
[../]
[]
[AuxKernels]
[./reconstruct_m_in]
type = FunctionSeriesToAux
function = FX_Basis_Value_Sub
variable = m_in
[../]
[./calculate_s]
type = ParsedAux
variable = s
coupled_variables = m_in
expression = '2*exp(-m_in/0.8)'
[../]
[]
[Functions]
[./FX_Basis_Value_Sub]
type = FunctionSeries
series_type = Cartesian
orders = '3'
physical_bounds = '0.0 10.0'
x = Legendre
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Sub]
type = FXVolumeUserObject
function = FX_Basis_Value_Sub
variable = s
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
(modules/functional_expansion_tools/test/tests/errors/invalid_bounds_length.i)
[Mesh]
type = GeneratedMesh
dim = 3
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diffusion]
type = Diffusion
variable = u
[../]
[]
[Functions]
[./series]
type = FunctionSeries
series_type = Cartesian
x = Legendre
orders = '0'
physical_bounds = '-1 1 0 3'
[../]
[]
[Executioner]
type = Steady
[]
(modules/functional_expansion_tools/examples/1D_volumetric_Cartesian/main.i)
# Basic example coupling a master and sub app in a 1D Cartesian volume.
#
# The master app provides field values to the sub app via Functional Expansions, which then performs
# its calculations. The sub app's solution field values are then transferred back to the master app
# and coupled into the solution of the master app solution.
#
# This example couples Functional Expansions via AuxVariable.
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0.0
xmax = 10.0
nx = 15
[]
[Variables]
[./m]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./s_in]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff_m]
type = HeatConduction
variable = m
[../]
[./time_diff_m]
type = HeatConductionTimeDerivative
variable = m
[../]
[./s_in] # Add in the contribution from the SubApp
type = CoupledForce
variable = m
v = s_in
[../]
[]
[AuxKernels]
[./reconstruct_s_in]
type = FunctionSeriesToAux
variable = s_in
function = FX_Basis_Value_Main
[../]
[]
[Materials]
[./Unobtanium]
type = GenericConstantMaterial
prop_names = 'thermal_conductivity specific_heat density'
prop_values = '1.0 1.0 1.0' # W/(cm K), J/(g K), g/cm^3
[../]
[]
[ICs]
[./start_m]
type = ConstantIC
variable = m
value = 1
[../]
[]
[BCs]
[./surround]
type = DirichletBC
variable = m
value = 1
boundary = 'left right'
[../]
[]
[Functions]
[./FX_Basis_Value_Main]
type = FunctionSeries
series_type = Cartesian
orders = '3'
physical_bounds = '0.0 10.0'
x = Legendre
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Main]
type = FXVolumeUserObject
function = FX_Basis_Value_Main
variable = m
[../]
[]
[Postprocessors]
[./average_value]
type = ElementAverageValue
variable = m
[../]
[./peak_value]
type = ElementExtremeValue
value_type = max
variable = m
[../]
[./picard_iterations]
type = NumFixedPointIterations
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
fixed_point_max_its = 30
nl_rel_tol = 1e-8
nl_abs_tol = 1e-9
fixed_point_rel_tol = 1e-8
fixed_point_abs_tol = 1e-9
[]
[Outputs]
exodus = true
[]
[MultiApps]
[./FXTransferApp]
type = TransientMultiApp
input_files = sub.i
[../]
[]
[Transfers]
[./ValueToSub]
type = MultiAppFXTransfer
to_multi_app = FXTransferApp
this_app_object_name = FX_Value_UserObject_Main
multi_app_object_name = FX_Basis_Value_Sub
[../]
[./ValueToMe]
type = MultiAppFXTransfer
from_multi_app = FXTransferApp
this_app_object_name = FX_Basis_Value_Main
multi_app_object_name = FX_Value_UserObject_Sub
[../]
[]
(modules/functional_expansion_tools/test/tests/errors/multiapp_bad_function_series.i)
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0.0
xmax = 10.0
nx = 15
[]
[Variables]
[./m]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./s_in]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff_m]
type = Diffusion
variable = m
[../]
[./time_diff_m]
type = TimeDerivative
variable = m
[../]
[./s_in]
type = CoupledForce
variable = m
v = s_in
[../]
[]
[AuxKernels]
[./reconstruct_s_in]
type = FunctionSeriesToAux
variable = s_in
function = FX_Basis_Value_Main
[../]
[]
[ICs]
[./start_m]
type = ConstantIC
variable = m
value = 1
[../]
[]
[BCs]
[./surround]
type = DirichletBC
variable = m
value = 1
boundary = 'left right'
[../]
[]
[Functions]
[./FX_Basis_Value_Main]
type = FunctionSeries
series_type = Cartesian
orders = '3'
physical_bounds = '0.0 10.0'
x = Legendre
[../]
[./AnotherFunction]
type = ConstantFunction
value = -1
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Main]
type = FXVolumeUserObject
function = FX_Basis_Value_Main
variable = m
[../]
[]
[Postprocessors]
[./average_value]
type = ElementAverageValue
variable = m
[../]
[./peak_value]
type = ElementExtremeValue
value_type = max
variable = m
[../]
[./picard_iterations]
type = NumFixedPointIterations
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
fixed_point_max_its = 30
nl_rel_tol = 1e-8
nl_abs_tol = 1e-9
fixed_point_rel_tol = 1e-8
fixed_point_abs_tol = 1e-9
[]
[MultiApps]
[./FXTransferApp]
type = TransientMultiApp
input_files = multiapp_sub.i
[../]
[]
[Transfers]
[./ValueToSub]
type = MultiAppFXTransfer
to_multi_app = FXTransferApp
this_app_object_name = AnotherFunction
multi_app_object_name = FX_Basis_Value_Sub
[../]
[./ValueToMe]
type = MultiAppFXTransfer
from_multi_app = FXTransferApp
this_app_object_name = FX_Basis_Value_Main
multi_app_object_name = FX_Value_UserObject_Sub
[../]
[]
(modules/functional_expansion_tools/test/tests/errors/missing_series_duo_axis.i)
[Mesh]
type = GeneratedMesh
dim = 3
[]
[Functions]
[./series]
type = FunctionSeries
series_type = CylindricalDuo
orders = '0 1'
physical_bounds = '-1.0 1.0 0.0 0.0 1'
disc = Zernike
[../]
[]
[Executioner]
type = Steady
[]
[Problem]
solve = false
[]
(modules/functional_expansion_tools/examples/3D_volumetric_cylindrical_subapp_mesh_refine/main.i)
# Derived from the example '3D_volumetric_cylindrical' with the following differences:
#
# 1) The model mesh is refined in the MasterApp by 1
# 2) Mesh adaptivity is enabled for the SubApp
# 3) Output from the SubApp is enabled so that the mesh changes can be visualized
[Mesh]
type = FileMesh
file = cyl-tet.e
uniform_refine = 1
[]
[Variables]
[./m]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./s_in]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff_m]
type = HeatConduction
variable = m
[../]
[./time_diff_m]
type = HeatConductionTimeDerivative
variable = m
[../]
[./s_in] # Add in the contribution from the SubApp
type = CoupledForce
variable = m
v = s_in
[../]
[]
[AuxKernels]
[./reconstruct_s_in]
type = FunctionSeriesToAux
variable = s_in
function = FX_Basis_Value_Main
[../]
[]
[Materials]
[./Unobtanium]
type = GenericConstantMaterial
prop_names = 'thermal_conductivity specific_heat density'
prop_values = '1.0 1.0 1.0' # W/(cm K), J/(g K), g/cm^3
[../]
[]
[ICs]
[./start_m]
type = ConstantIC
variable = m
value = 1
[../]
[]
[BCs]
[./surround]
type = DirichletBC
variable = m
value = 1
boundary = 'top bottom outside'
[../]
[]
[Functions]
[./FX_Basis_Value_Main]
type = FunctionSeries
series_type = CylindricalDuo
orders = '5 3' # Axial first, then (r, t) FX
physical_bounds = '-2.5 2.5 0 0 1' # z_min z_max x_center y_center radius
z = Legendre # Axial in z
disc = Zernike # (r, t) default to unit disc in x-y plane
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Main]
type = FXVolumeUserObject
function = FX_Basis_Value_Main
variable = m
[../]
[]
[Postprocessors]
[./average_value]
type = ElementAverageValue
variable = m
[../]
[./peak_value]
type = ElementExtremeValue
value_type = max
variable = m
[../]
[./picard_iterations]
type = NumFixedPointIterations
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
fixed_point_max_its = 30
nl_rel_tol = 1e-8
nl_abs_tol = 1e-9
fixed_point_rel_tol = 1e-8
fixed_point_abs_tol = 1e-9
[]
[Outputs]
exodus = true
[]
[MultiApps]
[./FXTransferApp]
type = TransientMultiApp
input_files = sub.i
output_sub_cycles = true
[../]
[]
[Transfers]
[./ValueToSub]
type = MultiAppFXTransfer
to_multi_app = FXTransferApp
this_app_object_name = FX_Value_UserObject_Main
multi_app_object_name = FX_Basis_Value_Sub
[../]
[./ValueToMe]
type = MultiAppFXTransfer
from_multi_app = FXTransferApp
this_app_object_name = FX_Basis_Value_Main
multi_app_object_name = FX_Value_UserObject_Sub
[../]
[]