-
Notifications
You must be signed in to change notification settings - Fork 3
stop API
The stop class is called as:
>> sim = stop(filename)
where filename
is the name of the parametrized serpent input file e.g. sphere.spi
.
Properties and methods of sim
object are shown in the table below
Properties | Methods |
---|---|
serpExe | run() |
saveResPar | displayParameters() |
name | |
values | |
isTest | |
isContinue | |
isEcho | |
isXSEC |
- String
Property to specify the name/fullname of the serpent executable sss
.
Default value:
sim.serpExe = 'sss'
Example of usage:
sim.serpExe = 'sss1118' or sim.serpExe = '/absolute/path/to/sss'
- Cell
Property to specify the list of parameters to extract from serpent _res.m
file.
Default value:
sim.saveResPar = {'ANA_KEFF';'IMP_KEFF'}
Example of usage:
sim.saveResPar = {'IMP_KEFF','TOT_POWER','FLUX','FISSXS'}
- String
Property to specify simulation name.
Default value:
sim.name = '' % empty string
Example of usage:
sim.name = 'test'
Warning: Each simulation must have a different name
to avoid result-overwriting.
- Struct
Property to specify the values of parameters
inside parametrized serpent input file *.spi
.
Default value:
sim.values = struct() % empty structure
Example of usage:
sim.values = struct('TITLE','test','RAD',4) % parameters from sphere.spi.
- Boolean
This boolean flag is used to test the geometry of the input file.
If set to true it will do something like sss input -testgeom 10000 -plot
.
Default value:
sim.isTest = false
- Boolean
This boolean flag is used to continue the calculation if it was stopped in the middle. Let say you were running 20 different serpent calculations. And the calculation was interrupted after 10. Then you just need to set the flag to true and launch the calculation again. It will continue from 10th on.
Default value:
sim.isContinue = false
- Boolean
This boolean flag is used to continue show the calculation flow from within matlab's command window.
Default value:
sim.isEcho = true
- Boolean
This boolean flag is used if you want to generate XSEC card for Parcs.
Default value:
sim.isXSEC = false
This method shows the list of parameters inside parametrized serpent input file '*.spi'
Example of usage:
>> sim = stop('sphere.spi')
>> sim.displayParameters()
List of unique Parameters in file "sphere.spi"
'RAD'
'TITLE'
List of unique equations
'RAD'
'TITLE'
This method creates an input file with specified values of parameters and then performs the simulation on serpent.
Example of usage:
>> sim = stop('sphere.spi')
>> sim.name = 'test'
>> sim.run('TITLE',sim.name,'RAD',4)
Alternatively you can use the following work-flow.
>> sim = stop('sphere.spi')
>> sim.name = 'test'
>> sim.values = struct('TITLE',sim.name,'RAD',4) % use matlab struct
>> sim.run()
The dataOptimizer class is called as:
>> object = xsec.dataOptimizer(structure)
where structure
is the final simulation data structure, saved in allresults.mat
Example of usage:
>> a = xsec.dataOptimizer(data_a)
>> b = xsec.dataOptimizer(data_b)
dataOptimizer
class will convert 'data_a' and 'data_b'
into a specific objects a
and b
.
These objects allow the following operations:
Description | Operation | Method |
---|---|---|
Binary addition | a + b |
plus(a,b) |
Binary subtraction | a - b |
minus(a,b) |
Element-wise multiplication | a.*b |
times(a,b) |
Right element-wise division | a./b |
rdivide(a,b) |
Element-wise power | a.^b |
power(a,b) |
This operations obey specific rules required for xsec card generation, especially when it comes to calculate xs derivatives.
The xsec class is called as:
>> object = xsec()
Example of usage:
xs = xsec()
xs.comp_num(1)
xs.base_macro(a,1)
xs.comp_num(2)
xs.base_macro(b,2)
xs.display()
xs.write()
xs object has the following methods
- comp_num
- base_macro
- dxs_dtf
- dxs_ddm
- dxs_axexp
- delcr_comp
- delcr_base
- display
- write
This method creates comp_num string for universe N.
N is an integer
Example of usage:
>> xs.comp_num(1)
comp_num 1 !UNIVERSE 1
This method creates base_macro card for universe N.
Example of usage:
>> xs.base_macro(ref,1)
base_macro 1.428350E-01 7.292110E-03 1.961350E-02 2.163144E-13
2.714020E-01 5.621010E-03 6.842740E-03 7.831517E-14
4.929060E-01 2.623120E-02 2.158140E-02 2.496620E-13
8.163120E+00 4.897870E-01 1.391790E+01 1.494473E-10
3.291520E-02
2.360680E-05 1.217530E-03
0.000000E+00 0.000000E+00 0.000000E+00
fiss_spec 7.631370E-01 2.367060E-01 1.574800E-04 0.000000E+00
This method creates dxs_dtf card for universe N.
Example of usage:
>> xs.dxs_dtf( (fthi-ref)./(log(1800)-log(300)),1)
dxs_dtf -1.467831E-04 -2.205095E-05 -7.858198E-05 -6.127267E-16
1.144685E-03 4.847749E-05 5.162523E-05 5.919411E-16
7.244276E-04 6.003596E-04 -6.563381E-05 -5.377076E-16
-4.555924E+00 -2.733553E-01 -7.767728E+00 -8.340812E-11
-4.581530E-04
-2.771019E-07 4.888491E-05
0.000000E+00 0.000000E+00 0.000000E+00
Alternatively you can do the following:
>> dxsdtf = (fthi-ref)./(log(1800)-log(300)) % create dxsdtf object
>> xs.dxs_dtf( dxsdtf,1)
This method creates dxs_ddm card for universe N.
Example of usage:
>> xs.dxs_ddm( (cdlow-ref)./1100,1)
dxs_ddm -4.080000E-06 4.700909E-08 5.900000E-08 3.106153E-19
-5.204545E-06 3.412727E-08 2.199091E-08 2.245318E-19
-2.079818E-05 5.954545E-08 6.800000E-07 7.968980E-18
-2.121891E-03 -3.392782E-04 -1.265264E-02 -4.072270E-14
-1.055636E-06
-2.146073E-08 -1.948182E-08
0.000000E+00 0.000000E+00 0.000000E+00
This method creates dxs_axexp card for universe N.
Example of usage:
>> xs.dxs_axexp( (fhhi-ref)./2700,1)
dxs_axexp -1.898519E-06 -5.209259E-08 -2.034444E-07 -2.049268E-18
-1.471852E-06 -3.914444E-08 -5.842593E-08 -6.803200E-19
-5.100741E-06 -3.733333E-07 -3.491852E-07 -4.041495E-18
-2.384519E-03 -1.365863E-04 -5.154778E-03 -5.028600E-14
-8.582963E-07
-5.124204E-09 3.590370E-08
0.000000E+00 0.000000E+00 0.000000E+00
This method creates dxs_axexp card for universe N.
Example of usage:
>> xs.dxs_radexp( (dgphi-ref)./2700,universe(i));
where dgphi
represents calculation with increased diagrid pitch.
This method creates delcr_comp card for universe N.
This method calculates XS change for scenarios with control rods out and control rods in for universe N2.
This method displays the xsec card and allows to check if the work-flow is correct.
This method writes xsec card to a file.
If no filename is specified it will write it in xsecforparcs.txt
.
Example of usage:
xs.write('xsec_fuelpin.txt');