Why a postprocessed variable displays zero? #27786
Answered
by
amerallaf
amerallaf
asked this question in
Q&A General
-
Check these boxes if you have followed the posting rules.
QuestionHello, I am trying to postprocess the heat_source variable (source_integral), but it keeps showing me the value as zero. The heat_source has a greater value than zero, because whenever I change it, the maximum temperature value also changes, but I still get the source_integral as zero. I would appreciate your help in solving this issue. Here is my input: L = 300.0
T_fluid = ${fparse 280.0 + 273.15}
[Mesh]
[file]
type = FileMeshGenerator
file = mesh_in.e
[]
[]
[Variables]
[temp]
initial_condition = ${T_fluid}
[]
[]
[AuxVariables]
[./heat_source]
[../]
[]
[Kernels]
[hc]
type = HeatConduction
variable = temp
[]
[heat_source]
type = HeatSource
value = 250
variable = temp
block = '2 3'
[]
[]
[Functions]
[T_fluid]
type = ParsedFunction
expression = '573.0 + 50.0 * (z / 300.0)'
[]
[]
[BCs]
[surface]
type = ConvectiveFluxFunction
T_infinity = T_fluid
# convert from W/m2/K to W/cm2/K
coefficient = ${fparse 1000.0/100.0/100.0}
variable = temp
boundary = 'rmax_c'
[]
[]
[ThermalContact]
# This adds boundary conditions bewteen the fuel and the cladding, which represents
# the heat flux in both directions as
# q''= h * (T_1 - T_2)
# where h is a conductance that accounts for conduction through a material and
# radiation between two infinite parallel plate gray bodies.
[one_to_two]
type = GapHeatTransfer
variable = temp
primary = 'rmax'
secondary = 'rmin_c'
# we will use a quadrature-based approach to find the gap width and cross-side temperature
quadrature = true
# emissivity of the fuel
emissivity_primary = 0.8
# emissivity of the clad
emissivity_secondary = 0.8
# thermal conductivity of the gap material
gap_conductivity = 1.0
# geometric terms related to the gap
gap_geometry_type = CYLINDER
cylinder_axis_point_1 = '0 0 0'
cylinder_axis_point_2 = '0 0 ${L}'
[]
[]
[Materials]
[k_clad]
type = GenericConstantMaterial
prop_values = '0.5'
prop_names = 'thermal_conductivity'
block = '1'
[]
[k_fuel]
type = GenericConstantMaterial
prop_values = '0.05'
prop_names = 'thermal_conductivity'
block = '2 3'
[]
[]
[Executioner]
type = Transient
nl_abs_tol = 1e-8
num_steps = 5
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
print_linear_residuals = false
[]
[Postprocessors]
[source_integral]
type = ElementIntegralVariablePostprocessor
variable = heat_source
[]
[max_T]
type = NodalExtremeValue
variable = temp
[]
[] and this is the mesh input r_pin = 0.39218
clad_ir = 0.40005
clad_or = 0.45720
L = 300.0
[Mesh]
[clad] # This makes a circular annulus that will represent the clad
type = AnnularMeshGenerator
nr = 3
nt = 20
rmin = ${clad_ir}
rmax = ${clad_or}
quad_subdomain_id = 1
tri_subdomain_id = 0
[]
[extrude_clad] # this extrudes the circular annulus in the axial direction
type = AdvancedExtruderGenerator
input = clad
heights = '${L}'
num_layers = '40'
direction = '0 0 1'
[]
# A sideset in MOOSE is both an ID and a name.
# This renames the sideset numbers on the clad inner surface (0) and outer surface (1)
# to (5) and (4), respectively. This is done to avoid name collisions with another
# AnnularMeshGenerator we use for the fuel pellet. After we rename the sideset IDs, we
# need another RenameBoundaryGenerator to rename the sideset names.
[rename_clad]
type = RenameBoundaryGenerator
input = extrude_clad
old_boundary = '1 0' # outer surface, inner surface
new_boundary = '5 4'
[]
[rename_clad_names]
type = RenameBoundaryGenerator
input = rename_clad
old_boundary = 'rmax rmin' # outer surface, inner surface
new_boundary = 'rmax_c rmin_c'
[]
[fuel] # this makes a circle that will represent the fuel
type = AnnularMeshGenerator
nr = 10
nt = 20
rmin = 0
rmax = ${r_pin}
quad_subdomain_id = 2
tri_subdomain_id = 3
growth_r = -1.2
[]
[extrude] # this extrudes the circle in the axial direction
type = AdvancedExtruderGenerator
input = fuel
heights = '${L}'
num_layers = '40'
direction = '0 0 1'
[]
[combine]
type = CombinerGenerator
inputs = 'rename_clad_names extrude'
[]
# one of the mesh generators does not work with distributed mesh
parallel_type = replicated
[] |
Beta Was this translation helpful? Give feedback.
Answered by
amerallaf
Jun 7, 2024
Replies: 1 comment 20 replies
-
Hello In paraview are you visualizing the last time step? The default is to show you the initial condition |
Beta Was this translation helpful? Give feedback.
20 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks a lot @GiudGiud , now it is working well.
I did the following in the end: