cardinal.i 3.1 KB
Newer Older
Elia Merzari's avatar
Elia Merzari committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
[Mesh]
  type = FileMesh
  file = spheres.e
[]

[Variables]
  [temp]
    initial_condition = 300
  []
[]

[AuxVariables]
  [heat_source]
    family = MONOMIAL
    order = CONSTANT
  []
  [average_temp]
    family = MONOMIAL
    order = CONSTANT
  []
  [nek_temp]
  []
  [avg_flux]
    family = MONOMIAL
    order = CONSTANT
    initial_condition = 0
  []
[]

[Kernels]
  [hc]
    type = HeatConduction
    variable = temp
  []
  [heat]
    type = CoupledForce
    variable = temp
    v = heat_source
  []
[]

[BCs]
  [outside]
    type = DirichletBC
    variable = temp
    boundary = '1'
    value = 300
  []
[]

[AuxKernels]
  [average_temp]
    variable = average_temp
    type = SpatialUserObjectAux
    user_object = average_temp
    execute_on = 'initial timestep_end'
  []
  [avg_flux]
59
    type = NormalDiffusionFluxAux
Elia Merzari's avatar
Elia Merzari committed
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
    coupled = 'temp'
    diffusivity = thermal_conductivity
    variable = avg_flux
    boundary = '1'
  []
[]

[Materials]
  [hc]
    type = GenericConstantMaterial
    prop_values = '0.1' # 20 W/mK -> 0.2 W/cmK
    prop_names = 'thermal_conductivity'
  []
[]

[Executioner]
  type = Transient
  petsc_options_iname = '-pc_type -pc_hypre_type'
  num_steps = 10000
  petsc_options_value = 'hypre boomeramg'
  dt = 4e-4
  nl_rel_tol = 1e-5
[]

[Outputs]
  interval = 100 
  exodus = true
[]

[UserObjects]
  [./average_temp]
    type = NearestPointAverage
    variable = temp
    execute_on = 'timestep_end' # Evaluate on timestep end so OpenMC can get updated values next timestep
94
    points_file = 'pebble_centers_rescaled.txt'
Elia Merzari's avatar
Elia Merzari committed
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172
  []
[]

[MultiApps]
  [openmc]
    type = TransientMultiApp
    app_type = OpenMCApp
    input_files = 'openmc.i'
    execute_on = timestep_begin
  [] 
  [nek]
    type = TransientMultiApp
    app_type = NekApp
    input_files = 'nek.i'
  []
[]

[Transfers]
  [./heat_source_from_openmc]
    type = MultiAppCopyTransfer
    direction = from_multiapp
    multi_app = openmc
    source_variable = heat_source
    variable = heat_source
  []
  [./average_temp_to_openmc]
    type = NearestPointReceiverTransfer
    direction = to_multiapp
    multi_app = openmc
    from_uo = average_temp
    to_uo = average_temp
  []
  [nek_temp]
    type = MultiAppNearestNodeTransfer
    source_variable = temp
    direction = from_multiapp
    multi_app = nek
    variable = nek_temp
    fixed_meshes = true
  []
  [avg_flux]
    type = MultiAppNearestNodeTransfer
    source_variable = avg_flux
    direction = to_multiapp
    multi_app = nek
    variable = avg_flux
    fixed_meshes = true
  []
  [total_flux_to_nek]
    type = MultiAppPostprocessorTransfer
    to_postprocessor = total_flux
    direction = to_multiapp
    from_postprocessor = total_flux
    multi_app = nek
  []
[]

[Postprocessors]
  [total_flux_check]
    # Should add up to the same thing as total_flux
    type = SideIntegralVariablePostprocessor
    variable = avg_flux
    boundary = 1
  []

  [total_flux]
    type = SideFluxIntegral
    diffusivity = thermal_conductivity
    variable = 'temp'
    boundary = '1'
  []
  [average_flux]
    type = SideFluxAverage
    diffusivity = thermal_conductivity
    variable = 'temp'
    boundary = '1'
  []
[]