- inputThe mesh we want to modify
C++ Type:MeshGeneratorName
Controllable:No
Description:The mesh we want to modify
ParsedNodeTransformGenerator
Applies a transform to a the x,y,z coordinates of a Mesh
Overview
The ParsedNodeTransformGenerator generator allows the user to specify parsed expressions to compute the new positions of all mesh nodes as the function of their old positions. The old node positions components are made available as function symbols x, y, and z. The new node position components are determined by the "x_function", "y_function", and "z_function" parameters. The parsed expression syntax available is the same as used in ParsedFunction and ParsedMaterial.
Input Parameters
- constant_expressionsVector of values for the constants in constant_names (can be an FParser expression)
C++ Type:std::vector<std::string>
Controllable:No
Description:Vector of values for the constants in constant_names (can be an FParser expression)
- constant_namesVector of constants used in the parsed function
C++ Type:std::vector<std::string>
Controllable:No
Description:Vector of constants used in the parsed function
- epsilon0Fuzzy comparison tolerance
Default:0
C++ Type:Real
Unit:(no unit assumed)
Controllable:No
Description:Fuzzy comparison tolerance
- x_functionxFunction for the updated x component of the node
Default:x
C++ Type:ParsedFunctionExpression
Unit:(no unit assumed)
Controllable:No
Description:Function for the updated x component of the node
- y_functionyFunction for the updated y component of the node
Default:y
C++ Type:ParsedFunctionExpression
Unit:(no unit assumed)
Controllable:No
Description:Function for the updated y component of the node
- z_functionzFunction for the updated z component of the node
Default:z
C++ Type:ParsedFunctionExpression
Unit:(no unit assumed)
Controllable:No
Description:Function for the updated z component of the node
Optional Parameters
- disable_fpoptimizerFalseDisable the function parser algebraic optimizer
Default:False
C++ Type:bool
Controllable:No
Description:Disable the function parser algebraic optimizer
- enable_ad_cacheTrueEnable caching of function derivatives for faster startup time
Default:True
C++ Type:bool
Controllable:No
Description:Enable caching of function derivatives for faster startup time
- enable_auto_optimizeTrueEnable automatic immediate optimization of derivatives
Default:True
C++ Type:bool
Controllable:No
Description:Enable automatic immediate optimization of derivatives
- enable_jitTrueEnable just-in-time compilation of function expressions for faster evaluation
Default:True
C++ Type:bool
Controllable:No
Description:Enable just-in-time compilation of function expressions for faster evaluation
- evalerror_behaviornanWhat to do if evaluation error occurs. Options are to pass a nan, pass a nan with a warning, throw a error, or throw an exception
Default:nan
C++ Type:MooseEnum
Options:nan, nan_warning, error, exception
Controllable:No
Description:What to do if evaluation error occurs. Options are to pass a nan, pass a nan with a warning, throw a error, or throw an exception
Parsed Expression Advanced Parameters
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Controllable:No
Description:Set the enabled status of the MooseObject.
- save_with_nameKeep the mesh from this mesh generator in memory with the name specified
C++ Type:std::string
Controllable:No
Description:Keep the mesh from this mesh generator in memory with the name specified
Advanced Parameters
- nemesisFalseWhether or not to output the mesh file in the nemesisformat (only if output = true)
Default:False
C++ Type:bool
Controllable:No
Description:Whether or not to output the mesh file in the nemesisformat (only if output = true)
- outputFalseWhether or not to output the mesh file after generating the mesh
Default:False
C++ Type:bool
Controllable:No
Description:Whether or not to output the mesh file after generating the mesh
- show_infoFalseWhether or not to show mesh info after generating the mesh (bounding box, element types, sidesets, nodesets, subdomains, etc)
Default:False
C++ Type:bool
Controllable:No
Description:Whether or not to show mesh info after generating the mesh (bounding box, element types, sidesets, nodesets, subdomains, etc)
Debugging Parameters
Input Files
- (test/tests/meshgenerators/compute_node_position/3d.i)
- (test/tests/meshgenerators/manifold_subdomain/cone.i)
- (test/tests/meshgenerators/xyz_delaunay_generator/xyzdelaunay_mesh_generator_2d.i)
- (test/tests/meshgenerators/xyz_delaunay_generator/xyzdelaunay_nested.i)
- (test/tests/meshgenerators/xyz_delaunay_generator/err_xyzdelaunay_with_holes_mix.i)
- (test/tests/meshgenerators/xyz_delaunay_generator/xyzdelaunay_smoothed.i)
- (modules/contact/test/tests/nodal_normal_derivatives/curved_3d_action.i)
- (test/tests/meshgenerators/xyz_delaunay_generator/xyzdelaunay_quadratic.i)
- (test/tests/meshgenerators/xyz_delaunay_generator/xyzdelaunay_with_holes_1d.i)
- (test/tests/meshgenerators/xyz_delaunay_generator/xyzdelaunay_mesh_generator_3d.i)
- (modules/contact/test/tests/dual_mortar/mortar_mechanical_contact_force_balance.i)
- (test/tests/meshgenerators/compute_node_position/2d.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/newton_physics/lid-driven-turb-capped-physics.i)
- (test/tests/meshgenerators/xyz_delaunay_generator/xyzdelaunay_with_holes_2d.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/segregated/lid-driven-turb-capped.i)
- (test/tests/meshgenerators/xyz_delaunay_generator/xyzdelaunay_with_holes_3d.i)
- (test/tests/meshgenerators/xyz_delaunay_generator/xyzdelaunay_stitching.i)
x_function
Default:x
C++ Type:ParsedFunctionExpression
Unit:(no unit assumed)
Controllable:No
Description:Function for the updated x component of the node
y_function
Default:y
C++ Type:ParsedFunctionExpression
Unit:(no unit assumed)
Controllable:No
Description:Function for the updated y component of the node
z_function
Default:z
C++ Type:ParsedFunctionExpression
Unit:(no unit assumed)
Controllable:No
Description:Function for the updated z component of the node
(test/tests/meshgenerators/compute_node_position/3d.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 3
nx = 5
ny = 5
nz = 10
xmin = -0.5
ymin = -0.5
xmax = 0.5
ymax = 0.5
zmax = 3
[]
[node_pos]
type = ParsedNodeTransformGenerator
input = gen
x_function = 'x*cos(z) + y*sin(z)'
y_function = '-x*sin(z) + y*cos(z)'
z_function = 'z^0.8'
[]
[]
(test/tests/meshgenerators/manifold_subdomain/cone.i)
expected = '2975'
!include check.i
[Mesh]
[disk]
type = ConcentricCircleMeshGenerator
num_sectors = 6
radii = '0.9'
rings = '10'
has_outer_square = false
preserve_volumes = false
[]
[cone]
type = ParsedNodeTransformGenerator
input = disk
z_function = '0.9 - sqrt(x * x + y * y)'
[]
[surface_quads]
type = StitchMeshGenerator
inputs = 'cone disk'
stitch_boundaries_pairs = 'outer outer'
clear_stitched_boundary_ids = true
[]
[background]
type = GeneratedMeshGenerator
dim = 3
nx = 25
ny = 25
nz = 25
xmin = -1
xmax = 1
ymin = -1
ymax = 1
zmax = 1
[]
[surface]
type = ElementsToSimplicesConverter
input = surface_quads
[]
[tag]
type = ManifoldSubdomainGenerator
input = background
manifold = surface
block_id = 1
[]
[remove]
type = BlockDeletionGenerator
input = tag
block = '0'
[]
[]
(test/tests/meshgenerators/xyz_delaunay_generator/xyzdelaunay_mesh_generator_2d.i)
[Mesh]
[fmg]
type = FileMeshGenerator
file = 'gold/2d_cube.e'
[]
[outer_bdy]
type = ParsedNodeTransformGenerator
input = fmg
x_function = "x"
y_function = "y"
z_function = "z+x*y*z"
[]
[triang]
type = XYZDelaunayGenerator
boundary = 'outer_bdy'
# Let NetGen know interior points are okay
desired_volume = 100000
[]
[]
[Executioner]
type = Steady
[]
[Postprocessors]
[volume]
type = VolumePostprocessor
[]
[]
[Problem]
solve = false
[]
[Outputs]
[output]
type = CSV
file_base = 'xyzdelaunay_mesh_generator_out'
[]
[]
(test/tests/meshgenerators/xyz_delaunay_generator/xyzdelaunay_nested.i)
[Mesh]
[inner_cube]
type = GeneratedMeshGenerator
dim = 3
elem_type = TET4
nx = 1
ny = 1
nz = 1
xmin = -0.4
xmax = 0.4
ymin = -0.4
ymax = 0.4
zmin = -0.4
zmax = 0.4
[]
[gmg]
type = GeneratedMeshGenerator
dim = 3
nx = 1
ny = 1
nz = 1
xmin = -1
xmax = 1
ymin = -1
ymax = 1
zmin = -1
zmax = 1
[]
[layer_2_bdy]
type = ParsedNodeTransformGenerator
input = gmg
x_function = "z+x"
y_function = "y"
z_function = "z-x"
[]
[layer_3_bdy]
type = ParsedNodeTransformGenerator
input = gmg
x_function = "3*x"
y_function = "3*y"
z_function = "3*z"
[]
[layer_4_bdy]
type = ParsedNodeTransformGenerator
input = gmg
x_function = "4*x"
y_function = "4*y"
z_function = "4*z"
[]
[triang_2]
type = XYZDelaunayGenerator
boundary = 'layer_2_bdy'
holes = 'inner_cube'
stitch_holes = 'true'
desired_volume = 0.1
[]
[triang_3]
type = XYZDelaunayGenerator
boundary = 'layer_3_bdy'
holes = 'triang_2'
stitch_holes = 'true'
desired_volume = 0.2
[]
[triang_4]
type = XYZDelaunayGenerator
boundary = 'layer_4_bdy'
holes = 'triang_3'
stitch_holes = 'true'
desired_volume = 0.4
[]
[]
[Executioner]
type = Steady
[]
[Postprocessors]
[volume]
type = VolumePostprocessor
[]
[]
[Problem]
solve = false
[]
[Outputs]
csv = true
[]
(test/tests/meshgenerators/xyz_delaunay_generator/err_xyzdelaunay_with_holes_mix.i)
[Mesh]
[fmg]
type = FileMeshGenerator
file = 'gold/2d_cube.e'
[]
[outer_bdy]
type = ParsedNodeTransformGenerator
input = fmg
x_function = "x"
y_function = "y"
z_function = "z+x*y*z"
[]
[hole_1_2d]
type = ParsedNodeTransformGenerator
input = fmg
x_function = ".25+.125*x"
y_function = ".25+.125*y"
z_function = ".25+.125*z"
[]
[hole_1]
type = ElementGenerator
input = 'hole_1_2d'
elem_type = TET4
nodal_positions = '0 0 0
0 1 0
1 0 0
0 0 1'
element_connectivity = '0 1 2 3'
[]
[hole_2]
type = ParsedNodeTransformGenerator
input = fmg
x_function = ".75+.125*x"
y_function = ".75+.125*y"
z_function = ".75+.125*z"
[]
[triang]
type = XYZDelaunayGenerator
boundary = 'outer_bdy'
holes = 'hole_1
hole_2'
# Let NetGen know interior points are okay
desired_volume = 100000
[]
[]
(test/tests/meshgenerators/xyz_delaunay_generator/xyzdelaunay_smoothed.i)
[Mesh]
[inner_cube]
type = GeneratedMeshGenerator
dim = 3
elem_type = TET4
nx = 1
ny = 1
nz = 1
xmin = -0.4
xmax = 0.4
ymin = -0.4
ymax = 0.4
zmin = -0.4
zmax = 0.4
[]
[gmg]
type = GeneratedMeshGenerator
dim = 3
nx = 1
ny = 1
nz = 1
xmin = -1
xmax = 1
ymin = -1
ymax = 1
zmin = -1
zmax = 1
[]
[layer_2_bdy]
type = ParsedNodeTransformGenerator
input = gmg
x_function = "z+x"
y_function = "y"
z_function = "z-x"
[]
[layer_3_bdy]
type = ParsedNodeTransformGenerator
input = gmg
x_function = "3*x"
y_function = "3*y"
z_function = "3*z"
[]
[layer_4_bdy]
type = ParsedNodeTransformGenerator
input = gmg
x_function = "4*x"
y_function = "4*y"
z_function = "4*z"
[]
[triang_2]
type = XYZDelaunayGenerator
boundary = 'layer_2_bdy'
holes = 'inner_cube'
stitch_holes = 'true'
desired_volume = 0.1
smooth_triangulation = true
[]
[triang_3]
type = XYZDelaunayGenerator
boundary = 'layer_3_bdy'
holes = 'triang_2'
stitch_holes = 'true'
desired_volume = 0.2
smooth_triangulation = true
[]
[triang_4]
type = XYZDelaunayGenerator
boundary = 'layer_4_bdy'
holes = 'triang_3'
stitch_holes = 'true'
desired_volume = 0.4
smooth_triangulation = true
[]
[]
[Executioner]
type = Steady
[]
[Postprocessors]
[volume]
type = VolumePostprocessor
[]
[]
[Problem]
solve = false
[]
[Outputs]
csv = true
[]
(modules/contact/test/tests/nodal_normal_derivatives/curved_3d_action.i)
!include ../3d-mortar-contact/frictionless-mortar-3d-action.i
overclosure = 0.001
[Mesh]
[top_curve]
type = ParsedNodeTransformGenerator
input = top_block_id
x_function = x
y_function = y
z_function = 'z + 0.04 * x * x + 0.03 * y * y + 0.02 * x * y'
[]
[bottom_curve]
type = ParsedNodeTransformGenerator
input = bottom_block_change_boundary_id
x_function = x
y_function = y
z_function = 'z + 0.04 * x * x + 0.03 * y * y + 0.02 * x * y'
[]
[combined]
inputs := 'top_curve bottom_curve'
[]
[]
[ICs]
[disp_z]
value := '-${overclosure}'
[]
[normal_lm]
type = ConstantIC
variable = mortar_normal_lm
block = mortar_secondary_subdomain
value = 1
[]
[]
[Contact]
[mortar]
model := coulomb
friction_coefficient = 0.25
use_dual = true
[]
[]
[BCs]
active = 'botx boty botz move_top_x move_top_y move_top_z'
[move_top_x]
type = FunctionDirichletBC
variable = disp_x
boundary = top_top
function = '0.001 * t'
[]
[move_top_y]
type = FunctionDirichletBC
variable = disp_y
boundary = top_top
function = '0.0015 * t'
[]
[move_top_z]
type = FunctionDirichletBC
variable = disp_z
boundary = top_top
function = '-${overclosure} * t'
[]
[]
[Executioner]
solve_type := NEWTON
end_time := 1
dt := 1
nl_abs_tol := 1e-10
nl_rel_tol := 1e-8
nl_max_its := 25
line_search := none
[]
[Postprocessors]
active := num_nl
[]
[VectorPostprocessors]
active = ''
[]
[Outputs]
exodus := false
[]
(test/tests/meshgenerators/xyz_delaunay_generator/xyzdelaunay_quadratic.i)
# Second-order (TET10/TET14) tetrahedralization with XYZDelaunayGenerator.
#
# The outer boundary is converted to second order and THEN deformed by a nonlinear
# transform, so its mid-edge nodes lie off the straight-edge midpoint (i.e. it carries
# genuine curvature). XYZDelaunayGenerator inherits that curvature onto the generated
# tets. A second-order hole is stitched in to exercise second-order stitching.
[Mesh]
# ---- Outer boundary: curved, second order ----
[gmg]
type = GeneratedMeshGenerator
dim = 3
nx = 2
ny = 2
nz = 2
elem_type = TET4
[]
[bdy_second]
type = ElementOrderConversionGenerator
input = gmg
conversion_type = SECOND_ORDER
[]
[outer_bdy]
type = ParsedNodeTransformGenerator
input = bdy_second
x_function = 'x'
y_function = 'y'
z_function = 'z + 0.3 * x * y * z'
[]
# ---- Hole: second order, smaller interior cube ----
[hgmg]
type = GeneratedMeshGenerator
dim = 3
nx = 1
ny = 1
nz = 1
elem_type = TET4
[]
[hole_second]
type = ElementOrderConversionGenerator
input = hgmg
conversion_type = SECOND_ORDER
[]
[hole]
type = ParsedNodeTransformGenerator
input = hole_second
x_function = '0.35 + 0.3 * x'
y_function = '0.35 + 0.3 * y'
z_function = '0.35 + 0.3 * z'
[]
# Give the stitched hole a distinct subdomain id so it differs from the
# generated tetrahedra (which are subdomain 0).
[hole_block]
type = SubdomainIDGenerator
input = hole
subdomain_id = 3
[]
[triang]
type = XYZDelaunayGenerator
boundary = 'outer_bdy'
holes = 'hole_block'
stitch_holes = 'true'
desired_volume = 100000
tet_element_type = TET10
[]
[]
[Executioner]
type = Steady
[]
[Problem]
solve = false
[]
# The element type is what these tests exist to verify, and it is reported here
# rather than inferred from node counts. Counts cannot be golded on this mesh:
# desired_volume = 100000 leaves the 2x2x2 cube essentially unrefined, so the
# point set is near-cospherical and Netgen's tie-break -- and hence the exact
# tetrahedralization -- depends on the order the boundary nodes reach it, which
# differs between replicated and distributed meshes (libMesh's Netgen interface
# serializes the input mesh before triangulating it). Element types and the
# per-subdomain volumes are invariant to that retriangulation.
[Reporters]
[mesh_info]
type = MeshInfo
items = 'subdomains'
subdomain_items = 'elem_types volume'
[]
[]
[Outputs]
file_base = 'xyzdelaunay_quadratic_tet10_out'
[json]
type = JSON
execute_system_information_on = 'NONE'
[]
[]
(test/tests/meshgenerators/xyz_delaunay_generator/xyzdelaunay_with_holes_1d.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 3
nx = 1
ny = 1
nz = 1
[]
[outer_bdy]
type = ParsedNodeTransformGenerator
input = gmg
x_function = "x"
y_function = "y"
z_function = "z+x*y*z"
[]
[hole_1d]
type = ParsedCurveGenerator
x_formula = 'cos(t)'
y_formula = 'sin(t)'
section_bounding_t_values = '0.0 ${fparse 2.0*pi}'
nums_segments = '10'
constant_names = 'pi'
constant_expressions = '${fparse pi}'
is_closed_loop = true
[]
[triang]
type = XYZDelaunayGenerator
boundary = 'outer_bdy'
holes = 'hole_1d'
[]
[]
(test/tests/meshgenerators/xyz_delaunay_generator/xyzdelaunay_mesh_generator_3d.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 3
nx = 1
ny = 1
nz = 1
[]
[outer_bdy]
type = ParsedNodeTransformGenerator
input = gmg
x_function = "x"
y_function = "y"
z_function = "z+x*y*z"
[]
[triang]
type = XYZDelaunayGenerator
boundary = 'outer_bdy'
# Let NetGen know interior points are okay
desired_volume = 100000
[]
[]
[Executioner]
type = Steady
[]
[Postprocessors]
[volume]
type = VolumePostprocessor
[]
[]
[Problem]
solve = false
[]
[Outputs]
[output]
type = CSV
file_base = 'xyzdelaunay_mesh_generator_out'
[]
[]
(modules/contact/test/tests/dual_mortar/mortar_mechanical_contact_force_balance.i)
# Newton's third law check for mortar mechanical contact across a curved interface.
#
# The stress-divergence residual is stored in a dedicated vector tag. At a converged
# unconstrained contact node, its value is opposite the mortar contact force, so the
# tagged residual sums on the two contact boundaries must cancel.
!include dm_mechanical_contact.i
# Curve the interface while preserving the gap between the two surfaces.
curvature = 0.4
[Mesh]
[left_curve]
type = ParsedNodeTransformGenerator
input = left_block_id
x_function = 'x + ${curvature} * y * y'
[]
[right_curve]
type = ParsedNodeTransformGenerator
input = right_block_id
x_function = 'x + ${curvature} * y * y'
[]
[combined_mesh]
inputs := 'left_curve right_curve'
[]
[]
[Functions]
# Keep the curved interface in contact at every output step.
[horizontal_movement]
y := '0.06 0.1 0.1'
[]
[]
[Problem]
extra_tag_vectors = 'internal_force'
[]
[AuxVariables]
[internal_force_x]
block = '1 2'
[]
[internal_force_y]
block = '1 2'
[]
[]
[Physics/SolidMechanics/QuasiStatic]
[all]
extra_vector_tags = 'internal_force'
[]
[]
[AuxKernels]
[internal_force_x]
type = TagVectorAux
variable = internal_force_x
v = disp_x
block = '1 2'
vector_tag = internal_force
[]
[internal_force_y]
type = TagVectorAux
variable = internal_force_y
v = disp_y
block = '1 2'
vector_tag = internal_force
[]
[]
[Postprocessors]
# The parent postprocessors require a Lagrange multiplier, which the penalty case
# does not create.
active = 'secondary_force_x secondary_force_y primary_force_x primary_force_y '
'force_balance_x force_balance_y'
[secondary_force_x]
type = NodalSum
variable = internal_force_x
boundary = 11
[]
[secondary_force_y]
type = NodalSum
variable = internal_force_y
boundary = 11
[]
[primary_force_x]
type = NodalSum
variable = internal_force_x
boundary = 23
[]
[primary_force_y]
type = NodalSum
variable = internal_force_y
boundary = 23
[]
# Normalize the imbalance by the force transmitted through the secondary side.
[force_balance_x]
type = ParsedPostprocessor
expression = '(sec_x + pri_x) / sqrt(sec_x^2 + sec_y^2)'
pp_names = 'secondary_force_x secondary_force_y primary_force_x primary_force_y'
pp_symbols = 'sec_x sec_y pri_x pri_y'
[]
[force_balance_y]
type = ParsedPostprocessor
expression = '(sec_y + pri_y) / sqrt(sec_x^2 + sec_y^2)'
pp_names = 'secondary_force_x secondary_force_y primary_force_x primary_force_y'
pp_symbols = 'sec_x sec_y pri_x pri_y'
[]
[]
[Executioner]
# Resolve the force imbalance well below the test tolerance.
nl_rel_tol := 1e-12
nl_abs_tol = 1e-8
nl_max_its := 30
[]
[Outputs]
file_base := mortar_mechanical_contact_force_balance
[comp]
show := 'force_balance_x force_balance_y'
execute_on := 'TIMESTEP_END'
[]
[]
(test/tests/meshgenerators/compute_node_position/2d.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 11
ny = 11
xmin = -1
ymin = -2
xmax = 9
ymax = 8
[]
[node_pos]
type = ParsedNodeTransformGenerator
input = gen
x_function = 'if(x < 1 | y < 2, x, x + (y-2)*0.2)'
y_function = 'if(x < 2 | y < 1, y, y + (y-1)*(x-2) * 0.1)'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/newton_physics/lid-driven-turb-capped-physics.i)
##########################################################
# Lid-driven cavity test
# Reynolds: 5,000
# Author: Dr. Mauricio Tano
# Last Update: May, 2024
# Turbulent model using:
# k-epsilon model with capped mixing length
# Standard wall functions
# SIMPLE Solve
##########################################################
### Thermophysical Properties ###
mu = 2e-5
rho = 1.0
### Operation Conditions ###
lid_velocity = 1.0
side_length = 0.1
### k-epsilon Closure Parameters ###
sigma_k = 1.0
sigma_eps = 1.3
C1_eps = 1.44
C2_eps = 1.92
C_mu = 0.09
C_pl = 0.1
### Initial Conditions ###
intensity = 0.01
k_init = '${fparse 1.5*(intensity * lid_velocity)^2}'
eps_init = '${fparse C_mu^0.75 * k_init^1.5 / side_length}'
mu_t_init = '${fparse rho * C_mu * k_init * k_init / eps_init}'
### Modeling parameters ###
walls = 'left top right bottom'
bulk_wall_treatment = false
wall_treatment = 'eq_newton' # Options: eq_newton, eq_incremental, eq_linearized, neq
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${side_length}
ymin = 0
ymax = ${side_length}
nx = 12
ny = 12
[]
[break_symmetries]
type = ParsedNodeTransformGenerator
input = gen
constant_names = 'side_length'
constant_expressions = '${side_length}'
x_function = 'if(x<side_length*1.001 / 2 & x > side_length * 0.999 / 2, x * 1.05, x)'
y_function = 'if(y<side_length*1.001 / 2 & y > side_length * 0.999 / 2, y * 1.05, y)'
[]
# Prevent test diffing on distributed parallel element numbering
allow_renumbering = false
[]
[Physics]
[NavierStokes]
[Flow]
[flow]
compressibility = 'incompressible'
density = ${rho}
dynamic_viscosity = ${mu}
initial_pressure = 0.2
initial_velocity = 'ini_vx ini_vy 0'
wall_boundaries = 'top left right bottom'
momentum_wall_types = 'noslip noslip noslip noslip'
momentum_wall_functors = '${lid_velocity} 0; 0 0; 0 0; 0 0'
pin_pressure = true
pinned_pressure_type = point-value
pinned_pressure_value = 0
pinned_pressure_point = '0.01 0.099 0.0'
momentum_two_term_bc_expansion = false
pressure_two_term_bc_expansion = false
[]
[]
[Turbulence]
[keps]
turbulence_handling = 'k-epsilon'
tke_name = TKE
tked_name = TKED
# Initialization
initial_tke = ${k_init}
initial_tked = ${eps_init}
initial_mu_t = ${mu_t_init}
# Model parameters
C1_eps = ${C1_eps}
C2_eps = ${C2_eps}
C_mu = ${C_mu}
C_pl = ${C_pl}
sigma_k = ${sigma_k}
sigma_eps = ${sigma_eps}
# Wall parameters
turbulence_walls = ${walls}
bulk_wall_treatment = ${bulk_wall_treatment}
wall_treatment_eps = ${wall_treatment}
# Numerical parameters
turbulent_viscosity_two_term_bc_expansion = false
mu_t_as_aux_variable = true
tke_two_term_bc_expansion = false
tked_two_term_bc_expansion = false
[]
[]
[]
[]
[Functions]
[ini_vx]
type = ParsedFunction
expression = 'if(y>0.09, 0.1, -0.0001)'
[]
[ini_vy]
type = ParsedFunction
expression = 'if(x>0.05, -0.001, 0.001)'
[]
[]
[AuxVariables]
[dummy]
type = MooseVariableConstMonomial
[]
[]
[Bounds]
[min_tke]
type = ConstantBounds
variable = dummy
bound_value = 1e-8
bounded_variable = TKE
bound_type = lower
[]
[min_eps]
type = ConstantBounds
variable = dummy
bound_value = 1e-8
bounded_variable = TKED
bound_type = lower
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type -snes_type'
petsc_options_value = 'lu NONZERO vinewtonrsls '
nl_abs_tol = 1e-7
nl_rel_tol = 1e-8
nl_max_its = 100
line_search = none
automatic_scaling = true
[]
[Outputs]
csv = true
perf_graph = false
print_nonlinear_residuals = true
print_linear_residuals = false
[]
[VectorPostprocessors]
[side_bottom]
type = SideValueSampler
boundary = 'bottom'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[side_top]
type = SideValueSampler
boundary = 'top'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[side_left]
type = SideValueSampler
boundary = 'left'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'y'
execute_on = 'timestep_end'
[]
[side_right]
type = SideValueSampler
boundary = 'right'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'y'
execute_on = 'timestep_end'
[]
[horizontal_center]
type = LineValueSampler
start_point = '${fparse 0.01 * side_length} ${fparse 0.499 * side_length} 0'
end_point = '${fparse 0.99 * side_length} ${fparse 0.499 * side_length} 0'
num_points = ${Mesh/gen/nx}
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[vertical_center]
type = LineValueSampler
start_point = '${fparse 0.499 * side_length} ${fparse 0.01 * side_length} 0'
end_point = '${fparse 0.499 * side_length} ${fparse 0.99 * side_length} 0'
num_points = ${Mesh/gen/ny}
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'y'
execute_on = 'timestep_end'
[]
[]
(test/tests/meshgenerators/xyz_delaunay_generator/xyzdelaunay_with_holes_2d.i)
[Mesh]
[fmg]
type = FileMeshGenerator
file = 'gold/2d_cube.e'
[]
[outer_bdy]
type = ParsedNodeTransformGenerator
input = fmg
x_function = "x"
y_function = "y"
z_function = "z+x*y*z"
[]
[hole_1]
type = ParsedNodeTransformGenerator
input = fmg
x_function = ".25+.125*x"
y_function = ".25+.125*y"
z_function = ".25+.125*z"
[]
[hole_2]
type = ParsedNodeTransformGenerator
input = fmg
x_function = ".75+.125*x"
y_function = ".75+.125*y"
z_function = ".75+.125*z"
[]
[triang]
type = XYZDelaunayGenerator
boundary = 'outer_bdy'
holes = 'hole_1
hole_2'
# Let NetGen know interior points are okay
desired_volume = 100000
[]
[]
[Executioner]
type = Steady
[]
[Postprocessors]
[volume]
type = VolumePostprocessor
[]
[]
[Problem]
solve = false
[]
[Outputs]
[output]
type = CSV
file_base = 'xyzdelaunay_with_holes_out'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/segregated/lid-driven-turb-capped.i)
##########################################################
# Lid-driven cavity test
# Reynolds: 5,000
# Author: Dr. Mauricio Tano
# Last Update: November, 2023
# Turbulent model using:
# k-epsilon model with capped mixing length
# Standard wall functions
# SIMPLE Solve
##########################################################
### Thermophysical Properties ###
mu = 2e-5
rho = 1.0
### Operation Conditions ###
lid_velocity = 1.0
side_length = 0.1
### Initial Conditions ###
intensity = 0.01
k_init = '${fparse 1.5*(intensity * lid_velocity)^2}'
eps_init = '${fparse C_mu^0.75 * k_init^1.5 / side_length}'
### k-epsilon Closure Parameters ###
sigma_k = 1.0
sigma_eps = 1.3
C1_eps = 1.44
C2_eps = 1.92
C_mu = 0.09
C_pl = 0.1
### Modeling parameters ###
bulk_wall_treatment = false
walls = 'left top right bottom'
wall_treatment = 'eq_newton' # Options: eq_newton, eq_incremental, eq_linearized, neq
pressure_tag = "pressure_grad"
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = 'upwind'
velocity_interp_method = 'rc'
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${side_length}
ymin = 0
ymax = ${side_length}
nx = 12
ny = 12
[]
[break_symmetries]
type = ParsedNodeTransformGenerator
input = gen
constant_names = 'side_length'
constant_expressions = '${side_length}'
x_function = 'if(x<side_length*1.001 / 2 & x > side_length * 0.999 / 2, x * 1.05, x)'
y_function = 'if(y<side_length*1.001 / 2 & y > side_length * 0.999 / 2, y * 1.05, y)'
[]
# Prevent test diffing on distributed parallel element numbering
allow_renumbering = false
[]
[Problem]
nl_sys_names = 'u_system v_system pressure_system TKE_system TKED_system'
previous_nl_solution_required = true
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolatorSegregated
u = vel_x
v = vel_y
pressure = pressure
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
solver_sys = u_system
two_term_boundary_expansion = false
[]
[vel_y]
type = INSFVVelocityVariable
solver_sys = v_system
two_term_boundary_expansion = false
[]
[pressure]
type = INSFVPressureVariable
solver_sys = pressure_system
initial_condition = 0.2
two_term_boundary_expansion = false
[]
[TKE]
type = INSFVEnergyVariable
solver_sys = TKE_system
initial_condition = ${k_init}
two_term_boundary_expansion = false
[]
[TKED]
type = INSFVEnergyVariable
solver_sys = TKED_system
initial_condition = ${eps_init}
two_term_boundary_expansion = false
[]
[]
[ICs]
[vx]
type = FunctionIC
variable = vel_x
function = 'if(y>0.09, 0.1, -0.001)'
[]
[vy]
type = FunctionIC
variable = vel_y
function = 'if(x>0.05, -0.001, 0.001)'
[]
[]
[FVKernels]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = ${mu}
momentum_component = 'x'
[]
[u_viscosity_turbulent]
type = INSFVMomentumDiffusion
variable = vel_x
mu = 'mu_t'
momentum_component = 'x'
complete_expansion = true
u = vel_x
v = vel_y
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
extra_vector_tags = ${pressure_tag}
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = ${mu}
momentum_component = 'y'
[]
[v_viscosity_turbulent]
type = INSFVMomentumDiffusion
variable = vel_y
mu = 'mu_t'
momentum_component = 'y'
complete_expansion = true
u = vel_x
v = vel_y
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
extra_vector_tags = ${pressure_tag}
[]
[p_diffusion]
type = FVAnisotropicDiffusion
variable = pressure
coeff = "Ainv"
coeff_interp_method = 'average'
[]
[p_source]
type = FVDivergence
variable = pressure
vector_field = "HbyA"
force_boundary_execution = true
[]
[TKE_advection]
type = INSFVTurbulentAdvection
variable = TKE
rho = ${rho}
[]
[TKE_diffusion]
type = INSFVTurbulentDiffusion
variable = TKE
coeff = ${mu}
[]
[TKE_diffusion_turbulent]
type = INSFVTurbulentDiffusion
variable = TKE
coeff = 'mu_t'
scaling_coef = ${sigma_k}
[]
[TKE_source_sink]
type = INSFVTKESourceSink
variable = TKE
u = vel_x
v = vel_y
epsilon = TKED
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
C_pl = ${C_pl}
walls = ${walls}
wall_treatment = ${wall_treatment}
[]
[TKED_advection]
type = INSFVTurbulentAdvection
variable = TKED
rho = ${rho}
walls = ${walls}
[]
[TKED_diffusion]
type = INSFVTurbulentDiffusion
variable = TKED
coeff = ${mu}
walls = ${walls}
[]
[TKED_diffusion_turbulent]
type = INSFVTurbulentDiffusion
variable = TKED
coeff = 'mu_t'
scaling_coef = ${sigma_eps}
walls = ${walls}
[]
[TKED_source_sink]
type = INSFVTKEDSourceSink
variable = TKED
u = vel_x
v = vel_y
tke = TKE
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
C1_eps = ${C1_eps}
C2_eps = ${C2_eps}
C_pl = ${C_pl}
walls = ${walls}
wall_treatment = ${wall_treatment}
[]
[]
[FVBCs]
[top_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'top'
function = ${lid_velocity}
[]
[no_slip_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'left right bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = vel_y
boundary = 'left right top bottom'
function = 0
[]
[walls_mu_t]
type = INSFVTurbulentViscosityWallFunction
boundary = 'left right top bottom'
variable = mu_t
u = vel_x
v = vel_y
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
tke = TKE
wall_treatment = ${wall_treatment}
[]
[]
[AuxVariables]
[mu_t]
type = MooseVariableFVReal
initial_condition = '${fparse rho * C_mu * ${k_init}^2 / eps_init}'
two_term_boundary_expansion = false
[]
[]
[AuxKernels]
[compute_mu_t]
type = kEpsilonViscosityAux
variable = mu_t
C_mu = ${C_mu}
tke = TKE
epsilon = TKED
mu = ${mu}
rho = ${rho}
u = vel_x
v = vel_y
bulk_wall_treatment = ${bulk_wall_treatment}
walls = ${walls}
wall_treatment = ${wall_treatment}
execute_on = 'NONLINEAR'
[]
[]
[Executioner]
type = SIMPLENonlinearAssembly
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
turbulence_systems = 'TKED_system TKE_system'
pressure_gradient_tag = ${pressure_tag}
momentum_equation_relaxation = 0.8
pressure_variable_relaxation = 0.5
turbulence_equation_relaxation = '0.8 0.8'
num_iterations = 500
pressure_absolute_tolerance = 1e-12
momentum_absolute_tolerance = 1e-12
turbulence_absolute_tolerance = '1e-12 1e-12'
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
momentum_l_abs_tol = 1e-14
pressure_l_abs_tol = 1e-14
turbulence_l_abs_tol = 1e-14
momentum_l_max_its = 30
pressure_l_max_its = 30
momentum_l_tol = 0.0
pressure_l_tol = 0.0
turbulence_l_tol = 0.0
print_fields = false
pin_pressure = true
pressure_pin_value = 0.0
pressure_pin_point = '0.01 0.099 0.0'
continue_on_max_its = true
[]
[Outputs]
csv = true
perf_graph = false
print_nonlinear_residuals = false
print_linear_residuals = true
[]
[VectorPostprocessors]
[side_bottom]
type = SideValueSampler
boundary = 'bottom'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[side_top]
type = SideValueSampler
boundary = 'top'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[side_left]
type = SideValueSampler
boundary = 'left'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'y'
execute_on = 'timestep_end'
[]
[side_right]
type = SideValueSampler
boundary = 'right'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'y'
execute_on = 'timestep_end'
[]
[horizontal_center]
type = LineValueSampler
start_point = '${fparse 0.01 * side_length} ${fparse 0.499 * side_length} 0'
end_point = '${fparse 0.99 * side_length} ${fparse 0.499 * side_length} 0'
num_points = ${Mesh/gen/nx}
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[vertical_center]
type = LineValueSampler
start_point = '${fparse 0.499 * side_length} ${fparse 0.01 * side_length} 0'
end_point = '${fparse 0.499 * side_length} ${fparse 0.99 * side_length} 0'
num_points = ${Mesh/gen/ny}
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'y'
execute_on = 'timestep_end'
[]
[]
(test/tests/meshgenerators/xyz_delaunay_generator/xyzdelaunay_with_holes_3d.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 3
nx = 1
ny = 1
nz = 1
[]
[outer_bdy]
type = ParsedNodeTransformGenerator
input = gmg
x_function = "x"
y_function = "y"
z_function = "z+x*y*z"
[]
[hole_1]
type = ParsedNodeTransformGenerator
input = gmg
x_function = ".25+.125*x"
y_function = ".25+.125*y"
z_function = ".25+.125*z"
[]
[hole_2]
type = ParsedNodeTransformGenerator
input = gmg
x_function = ".75+.125*x"
y_function = ".75+.125*y"
z_function = ".75+.125*z"
[]
[triang]
type = XYZDelaunayGenerator
boundary = 'outer_bdy'
holes = 'hole_1
hole_2'
# Let NetGen know interior points are okay
desired_volume = 100000
[]
[]
[Executioner]
type = Steady
[]
[Postprocessors]
[volume]
type = VolumePostprocessor
[]
[]
[Problem]
solve = false
[]
[Outputs]
[output]
type = CSV
file_base = 'xyzdelaunay_with_holes_out'
[]
[]
(test/tests/meshgenerators/xyz_delaunay_generator/xyzdelaunay_stitching.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 3
elem_type = TET4
nx = 1
ny = 1
nz = 1
xmin = -1
xmax = 1
ymin = -1
ymax = 1
zmin = -1
zmax = 1
[]
[outer_bdy]
type = ParsedNodeTransformGenerator
input = gmg
x_function = "z+x"
y_function = "y"
z_function = "z-x"
[]
[hole_1]
type = ParsedNodeTransformGenerator
input = gmg
x_function = ".25+.125*x"
y_function = ".25+.125*y"
z_function = ".25+.125*z"
[]
[hole_1_name]
type = RenameBlockGenerator
input = hole_1
old_block = 0
new_block = hole
[]
[hole_2]
type = ParsedNodeTransformGenerator
input = gmg
x_function = ".75+.125*x"
y_function = ".75+.125*y"
z_function = ".75+.125*z"
[]
[hole_2_name_1]
type = RenameBlockGenerator
input = hole_2
old_block = 0
new_block = 1
[]
[hole_2_name_2]
type = RenameBlockGenerator
input = hole_2_name_1
old_block = 1
new_block = hole
[]
[triang]
type = XYZDelaunayGenerator
boundary = 'outer_bdy'
holes = 'hole_1_name
hole_2'
stitch_holes = 'true
false'
desired_volume = 10000
output_subdomain_name = "triangles"
[]
[]
[Executioner]
type = Steady
[]
[Postprocessors]
[volume]
type = VolumePostprocessor
[]
[]
[Problem]
solve = false
[]
[Outputs]
csv = true
[]