Skip to content

Commit

Permalink
Merge pull request idaholab#34 from gridley/eigen3d4group
Browse files Browse the repository at this point in the history
Eigen3d4group
  • Loading branch information
lindsayad authored Jul 6, 2017
2 parents fcf6476 + ba2e937 commit fe4c394
Show file tree
Hide file tree
Showing 6 changed files with 128 additions and 43 deletions.
5 changes: 4 additions & 1 deletion include/kernels/FissionHeatSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@

#include "Kernel.h"

// Forward Declarations
class FissionHeatSource;

template <>
InputParameters validParams<FissionHeatSource>();

/**
* This kernel will likely only be used with k-eigenvalue calculation mode
* with neutrons only, since the power is normalized in this case.
*/
class FissionHeatSource : public Kernel
{
public:
Expand Down
124 changes: 90 additions & 34 deletions problems/MooseGold/070517_4group/eigen/eigen.i
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
ini_temp=922
diri_temp=922
nt_scale=1e13
temp = 922
[GlobalParams]
num_groups = 2
num_groups = 4
num_precursor_groups = 6
use_exp_form = false
group_fluxes = 'group1 group2'
group_fluxes = 'group1 group2 group3 group4'
sss2_input = false
account_delayed = true
account_delayed = false
temperature = 922
temp = 922
[]

flow_velocity = 21.7
[Mesh]
file = '../../033117_nts_temp_pre_parsed_mat/3d_msre_29x29_136.msh'
[]
Expand All @@ -20,21 +27,17 @@

#[Variables]
# [./group1]
# order = FIRST
# family = LAGRANGE
# initial_condition = 1
# scaling = 1e4
# [../]
# [./group2]
# order = FIRST
# family = LAGRANGE
# initial_condition = 1
# scaling = 1e4
# [../]
# [./temp]
# initial_condition = ${ini_temp}
# scaling = 1e-4
# [./group3]
# [../]
# [./group4]
# [../]
# #[./temp]
# # initial_condition = ${ini_temp}
# # scaling = 1e-4
# #[../]
#[]

[PrecursorKernel]
Expand All @@ -61,18 +64,29 @@
boundary = 'fuel_bottoms fuel_tops moder_bottoms moder_tops moder_sides'
variable = group2
[../]
[./temp_diri_cg]
boundary = 'moder_bottoms fuel_bottoms moder_sides'
type = FunctionDirichletBC
function = 'temp_bc_func'
variable = temp
[./vacuum_group3]
type = VacuumConcBC
boundary = 'fuel_bottoms fuel_tops moder_bottoms moder_tops moder_sides'
variable = group3
[../]
[./temp_advection_outlet]
boundary = 'fuel_tops'
type = TemperatureOutflowBC
variable = temp
velocity = '0 0 ${flow_velocity}'
[./vacuum_group4]
type = VacuumConcBC
boundary = 'fuel_bottoms fuel_tops moder_bottoms moder_tops moder_sides'
variable = group4
[../]

#[./temp_diri_cg]
# boundary = 'moder_bottoms fuel_bottoms moder_sides'
# type = FunctionDirichletBC
# function = 'temp_bc_func'
# variable = temp
#[../]
#[./temp_advection_outlet]
# boundary = 'fuel_tops'
# type = TemperatureOutflowBC
# variable = temp
# velocity = '0 0 ${flow_velocity}'
#[../]
[]

[Functions]
Expand All @@ -85,13 +99,13 @@
[Materials]
[./fuel]
type = GenericMoltresMaterial
property_tables_root ='../../../../tutorial/step01_groupConstants/MSREProperties/msre_gentry_4gfuel'
property_tables_root ='../../../../tutorial/step01_groupConstants/MSREProperties/msre_gentry_4gfuel_'
interp_type = 'spline'
block = 'fuel'
[../]
[./moder]
type = GenericMoltresMaterial
property_tables_root = '../../../../tutorial/step01_groupConstants/MSREProperties/msre_gentry_4gmoder'
property_tables_root = '../../../../tutorial/step01_groupConstants/MSREProperties/msre_gentry_4gmoder_'
interp_type = 'spline'
block = 'moder'
[../]
Expand All @@ -101,12 +115,14 @@
type = InversePowerMethod
max_power_iterations = 50
xdiff = 'group1diff'

bx_norm = 'bnorm'
k0 = 1.5
pfactor = 1e-2
l_max_its = 100
solve_type = 'NEWTON'
petsc_options = '-snes_converged_reason -ksp_converged_reason -snes_linesearch_monitor'
#petsc_options_iname = '-pc_type -sub_pc_type -pc_asm_overlap -sub_ksp_type -snes_linesearch_minlambda'
petsc_options_iname = '-pc_type -sub_pc_type'
petsc_options_value = 'asm lu '
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[../]
[]

Expand All @@ -117,15 +133,55 @@
[../]
[]

[Postprocessors]
[./bnorm]
type = ElmIntegTotFissNtsPostprocessor
execute_on = linear
[../]
[./tot_fissions]
type = ElmIntegTotFissPostprocessor
execute_on = linear
[../]
[./group1norm]
type = ElementIntegralVariablePostprocessor
variable = group1
execute_on = linear
[../]
[./group1max]
type = NodalMaxValue
variable = group1
execute_on = timestep_end
[../]
[./group1diff]
type = ElementL2Diff
variable = group1
execute_on = 'linear timestep_end'
use_displaced_mesh = false
[../]
[./group2norm]
type = ElementIntegralVariablePostprocessor
variable = group2
execute_on = linear
[../]
[./group2max]
type = NodalMaxValue
variable = group2
execute_on = timestep_end
[../]
[./group2diff]
type = ElementL2Diff
variable = group2
execute_on = 'linear timestep_end'
use_displaced_mesh = false
[../]
[]


[Outputs]
print_perf_log = true
print_linear_residuals = true
csv = true
[./out]
type = Exodus
execute_on = 'final'
[../]
exodus = true
[]

[Debug]
Expand Down
6 changes: 1 addition & 5 deletions src/materials/GenericMoltresMaterial.C
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,8 @@ GenericMoltresMaterial::GenericMoltresMaterial(const InputParameters & parameter
_num_groups = getParam<unsigned>("num_groups");
_num_precursor_groups = getParam<unsigned>("num_precursor_groups");
std::string property_tables_root = getParam<std::string>("property_tables_root");
std::vector<std::string> xsec_names{"FLUX",
"REMXS",
std::vector<std::string> xsec_names{"REMXS",
"FISSXS",
"NUBAR",
"NSF",
"FISSE",
"DIFFCOEF",
Expand All @@ -110,7 +108,6 @@ GenericMoltresMaterial::GenericMoltresMaterial(const InputParameters & parameter

_file_map["REMXS"] = "REMXS";
_file_map["NSF"] = "NSF";
_file_map["NUBAR"] = "NUBAR";
_file_map["DIFFCOEF"] = "DIFFCOEF";
_file_map["BETA_EFF"] = "BETA_EFF";
if (getParam<bool>("sss2_input"))
Expand Down Expand Up @@ -416,7 +413,6 @@ GenericMoltresMaterial::leastSquaresConstruct(std::string & property_tables_root
_flux_consts = xsec_map["FLUX"];
_remxs_consts = xsec_map["REMXS"];
_fissxs_consts = xsec_map["FISSXS"];
_nubar_consts = xsec_map["NUBAR"];
_nsf_consts = xsec_map["NSF"];
_fisse_consts = xsec_map["FISSE"];
_diffcoeff_consts = xsec_map["DIFFCOEF"];
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
633.0 1.27251 1.2358 1.2361 1.15834
700.0 1.29054 1.25321 1.25319 1.17355
800.0 1.31843 1.27971 1.27919 1.19668
900.0 1.34673 1.30663 1.30575 1.22039
1000.0 1.37549 1.33432 1.33288 1.24441
1100.0 1.40508 1.36253 1.3608 1.26902
1200.0 1.4356 1.39131 1.38915 1.29412
1300.0 1.46619 1.42087 1.41821 1.31963
1400.0 1.49758 1.45109 1.44807 1.3458
1500.0 1.52968 1.48189 1.47851 1.37238
1600.0 1.56258 1.5133 1.5095 1.39953
1700.0 1.59597 1.54561 1.5413 1.42727
1800.0 1.63066 1.57837 1.57384 1.4556
1900.0 1.66564 1.61202 1.60701 1.4843
2000.0 1.7011 1.64646 1.64107 1.51356
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
633.0 1.20787 0.795616 0.793327 0.756596
700.0 1.20915 0.796609 0.794142 0.75799
800.0 1.21139 0.797987 0.795431 0.759372
900.0 1.21358 0.799449 0.796814 0.760684
1000.0 1.21568 0.800872 0.798151 0.762617
1100.0 1.21794 0.802331 0.799489 0.763832
1200.0 1.22009 0.803745 0.800875 0.765413
1300.0 1.22228 0.805217 0.802219 0.76642
1400.0 1.22434 0.806663 0.803536 0.767685
1500.0 1.22662 0.808108 0.804837 0.769152
1600.0 1.22874 0.809583 0.80609 0.770742
1700.0 1.23097 0.811015 0.807425 0.771737
1800.0 1.23323 0.812495 0.808797 0.772846
1900.0 1.23541 0.813968 0.810083 0.774067
7 changes: 4 additions & 3 deletions tutorial/step01_groupConstants/extractSerpent2GCs.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def makePropertiesDir(inmats, outdir, filebase, mapFile, unimapFile, serp1=False
coeList = dict([(mat,sss.parse_coe(mat+'.coe')) for mat in inmats])

# the constants moltres looks for:
goodStuff = ['BETA_EFF','CHI','DECAY_CONSTANT','DIFF_COEF','FISSE','GTRANSFXS','NSF','RECIPVEL','REMXS']
goodStuff = ['BETA_EFF','CHI','DECAY_CONSTANT','DIFFCOEF','FISSE','GTRANSFXS','NSF','RECIPVEL','REMXS','FISSXS']
goodMap = dict([(thing, 'INF_'+thing) for thing in goodStuff])

# the name for the group transfer XS matrix is different in serpent
Expand All @@ -41,8 +41,9 @@ def makePropertiesDir(inmats, outdir, filebase, mapFile, unimapFile, serp1=False
goodMap['CHI'] = 'INF_CHIP' # include production. chip, chit, or chid???
goodMap['DECAY_CONSTANT']='LAMBDA'
goodMap['RECIPVEL'] = 'INF_INVV'
goodMap['DIFF_COEF'] = 'INF_DIFFCOEF'
goodMap['DIFFCOEF'] = 'INF_DIFFCOEF'
goodMap['FISSE'] = 'INF_KAPPA'
goodMap['FISSXS'] = 'INF_FISS'

# map material names to universe names from serpent
with open(unimapFile) as fh:
Expand All @@ -65,7 +66,7 @@ def makePropertiesDir(inmats, outdir, filebase, mapFile, unimapFile, serp1=False
raise Exception('Couldnt find a material corresponding to branch {}'.format(item))

for coefficient in goodStuff:
with open(outdir+'/'+filebase+currentMat+'_'+coefficient, 'a') as fh:
with open(outdir+'/'+filebase+currentMat+'_'+coefficient+'.txt', 'a') as fh:
strData = coeList[currentMat][1][uniMap[currentMat]][item]["rod0"][goodMap[coefficient]]
if coefficient == 'DECAY_CONSTANT' or coefficient == 'BETA_EFF':
# some additional formatting is needed here
Expand Down

0 comments on commit fe4c394

Please sign in to comment.