GitLab maintenance scheduled form Friday, 2021-06-18 5:00pm to Satursday, 2021-06-19 10:00pm CT - Services will be unavailable during this time.

Commit fb643297 authored by Elia Merzari's avatar Elia Merzari

Merge branch '1k_openmc_model' into 'master'

1k openmc model

See merge request !3
parents 5466364b c71cea29
This diff is collapsed.
......@@ -121,7 +121,7 @@
[Outputs]
exodus = true
interval = 100
file_base = ../../../../../../../../scratch/gastdr/coe/146_pebbles/out
file_base = ./
[]
[MultiApps]
......
......@@ -27,7 +27,9 @@
[Problem]
type = OpenMCProblem
power = 146000 # 1000 per pebble
power = 1460 # 1000 per pebble
tally_type = 'cell'
mesh_template = 'sphere.e'
centers = '-8.065973074285714972e+00 2.236820423458646623e+00 1.168503152842105308e+01
-4.108761094736841812e+00 7.264663405714286704e+00 1.148013507969924873e+01
-8.190250614135338836e+00 -1.669100062556391206e+00 1.174674951699248204e+01
......
......@@ -237,10 +237,10 @@
[Transfers]
[./heat_source_from_openmc]
type = MultiAppUserObjectTransfer
type = MultiAppCopyTransfer
direction = from_multiapp
multi_app = openmc
user_object = heat_source
source_variable = heat_source
variable = heat_source
[]
[./average_temp_to_openmc]
......
<?xml version='1.0' encoding='utf-8'?>
<plots>
<plot basis="xy" color_by="material" filename="plot1" id="1" type="slice">
<plot color_by="material" filename="plotv1" id="5" type="voxel">
<origin>0 0 0</origin>
<width>30.25 30.25</width>
<pixels>1000 1000</pixels>
<color id="1" rgb="165 42 42" />
<color id="2" rgb="176 196 222" />
<color id="3" rgb="0 0 255" />
<color id="4" rgb="255 165 0" />
<color id="5" rgb="0 255 255" />
<color id="6" rgb="0 191 255" />
<color id="7" rgb="0 0 128" />
<color id="8" rgb="255 255 0" />
</plot>
<plot basis="xy" color_by="material" filename="plot2" id="2" type="slice">
<origin>0 0 1</origin>
<width>30.25 30.25</width>
<pixels>1000 1000</pixels>
<color id="1" rgb="165 42 42" />
<color id="2" rgb="176 196 222" />
<color id="3" rgb="0 0 255" />
<color id="4" rgb="255 165 0" />
<color id="5" rgb="0 255 255" />
<color id="6" rgb="0 191 255" />
<color id="7" rgb="0 0 128" />
<color id="8" rgb="255 255 0" />
</plot>
<plot basis="xy" color_by="material" filename="plot3" id="3" type="slice">
<origin>0 0 1</origin>
<width>30.25 30.25</width>
<pixels>1000 1000</pixels>
<color id="1" rgb="165 42 42" />
<color id="2" rgb="176 196 222" />
<color id="3" rgb="0 0 255" />
<color id="4" rgb="255 165 0" />
<color id="5" rgb="0 255 255" />
<color id="6" rgb="0 191 255" />
<color id="7" rgb="0 0 128" />
<color id="8" rgb="255 255 0" />
</plot>
<plot basis="xz" color_by="material" filename="plot4" id="4" type="slice">
<origin>0 0 5.08</origin>
<width>31.49 31.49</width>
<pixels>1000 1000</pixels>
<width>20 20 20</width>
<pixels>400 400 400</pixels>
<color id="1" rgb="165 42 42" />
<color id="2" rgb="176 196 222" />
<color id="3" rgb="0 0 255" />
......
......@@ -5,7 +5,7 @@
<batches>150</batches>
<inactive>50</inactive>
<source strength="1.0">
<space type="fission">
<space type="box">
<parameters>-15.125 -15.125 -10.665 15.125 15.125 20.825</parameters>
</space>
</source>
......@@ -18,7 +18,7 @@
<domain_type>material</domain_type>
<domain_ids>1</domain_ids>
<samples>10000000</samples>
<lower_left>-1.4 -1.4 -1.4</lower_left>
<upper_right>1.4 1.4 1.4</upper_right>
<lower_left>-10 -10 -10</lower_left>
<upper_right>10 10 10</upper_right>
</volume_calc>
</settings>
No preview for this file type
parameter (lsurf_m=170000)
common /point_cloudx/ pc_x(lsurf_m*4)
common /point_cloudy/ pc_y(lsurf_m*4)
common /point_cloudz/ pc_z(lsurf_m*4)
common /point_cloudt/ pc_t(lsurf_m*4)
common /point_cloudf/ pc_f(lsurf_m*4)
common /ref_element/ pc_flag(lsurf_m*4)
common /tot_surf/ nw_bdt
common /data_reference/ plmask(lelt), pflmask(lelt),
& pplist(lelt), offset, nw_bd1
common /test_passing/ flux_moose, temp_nek
real pc_x, pc_y, pc_z, pc_flag, pc_t, pc_f
integer plmask, pflmask, pllist, offset, nw_bd1, nw_bdt
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
<?xml version='1.0' encoding='utf-8'?>
<materials>
<material depletable="true" id="1" name="m_fuel - uranium oxycarbide - triso partciles">
<density units="g/cm3" value="10.5" />
<nuclide name="U234" wo="0.03565284" />
<nuclide name="U235" wo="17.790767159999998" />
<nuclide name="U238" wo="71.75358" />
<nuclide name="C0" wo="1.8" />
<nuclide name="O16" wo="8.616527990092724" />
<nuclide name="O17" wo="0.003472009907274255" />
</material>
<material id="2" name="m_graphite_c_buffer - triso partciles">
<density units="g/cm3" value="1.0" />
<nuclide ao="1.0" name="C0" />
<sab name="c_Graphite" />
</material>
<material id="3" name="m_graphite_pyc - triso particles">
<density units="g/cm3" value="1.87" />
<nuclide ao="1.0" name="C0" />
<sab name="c_Graphite" />
</material>
<material id="4" name="sic - triso partciles">
<density units="g/cm3" value="3.2" />
<nuclide ao="1.0" name="C0" />
<nuclide ao="0.9222968" name="Si28" />
<nuclide ao="0.0468316" name="Si29" />
<nuclide ao="0.0308716" name="Si30" />
</material>
<material id="5" name="m_graphite_matrix - triso particles">
<density units="g/cm3" value="1.6" />
<nuclide ao="1.0" name="C0" />
<sab name="c_Graphite" />
</material>
<material id="6" name="m_graphite_inner - pebble inner zone">
<density units="g/cm3" value="1.59368" />
<nuclide ao="1.0" name="C0" />
<sab name="c_Graphite" />
</material>
<material id="7" name="m_graphite_outer - pebble outer zone">
<density units="g/cm3" value="1.74" />
<nuclide ao="1.0" name="C0" />
<sab name="c_Graphite" />
</material>
<material id="8" name="m_flibe - 2LiF-BeF2">
<density units="kg/m3" value="1962.13354" />
<nuclide ao="1.9999" name="Li7" />
<nuclide ao="9.999999999998899e-05" name="Li6" />
<nuclide ao="1.0" name="Be9" />
<nuclide ao="4.0" name="F19" />
</material>
</materials>
[Mesh]
type = NekMesh
[]
[Variables]
[dummy]
[]
[]
[AuxVariables]
[avg_flux]
[]
[]
[Problem]
type = NekProblem
[]
[Executioner]
type = Transient
num_steps = 50000
[]
[Outputs]
[exo]
type = Exodus
output_dimension = 3
interval = 100
execute_on = 'timestep_end'
[]
[]
[Postprocessors]
[total_flux]
type = Receiver
default = 0
[]
[]
[Mesh]
type = FileMesh
file = spheres_generator_in.e
[]
[Kernels]
[hc]
type = HeatConduction
variable = temp
[]
[heat]
type = BodyForce
#value = 35.37
value = 70
variable = temp
[]
[]
[BCs]
inactive = 'outside'
[outside]
type = DirichletBC
variable = temp
boundary = '1'
value = 300
[]
[match_nek]
type = MatchedValueBC
variable = temp
boundary = '1'
v = 'nek_temp'
[]
[]
[Materials]
[hc]
type = GenericConstantMaterial
prop_values = '0.2' # 20 W/mK -> 0.2 W/cmK
prop_names = 'thermal_conductivity'
[]
[]
[Executioner]
type = Transient
petsc_options_iname = '-pc_type -pc_hypre_type'
num_steps = 50000
petsc_options_value = 'hypre boomeramg'
dt = 5e-4
nl_rel_tol = 1e-5
[]
[Variables]
[temp]
[]
[]
[Outputs]
inteval = 100
exodus = true
[]
[MultiApps]
[nek]
type = TransientMultiApp
app_type = NekApp
input_files = 'nek.i'
[]
[]
[Transfers]
[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
[]
[]
[AuxVariables]
[nek_temp]
[]
[avg_flux]
family = MONOMIAL
order = CONSTANT
initial_condition = 0
[]
[]
[AuxKernels]
[avg_flux]
type = FluxAverageAux
coupled = 'temp'
diffusivity = thermal_conductivity
variable = avg_flux
boundary = '1'
[]
[]
[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'
[]
[]
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
// Boundary conditions
void insVelocityDirichletConditions3D(bcData *bc)
{
bc->uP = 0.0;
bc->vP = 0.0;
bc->wP = 0.17;
}
void cdsDirichletConditions3D(bcData *bc)
{
bc->sP = 573.0;
}
void cdsNeumannConditions3D(bcData *bc)
{
bc->sF = bc->wrk[bc->idM];
}
// Stabilized outflow (Dong et al)
void insPressureDirichletConditions3D(bcData *bc)
{
const dfloat iU0delta = 10.0;
const dfloat un = bc->uM*bc->nx + bc->vM*bc->ny + bc->wM*bc->nz;
const dfloat s0 = 0.5 * (1.0 - tanh(un*iU0delta));
bc->pP = -0.5 * (bc->uM*bc->uM + bc->vM*bc->vM + bc->wM*bc->wM) * s0;
}
[OCCA]
backend = CUDA
deviceNumber = 0
[GENERAL]
#verbose = true
polynomialOrder = 7
#startFrom = r5.fld
stopAt = numSteps
numSteps = 50000
dt = 5.0e-4
timeStepper = tombo2
extrapolation = subCycling
subCyclingSteps = 2
writeControl = TIMESTEP
writeInterval = 100
filtering = hpfrt
filterWeight = 200
filterModes = 2
[PRESSURE]
preconditioner = semg_amg
amgSolver = parAlmond
#galerkinCoarseOperator = yes
residualTol = 1e-04
[VELOCITY]
#solver = pcg+block
boundaryTypeMap = inlet, outlet, wall, wall
density = 1.0
viscosity = 0.0001
residualTol = 1e-06
[TEMPERATURE]
#solver = none
boundaryTypeMap = inlet, outlet, insulated, flux
rhoCp = 45.0
conductivity = 0.45
residualTol = 1e-06
#[SCALAR01]
#solver = none
#[BOOMERAMG]
#coarsenType = 10
#interpolationType = 6
#smootherType = -1
#iterations = 2 # testing
#strongThreshold = 0.25
#nonGalerkinTol = 0.1
//
// nekRS User Defined File
//
#include <math.h>
#include "udf.hpp"
#include <iostream>
/* UDF Functions */
void UDF_LoadKernels(ins_t *ins)
{
}
void UDF_Setup(ins_t *ins)
{
// get IC from nek
if (!ins->readRestartFile) nek_copyTo(ins->startTime);
ins->o_usrwrk.free(); free(ins->usrwrk);
ins->usrwrk = (dfloat*) calloc(ins->mesh->Nelements*ins->mesh->Np, sizeof(dfloat));
ins->o_usrwrk = ins->mesh->device.malloc(ins->mesh->Nelements*ins->mesh->Np*sizeof(dfloat), ins->usrwrk);
ins->cds->o_usrwrk = ins->o_usrwrk;
// printf ("> Test %d \n", ins->mesh->Nelements*ins->mesh->Np*sizeof(dfloat));
}
void UDF_ExecuteStep(ins_t *ins, dfloat time, int tstep)
{
nek_userchk();
//std::cout << "Finished userchk" << std::endl;
int nwbdt=nekData.cbscnrs[0];
auto *wrk1 = nekData.cbscnrs;
wrk1 = wrk1 + nwbdt*5*4 + 2;
ins->o_usrwrk.copyFrom(wrk1,ins->mesh->Nelements*ins->mesh->Np*sizeof(dfloat));
//auto *ptr=nekData.cbscnrs;
//ins->o_usrwrk.copyFrom(wrk, mesh->Nelements*mesh->Np*sizeof(dfloat));
//std::cout << "Finished UDF_ExecuteStep" << std::endl;
}
include 'nek_moose.f'
c-----------------------------------------------------------------------
subroutine uservp(i,j,k,eg) ! set variable properties
include 'SIZE'
include 'TOTAL'
include 'NEKUSE'
integer i,j,k,e,eg
c e = gllel(eg)
udiff = 0.0
utrans = 0.0
return
end
c-----------------------------------------------------------------------
subroutine userf(i,j,k,eg) ! set acceleration term
c
c Note: this is an acceleration term, NOT a force!
c Thus, ffx will subsequently be multiplied by rho(x,t).
c
include 'SIZE'
include 'TOTAL'
include 'NEKUSE'
integer i,j,k,e,eg
c e = gllel(eg)
ffx = 0.0
ffy = 0.0
ffz = 0.0
return
end
c-----------------------------------------------------------------------
subroutine userq(i,j,k,eg) ! set source term
include 'SIZE'
include 'TOTAL'
include 'NEKUSE'
integer i,j,k,e,eg
c e = gllel(eg)
qvol = 0.0
return
end
c-----------------------------------------------------------------------
subroutine userbc(i,j,k,f,eg) ! set up boundary conditions
c NOTE ::: This routine MAY NOT be called by every process
include 'SIZE'
include 'TOTAL'
include 'NEKUSE'
integer i,j,k,f,e,eg
e=gllel(eg)
ux = 0.0
uy = 0.0
uz = 1.0
if (cbu.eq.'o ') then
U0 = 1.0 ! characteristic velocity
delta = 0.1 ! small positive constant
pa = dongOutflow(i,j,k,e,f,U0,delta)
endif
flux = 0.0
temp = 0.0
c if (cbc(f,e,1).eq.'W '.AND.cbc(f,e,2).eq.'t ') temp=1.0
if (cbc(f,e,1).eq.'W '.AND.cbc(f,e,2).eq.'f ') flux=1.0
return
end
c-----------------------------------------------------------------------
subroutine useric(i,j,k,eg) ! set up initial conditions
include 'SIZE'
include 'TOTAL'
include 'NEKUSE'
integer i,j,k,e,eg
ux = 0.0
uy = 0.0
uz = 1.0
temp = 573.0
return
end
c-----------------------------------------------------------------------
subroutine userchk
include 'SIZE'
include 'TOTAL'
include 'NEKMOOSE'
c implicit none
COMMON /SCNRS/ SC_NRS(LX1*LY1*LZ1*LELT*7*5)
real SC_NRS
common /flux_reconstructed/flux_recon(lx1,ly1,lz1,lelt)
integer n_count
save n_count
n=lx1*ly1*lz1*nelt
if (istep.eq.0) then
xxmax = glmax(xm1,n)
yymax = glmax(ym1,n)
zzmax = glmax(zm1,n)
xxmin = glmin(xm1,n)
yymin = glmin(ym1,n)
zzmin = glmin(zm1,n)
if (nio.eq.0) then
write(6,18) xxmin,yymin,zzmin
write(6,19) xxmax,yymax,zzmax
18 format(' xyz min ',5g13.5)
19 format(' xyz max ',5g13.5)
endif
ifxyo=.true.
c call outpost(vx,vy,vz,t,pr,' ')
endif
c if (mod(istep,500).eq.0) then
c umin=glmin(vx,n)
c umax=glmax(vx,n)
c vmin=glmin(vy,n)
c vmax=glmax(vy,n)
c wmin=glmin(vz,n)
c wmax=glmax(vz,n)
c tmin=glmin(t ,n)
c tmax=glmax(t ,n)
c if (nio.eq.0) write(6,1)
c $ istep,time,umin,umax,vmin,vmax,wmin,wmax,tmin,tmax
c 1 format(i9,1p9e11.3,' tmax')
c
c call compute_cfl(cfl,vx,vy,vz,dt)
c call outpost(cflf,vy,vz,pr,t,'cfl')
c endif
c if (istep.gt.0) then
c ifield = 1 ! essential for lambda2 right now
c call lambda2(t(1,1,1,1,2))
c tmin=glmin(t(1,1,1,1,2) ,n)
c tmax=glmax(t(1,1,1,1,2) ,n)
c if (nio.eq.0) write(6,2)istep,time,tmin,tmax
c 2 format(i9,1p3e11.3,' tmax2')
c
c ifxyo = .true.
c ifvo = .true.
c ifpro = .true.
c ifto = .true.
c ifpsco(1) = .true.
cc call outpost(vx,vy,vz,pr,t,' ')
c endif
c call comp_Reynolds
n_count=n_count+1
! The first call is at time step zero
if ((1+1+nw_bdt*4*5+n).gt.(7*5*n)) then
if (nid.eq.0) write(6,*) "> Insufficient scratch memory"
call exitt()
endif
if (n_count.gt.2) then
if (mod(n_count,2).eq.1) then
if (nid.eq.0) write(6,*) "> DOWNLOADING FLUX"
do i=1,nw_bdt*4
pc_f(i)=sc_nrs(1+i+nw_bdt*4*4)*1.5*1.5
enddo
flux_moose=sc_nrs(1+1+nw_bdt*4*5)
call flux_reconstruction()
do i=1,n
sc_nrs(1+1+nw_bdt*4*5+i)=flux_recon(i,1,1,1)
enddo
endif
if (mod(n_count,2).eq.0) then
if (nid.eq.0) write(6,*) "> LOADING TEMPERATURE"
tmin=glmin(t,n)
tmax=glmax(t,n)
if (nid.eq.0) then
write(6,*) "> Temperature: ", tmin," - ", tmax
endif
call nek_interpolation()
do i=1,nw_bdt*4
sc_nrs(1+i+nw_bdt*4*3)=pc_t(i)
enddo
endif
endif
return
end
c-----------------------------------------------------------------------
subroutine usrdat ! This routine to modify element vertices
include 'SIZE'
include 'TOTAL'
return
end
c-----------------------------------------------------------------------
subroutine usrdat3
include 'SIZE'
include 'TOTAL'
return
end
c-----------------------------------------------------------------------
subroutine usrdat2
include 'SIZE'
include 'TOTAL'
include 'NEKMOOSE'
COMMON /SCNRS/ SC_NRS(LX1*LY1*LZ1*LELT*7)
real SC_NRS
common /flux_reconstructed/flux_recon(lx1,ly1,lz1,lelt)
integer f,e
n=lx1*ly1*lz1*nelt
nface = 2*ldim
do e=1,nelv
do f=1,nface
if(cbc(f,e,1).eq.'E '.or.cbc(f,e,1).eq.' ')then
cbc(f,e,1)='E '
cbc(f,e,2)='E '
elseif(cbc(f,e,1).eq.'v ')then ! z_bottom
boundaryID(f,e) = 1
cbc(f,e,2)='t '
elseif(cbc(f,e,1).eq.'O ')then ! z_top
boundaryID(f,e) = 2
cbc(f,e,1)='o ' ! Dong's outflow
cbc(f,e,2)='O '