 We're like just sync up with everybody else if you'd like to Before we get going But before that there were a few topics that people brought up that are pretty interesting And so I was just going to show some of the additional capabilities that we have an open MC that we don't have time to kind of experiment with ourselves our experiment with today, but Yeah, so we have the ability the question was asked earlier, how do we connect to Dagum C This is a method for representing CAD based geometry and mining Karlo codes So we have a whole notebook on this with a lot of examples as part of the course that we do with the NEA That's a four-day course. So we have a lot of time to dive into special topics like this But here we'll just do kind of an overview of the content and capabilities that are demonstrated in this notebook so In this example, we just model a simple teapot like this, which is Relatively it's a relatively simple object, but it's not something that we'd want to try to represent Given what we know already about how how to do this in CSG. It would be very very difficult to model in CSG so What we can do is if we have an existing Dagum C model Then we can import that and use it as a geometry in open MC And the different volumes and the parts in the CAD model can be assigned different materials So here we just filled our teapot with a little bit of water And then you can see the geometric detail that we can kind of convey in open MC models using this geometry method And we can execute these things Just like we would with tallies and anything else as we would do with CSG So here's kind of a tally region That's like superimposed on top of the geometry and we're gathering some information about the scattering that's going on in The shell of the teapot as well as in the water We can do this for a Tokamak geometry as well. So for those of you who are more fusion inclined You can import CAD based geometries that are Tokamaks also and one of the really powerful parts of how CAD based geometry has been designed and Implemented in open MC is that we can take pieces of this model and clip it with CSG planes In a lot of codes. I think now that use Dagum C Either the entire model needs to be built with the native CSG geometry like we've done with the pencil or it needs to be CAD and in open MC we can mix and match and combine those so this example goes on to show that We can take a section of this and kind of make a quadrant of the Tokamak models We're looking down from the top of the machine and all the way around is this azimuthal symmetry And we're on the poidal direction of the fusion device And then we can take that and make an additionally kind of clip it so that we just have the upper half of the machine But then we can go on to combine that Later on so we can kind of just cut the model in this way Let's see There were also questions about the nuclear data aspect of this Oh, and I guess maybe yeah, that's why I didn't see this. There were also questions about the nuclear data API with open MC So this is just showing some of the things that we've talked about already the atomic masses that we store in the natural abundances for each element An isotope and then more information about how we can compute things like dose coefficients So these are things that we store as part of the data module generally But then there's also our ability to kind of Determine decay photon energies things like this the incident neutron class is kind of where we handle reaction information So we have an incident neutron and all the different possibilities Angle energy correlations and distributions that go along with those reactions as well So it provides examples of how to interact with those at different temperature values for like the total cross section How to plot cross sections relatively easy easily and things like that There's a whole set of examples of these at In one of the links that I provided in the slides So I do make sure you download those so you have those resources in the very last slide of that presentation Because a lot of this kind of information is available in that notebooks repository The last one that came up a couple of times was whether or not we could plot in 3d We can do that with the Python API We get plots that look more like this one. They're just kind of an axis line slice through a reactor model However, we do have the ability to do 3d plots in a couple of different ways One is voxel plotting So this allows you to specify a width in x and y and then also in z And so essentially it's taking it's doing a whole bunch of different slice plots at different Axial levels of the geometry and then you can export them And if you do it in a high enough resolution, you can get pretty nice images However, it's not like the most efficient thing. This is storing a very large What is essentially a very large mesh of the different cells contained in each voxel Recently somebody a student at MIT added the ability to do projection plots So this is a lot like path tracing or volume rendering of our geometries in open MC It's not the fastest thing in the world compared to other visualization tools that are like built for visualization But it does give you the ability to add some opacity to show outlines and things like that and then make really nifty Gifts like heated here for this So I just wanted to touch on those few topics. Yeah, okay. Good. So this is kind of where we left off Last time when or right before we broke for lunch So we did hopefully an open MC run and I realized that we've got through a lot of material this morning And it's a lot to keep up with so I just wanted to talk about How we could how you can potentially sync up at this point and just start from where we are Inside of the file browser under the notebooks folder There is corresponding solutions to each of the tutorial sections So for the open MC tutorial, there's also an open MC solution notebook and so I'll go ahead and open that And here we see it's that same notebook that we're working with the narrative is all the same But all of the information that we put in going through it this morning together is already there in present and so If you would like an easy way to sync up with where we are is to go to the section in the outline That shows running open MC So again, I'll just kind of reiterate if you go to the file browser Under notebooks and open MC solution You can open this notebook and then in the table of contents if you click on running open MC You can select this cell and then kind of as we discussed in the Jupiter notebooks intro You can sync up to where we're at right now just by saying restart kernel and run up to the selected cell so if I do this I See that all these cells above the one that I've currently selected have these stars meaning that they're kind of waiting to execute And then eventually we'll get there. We'll execute and Then we'll go down and we'll do execute our first open MC run Just like we did in the in the other notebook So if you'd like that's a nice way to kind of catch up to where we are and then you can continue to follow along in Thus in this same notebook and have all the same information that we're working with cool. So One thing well, so I'll just pause there Are there any questions about syncing up or kind of catching up or that any people who might just be like one or two steps away From getting where we are by following along this morning. Okay. All right sounds good on we go so One thing that we kind of step past this morning before running our first Open MC simulation was the temperature treatment trying to silence the notification on my machine Okay, so one thing that we kind of step past was temperature treatments We did talk about this a little bit this morning But how open MC handles temperatures that are a specific material because the underlying nuclear data The cross-section the true physical cross-section values are going to change depending on the temperature of the material So there's two main ways that Open MC handles temperature treatment So one is the nearest option meaning that open MC will if you specify a temperature on a material Open MC will load cross-section data as close as it can to that temperature, and then it will use that in simulation There's another option that is to interpolate the temperature cross-section dependence And it will do that by loading Cross-sections at temperatures that bound the temperatures of the material on the problem and use the two closest ones interpolating between the two So we already ran open MC Which is kind of neat because now we can just take a quick look at like what the effect of that is So our we'll just take note of our combined k effective like 1.48 241 here we'll take a look at it again before we run but What we can do is change the Temperature of our materials in a pretty easy way using Python. So if we just said for M in materials Remembering that the materials is this material collection that we had Earlier on in the morning and then we can just say M dot temperature Equal to five twenty three point one five and this temperature is going to be in Kelvin to be clear Now we'll also need to do I'll also need to specify what temperature method we'd like to hand how we'd like open MC to Handle temperatures essentially on these materials. So if we use settings, you can say temperature And there's a couple different settings that we can That we can set here so one is just the method Okay, so this is how we're going to specify what methods use whether it's interpolation or nearest and we can just use this term nearest and And then we also will tell it the tolerance so the tolerance temperature The tolerance specifies how far away The cross-section the temperature for the cross-section data can be from a given material temperature before open MC Will not use it. So in this case, we're going to set a relatively large tolerance Just to make sure that we can run the problem just fine but typically you want that to be no larger than like how how off your cross how how Approximate your cross-sections will be in your simulation. So that's just something to keep in mind So by setting these we can go ahead and look at our materials. So if we just looked at the first material And our material collection Oh materials, I missed an S And we'll see that the temperature has now been updated from what it was the default value being room temperature to 523.15 Kelvin so then we want to export those new settings that we've applied Along with the new materials So that way we're capturing the settings that we added here in our XML file and the new material temperatures also and Then we can go down to this cell run open MC So here we see the same output But one thing that we can note is that the minimum neutron data temperature Which used to be 294 Kelvin and the previous run is now 600 Kelvin because that's the closest cross-section Cross-section temperature that we have available for our materials And then when we come down and run we can see that our K effective did in fact change Considerably so there's a little section here on geometry plotting. This has a lot to do with me Excuse me. Oh, yeah, just in between so you change temperature, but you don't change dimensions, of course because Correct. Yeah. Yeah, that's a good point. Usually you need like to This calculate the reactivity coefficients. For example, you this temperature also all dimensions are changed It's a new way to do it in No, there's there's no way to do that automatically But that's a good point Vladimir was saying that if we were to change the temperature of a model There's likely going to be some changes in the geometry as well And so if we were to model a reactor at zero power versus full power Then we would want to account for that and change the geometry according to the point But there's no way to automatically do it an open emcee at this point Let's see. There's a section here on geometry plotting this I think probably more important to capture at this point is How we interact with open emcee in the command line So I'm going to talk about that for a little bit But this is about how to generate plots and this is available in the solutions notebook also but this is about how to Create objects that will Where you can generate plots using the open emcee executable rather than do it from the python notebook So if you were doing that as part of like a full Analysis and you had like a script that ran open emcee in plotting mode and then ran it in criticality mode It will read plots from the XML file and generate images for you in the in the terminal I think we have bigger fish to fry it today So I'll leave that to you to discover in the solutions notebook and just talk a little bit about How we interact with open emcee in a terminal So this is something also that's really nice about these notebooks as I I went to this file menu And then went down to new and you can create a terminal here and interact with the Amazon machine as if you were in a shell For those familiar with Linux, so I'm inside of this folder where we have all the workshop content so for that corresponds to the same set of files that we've been using in the Explorer here and in our notebooks I Can look at see what's in here so in the open emcee Tutorial folder change directory into that You can see a number of different files all the same ones that we see here on the left And so we have our materials XML our settings XML and geometry XML I mentioned also that when we imported open emcee it Determined the cross the path to the cross section data from an environment variable and I can ask the terminal display that to screen So if I ask it to echo this environment variable, you don't need to follow along with this part by the way I just want to kind of demonstrate it but if I echo this environment variable to screen that we see it matches the one that we saw in the notebook and Additionally, we can also run open emcee from here. So I'll just run it with the help flag So it gives us all these different options. I'm calling the open emcee compiled executable as opposed to running it from Python Like we were before and here we can see all the different options and run modes that we have available and open emcee So if we want to do something like let's say run open emcee And we're just going to run it with two threads instead of four So we're going to rerun it with kind of half the computational power. We were running before We'll execute that and we'll get all the same output that we were looking at in the Python notebook So this is more common to how you would execute open emcee If you were like a developer like me or aspire to be a developer in the future, we're always welcoming new people and Also, if you were to run this on an HPC system, this is much more how you would probably operate in terms of executing open emcee So here we can see that this option that we passed dash s and then the number of threads that we want to run with Did actually affect our simulation because now we're running with two cores on the Amazon machine And off we go running our simulation And it produced the same excuse me Patrick. How did you get this to console? The ticket to the terminal. Oh, yeah, it was in the file menu And then under new if you click on terminal So yeah, and we we produced the same k effective value that we did in our notebook So we've talked about kind of initially just general Monte Carlo problem setup where we had materials geometry and settings And then we interacted with a corresponding object in open emcee Generated input files and we ran our first simulation There is a class in open emcee that kind of ties all this together and sort of streamlines model development The reason we don't start with that as we do like to break the problem down like problem set up down into these different components Before we introduce this class, but there's a class. That's called the model class in open emcee And it can tie all of these things together so we can provide it with the settings Well, let's do it like this. We'll set it. We'll just create one and then we'll set the settings To the one that we have in our current environment the geometry To the geometry object and the material materials to the material materials collection That we had before and so now one really convenient thing about this class is without having to export anything And without having to yeah without having to export anything and then call run we can do that all in one step and one Really beneficial byproduct of this path to running open emcee is that it produces the path to the output file at the end So in Python, it's really convenient because I can say give me the state point file Or the output file from doing a model that run So if we do that we see we're gonna run open emcee again this same problem and then at the end of that We then get this information that is the state point file on our system And so we can just take that and run with it now as we move on to looking at how to extract information From an open emcee simulation, which we're gonna start talking about soon One thing I wanted to note is that we produce three different XML files originally and when we did Model run it produced a single model XML file and what that contains is Essentially these other three XML files all put into one into one file And I just wanted to note that if you're doing this that the model that XML file is going to be Preferred over the separate XML file. So when you're executing open emcee It's going to use that model that XML to get the whole set of information It needs to run the simulation rather than using any of these individual XML files If that's present in the directory and we do see a warning to that effect So we see a warning saying hey, there's other model or there's other XML files here But we're gonna use the model XML just to look like make sure that There isn't an error in Where information is expected to be yeah, there's a question about the burn up calculation in open emcee It's a side question, but yeah, the result gives the burn up as a function of energy or Do they have to do a normalizations? So those are those are sort of two separate questions, I think so one Gives the we're not doing burn up calculations here You can do those with open emcee and you would require some kind of power input for such a calculation So so for the first one, we're not really doing burn up. I suppose and then what's the second piece? The normalization. Yeah. Yeah, so we're gonna talk about that really soon. So that's a very timely question Thank you for asking it all the information Well, all the tallies that we are gonna look at in a little bit will kind of explore normalization So we'll just go forward with that. Okay, so Moving on we're gonna start to talk about how to produce customized information from our open emcee simulation It's a weird artifact that I'm seeing on my screen So We're gonna look at how to Apply what we call filters and open emcee so an open emcee we like essentially what we're computing is an angular flux As we simulate particles and we're converging that over time And so based on that angular flux meaning particles are moving in any given direction From a firm a given position and in at a certain energy We can take that information as we generate that field and filter it to get specific information that we want We can filter that information down in a number of ways, and this is kind of philosophically how we approach tallies and open emcee we can filter it by Score meaning that the score might filter information out for only a specific reaction type like if we wanted to look at Only fission reactions we can filter that out by angle So if we wanted to look at particles only moving through a region at a certain angle Or into a region at a certain angle like if we're computing multi-group cross sections or something like that We can also filter it based on spatial Information so if we only wanted to tally information for a certain cell then we would filter based on that cell And we can combine these things in a pretty flexible system to get the specific information we want from our simulation Okay, so first we're just going to import a couple of other Modules that are pretty much ubiquitous to To scientific computing with Python, so one is numpy which is a numerics Well, it's really like a yeah, it's like a it's like a matrix representation library That allows you to kind of store information with an arbitrary set of dimensions and all this stuff But it's really useful because it allows you to specify specific data types So we'll use that from time to time here and then for visualization We're going to be importing map plotlib and specifically we're going to be importing the pi plot module And then we're just going to give it a different name to shorten it up a little bit. This is a pretty common almost what I call idiom in in Python scripts that you'll see for scientific work Okay, so going forward we're going to continue to work with our model and just to remind ourselves a little bit about What that model contains we can look at things like the geometry That geometry is root universe as well And so just like we looked at when we ran this model before lunch We have these cells in it and then from the model. We can also The model geometry we can do things like ask it to go through and get all the materials in that model So just kind of a refresher on what we're dealing with and we can plot that universe as well model geometry okay, so Now that we have kind of a refresher on the different materials In our model what the geometry looks like we're just going to work on a few different things for generating Tallys and open MC and extracting specific information So one is we're going to determine the energy or heat produced from each vision event And then we're going to look at the flux spectrum of the pin cell and Then finally we're going to do some plotting of reaction types based on material depending on time here So first we're going to work on energy release per vision so the important thing to know here is the Or to have in mind is the different types of scores that open MC can filter by so the scores are Things like the new vision or the number of neutrons produced per vision event the elastic scattering That occurs so it'll filter only elastic scattering events or general scattering scattering events And there's a whole list of different interactions If you're really familiar with Monte Carlo and you're thinking of MT reaction types Which are just identifiers for a specific reaction open MC You can take those in place of any of these scores as well So here in this section we have scores that are kind of based on energy Meaning that we're going to be looking at the energy produced by a vision event and scoring that so when we ask for that in a Tally, we'll be accumulating that information in the simulation So there's a few of notes that I just wanted to talk about so one is just heating So this is just general heating from neutron fission and this does not include the Energy produced from gammas as a result of this vision event. There is also heating local, which means that the heating It includes the heating from the vision event itself and the neutron energy is coming out But also includes the photon energies as though they were deposited locally, so that's the local kind of part of it And I mentioned that because they're often confused, but the descriptions are here in the future if you need it And then we also have the cap of vision, which is just the pure It's the pure Q value of the reaction overall so the total kinetic energy released back into the problem And this is probably the most common one that you'll see used Overall so first thing we're going to do is go ahead and create a tally We'll print that tally to screen so we see that tallies are another set of objects and open emcee that contain IDs They're going to have filters so filters and scores just to distinguish between those two scores are typically something like a reaction type or Property of a reaction that we're accumulating and tallying Whereas filters are more like we want information only in this cell or information only from particles going in a certain direction Or in a certain energy range So kind of filters are more about phase space and scores are a little bit more about the reactions themselves We can only also tally we won't be doing this today, but we can also tally specifically for reactions from a particular Nuclide if we want to also so that's really useful for like Burnup calculations and things like that so for this tally we're going to need just a couple of scores to accomplish this task So the first thing we're going to do is I'll go up here I'll say tally scores and we can just provide this attribute To the tally object and the set of scores by name that we want to tally so here We're going to be tallying a fission rate so this is going to give us the number of Fission events per source particle in the simulation and we'll talk a little bit about the normalization aspect of that in a little bit and Then the q-value per source particle particle or the cap a fission value And then we can look to kind of ensure ourselves that those were in fact added to the tally object right and then using this model class is really handy because adding these tallies to the simulation is really just as simple as saying model dot tallies and Then provide that attribute with the tallies collection object and the tallies collection object is very similar to the one That we use for materials, so we just can provide it Open emcee dot tallies and then that tally and now that we've done that We can just run our simulation and again. I'll capture that state point file for use later We'll let that run shouldn't take too long And now we'll notice something a little bit different about the final state of our simulation If we look at the file explorer on the left-hand side here. There was a new file It's called tallies dot out this did not appear before because we didn't have any custom or user-specified tallies as part of open emcee So if we open this file we see that we have Kind of a summary of information about the tally, so we have tally one See that there are no other filters applied here But that it tally the fission rate and then the cap a fission rate as well Okay, so the tally results which we can visualize here as well This tallies dot out file is a nice way to look at like a summary of tallies But it's not the best way to interact with this data if we wanted to get this information and then Start to use it in Python. We don't want to have to parse through a text-based file To get that information out which is exactly what the state point file is for So we'll look at how to get our tally information out of the state point file next So we're going to provide this line of code and what this is doing is it's going to say with open emcee dot state point file as sp and Then any of the code inside of this block any of the indented code inside of this block It's going to access this object this state point file object and when we leave that indented block of code That state point file is going to be Closed up. So what the state point file is is it's really an hdf5 file containing a whole bunch of binary data from the simulation and we provide this Python API so it's a lot easier to access and process with So this this line here just kind of opens it up This is very much so equivalent to doing something like sp equals open emcee dot state point state point File so I've just executed that and then extract tally information And then running sp.close, but this is a much more how do I say Foolproof way of doing this in Python because if anything goes wrong inside of this block the state point file will still be Closed up afterward Okay, so a little bit on How to get your tally information out of this state point file we know that our tally ID is one and so we probably could look it up That way, but a more robust way to do it is by using the get tally feature of The state point object and so we'll use our helper function Just to examine what Provides to us and what that functionality is so the get tally object will look up a tally based on a whole bunch of Different properties of this tally that we can provide so we can say we could look it up by its scores By the filters we've applied and more simple information like its name or its ID So we'll just kind of experiment with doing a little bit of each of those And so we'll say this tally we can get the oh we're gonna get it by scores here So we'll say the tally scores for the tally that we want to extract from the oh, sorry tape point file The scores are gonna be fission and cap fission and then if we want to get this tally by ID we can do that equivalently just by saying Give me the tally based on its ID instead And then if we print tally by scores, we'll see that this is our original tally But it has a whole bunch of data associated with it now Which is what we want and similarly the object that was returned from this call getting the tally But specifying the ID it comes back and it's the same thing also So just two different ways of doing of extracting that information okay, so yeah as I mentioned it's kind of a quick aside on how We interact with these HDF5 binary files if you open in this way and Then try to run like if I were to do let's see I were to do this and then try to run a subsequent open emcee simulation one kind of Pitfall that we find with open like with this in workflows is that the files The HDF5 files are still open in the file system and so an open emcee goes to Run a new simulation and write a new summary file or a new state point file It's gonna run into an error because it's basically saying like when you open this file here It's locked it out of writing a new file and so that's why we kind of hammered home this point about always making sure that you run this closed command or extract information inside of a block like this Okay, back to back to tallies so To get the energy released per vision event It's relatively easy in terms of the units that we have here So the units that we have if I can show the meeting stuff and then look at the scores So this score the cap of vision units are going to be an EV per source particle All right And so what we're looking to get in the end is just determining like that the MEV per vision event So here it's telling us this is how much energy is released per source particle and then if we look at the vision reaction in reaction is just a reaction rate and units of reactions per source particle, so Have the vision rate per source particle, and then we have the Kappa source particle Okay, and so if we take Kappa Kappa vision value and divided by the vision rate Yet in the end electron volts per In the simulation so in this case determining the energy per vision in our simulation Really doesn't require us to know a source rate. It's more physical property of the materials So that kind of makes sense. It doesn't matter how frequently it's happening just that it happens often enough We get a good estimate of it a little bit on how to extract that information now We have the tally objects and we can look at the information that is associated with those Let's see tally by ID We can see the mean values here. So corresponding to our tally Or tally's out file we have two values one the first one is going to be the Vision rate and the second one is going to be the Kappa vision or energy release per vision now looking at them through the mean is Possible especially for this tally, but it's more and more values accumulate it can be difficult to Know what values we're really looking at And that's where this tally's dot get values command comes in So this will extract information from a tally object based on a whole bunch of different information the scores the filters the new clides Etc. Etc. So owner tally by ID We can get the vision rate By calling get values and then specifying that the scores we want is just this vision score I need to Make sure I say scores is equal to that so I'm telling it This is the type of score that I want to get information for and then I can print the information that comes out of that So one thing we'll do if we notice that's kind of nested in this data structure And if we look at the type of this It's really an array. It's a numpy array So it's kind of nested in this data structure and we want to get it out of there So what we'll do is we can just flatten out this array and get the first value So if we do that then we just get a vision rate and we get a raw value Instead of it being kind of tucked away in this array We do that for good reason because as tallies get more and more complicated You do want to be able to slice through that data array more effectively So we can do the same thing for the cap of vision. We can say tally by ID Get values scores and instead here of using vision We're going to do cap of vision and same thing. This is kind of just managing the array information that we get out We're going to flatten out that array and take the first value and now We should be able to print some information. So if we Let's see Let's say this is our vision rate vision per source particle Not a rate. It's cap of vision And finally We talked about here We'll say this is our MEV per vision. So that's going to be our cap of vision Divided by well, we'll do this in a separate line We'll say MEV per vision equal to cap of vision divided by vision and we'll multiply by Factor of 1 e to the minus 6 so that we get MEV per vision and I guess the units are kind of self-explanatory there All right, so we see we have our vision rate our cap of vision and then as we expect for a system that's fueled with uranium we have something that's around a hundred ninety five to two hundred MEV We're missing a little bit of energy there for photon deposition. So Realistically, I think it would be a little bit closer to 200 but we're also in a fast range or a fast reactor. So question The how to obtain the spot spatial distribution of flux for Fission reaction and So the question was the question line was how do we obtain this spatial distribution for flux or the vision rate or any kind of reaction rate? Really We can do that in a number of different ways We'll look at how to tally information by material in a little bit But if you want a really fine spatial distribution of that you can also use mesh tallies as well And there are one more question about the depletion calculations How many cross-section groups does the burn-up solver used to perform burn-up calculation after the eigenvalue calculations by open MC spinach it So the there's a couple different ways to do burn-up calculations in open MC. So one is when you when you do burn-up calculations with reaction rates instead of Flux you can get a Reaction rate that's integrated across a continuous energy spectrum. So by default in open MC You can we'll use reaction rates. So there's really no cross-section groups to use in that case However, if you are doing a burn-up calculation using flux You can specify an arbitrary energy group structure to open MC to tally that flux and then apply it and burn up Where it will collapse that flux into a reaction rate within the module. I hope that was I hope to answer that question Okay, so Task one so we kind of accomplish what we're looking to do there We got our MEV provision and now we'll go ahead and look at plotting the neutron flux spectrum also So with regard to the neutron flux spectrum, we're gonna need to do a slightly Different tally with a little more complexity to it So to get the flux spectrum, we're gonna need a group structure. So the question in the chat was kind of timely in that sense Open MC provides a A bunch of different group structures particularly as part of the multi-group cross-section module We can take a look at the name of those So here we see a whole bunch of group structures that we could use and then the keys for that meaning that I could Access these group structures by provide it by indexing into this and providing the the name of one of these As a string So for example, we're gonna be using the Casmo 70 group structure and this is how I would access that information is to index into that group structure data structure by just providing the name of the structure that I want to use So we'll call this Casmo 70 Hey, so we're gonna go ahead and set up a Energy filter using this group structure So an energy filter is gonna filter our tally results Into different energy bins and so we're gonna say there and maybe we should just take a look. Yeah, we'll do the energy filter Gonna be open MC Energy filter and then we can just provide it the groups that we want to use here So that would be the Casmo 70 group structure and then we can kind of inspect this object and Just to ensure ourselves that it has the correct number of energy groups. We can do something like look at the bins So we can say length The energy filter so how many bins meaning how many groups have we divided the energy space into and we'll see here that yes In fact, it's a 70 group energy structure and we have 70 bins in our energy filter We'll see a little bit more what those look like in a more intuitive way when we go to plot this flux spectrum So now that we have a filter we're gonna go ahead and apply it to a tally So the new tally we're gonna create is just open MC dot tally Let's call it the flux tally just so we don't clash with the one we did before Let's see So the flux tally is gonna need to have the filter we just created and we're gonna provide that as part of a list So our 70 group energy filter oops flux the flux tally Gores is gonna be set to flux and I think I should do it. So let's take a look at what's in that tally object And so we'll see here. We've created a tally. We didn't provide it an ID But it assigned to because we've already created one tally so far It has one filter. It's an energy filter and it's gonna be scoring the flux So now we can apply this tally really easily just by saying model that tally's Open MC dot tally's As the flux tally and we're gonna capture that state point file still and run our model During the calculation, there are two questions from the chat First one is is it possible to calculate the dose from the neutron flux? In the open MC data module, there are Dose coefficients. So once you produce the flux, you should be able to convolve that Energy base energy group based flux with these dose coefficients to get the dose values that you need Is there another one? Yeah, the second one is if we want to have a group structure, which is not present in the default risk Say ABBN How can we do so like yeah, that's a good question finding the group structure manually. Yeah, yeah That's a really good question. We use one that was predefined in open MC just to like make things easier We'll actually use one that's not an open MC later on but We'll just say temporary temp So if we were one gonna want to do something like that then what we would just provide to the energy filter is the The boundaries of the energy bins. So let's say we wanted one just a two group structure up to 20 MeV So for you to do that That's all we would need to provide to it and then if I look at the The bins of this so I print those out Oh, whoops, I added a Character at the end there if I print those out then it'll show me the groups of this energy filter So the first one goes from zero to point zero one EV and the next one goes From point oh one EV to all the way up to 20 MeV. That was a good question. Thank you for that Let's see, so we did the tally Okay, cool, then we're gonna go ahead and extract this tally Though the same as before we'll say with an open MC object. That's a state point file We're gonna grab that state point location that we got and I'll just note that these are generally predictable The state point file is named Based on the number of batches act the number of total batches in the simulation. So here ours is named state point dot 50 But this just takes out any guesswork As to what the state point file name is using this method with the model object So we'll do this and we'll say the spectrum tally It's gonna be state point dot get tally And what did we call that and call it flux tally? Yeah flux tally And we'll say that the idea of the tally we extract from the state point file should match the flux tally ID Though we gave to the simulation originally, okay, so then Here we're just gonna take the spectra flux spectrum flux spectrum It's just gonna be that spectrum mean and we'll just see the flux spectrum size overall All right, so we have 70 values and are in the mean of this tally We're not gonna dig in too much to like which values which here right now because they're always ordered by our energy And we have one score and now we can go ahead and plot our spectrum That's the size that I wanted Figure of fig size oops, so we're gonna specify a figure size Be able to reuse some of this code to the next section so We will determine the bin boundaries and then on our filter We can get the lethargy bin width Which is really just the log rhythmic width between each of these bins But it'll just give us the ability to plot on a log scale really easily So we'll use that for our x values in our plot and then we're gonna plot a step function We're going to get the unique energy values from our energy filter. So we're taking when we looked at these bins We're just gonna get all of those bin boundaries specifically That should be step on set and then because we're doing we're gonna be doing a step plot So we don't need every single boundary we need all but the last one and that's kind of what this indexing is doing for us And then again, we're gonna just flatten out that that array that we had and make sure to adjust it by the bin widths We're gonna do a semi log plot So we want to make sure that we're looking at our energy spectrum and log scale because it varies a huge number of orders of magnitude And then let's just go ahead and do a couple of labels X label and we just want to note that this is really in was a particle centimeter per source Particle and inevitably Issue in P. Ah, I see so when we imported the NumPy module, I should have imported NumPy is in P. That's a much more common way to see that module imported. So my mistake and Then what did I call this something slightly different? Flux spectrum. There we go. So a couple of issues there one I Need to import NumPy as in P so that I could call it here in P when I wanted to get the unique energy bounds and Then I had spectrum instead of flux spectrum here for the tally mean But once we got those two things corrected now, we can see our flux spectrum And we as we talked about Or do you want to introduce the model? It's a fast reactor. So we do expect this spectrum to look a little bit harder Or faster on the energy regime any questions on all of that Extracting information and doing normalization What is the unit of flux unit of flux? Yes. So we're gonna talk about that a little bit as well So this gets back into kind of our normalization and to Lot the flux with physical units. So looking at neutrons per centimeter squared per second as our flux We need to do a normalization for the total neutron source Which is going to determine or it is going to depend on the power So again a really well-timed question to segue into our tally normalization section But I think so before we dive into normalization We're gonna go ahead and break but before we do that. Are there any thoughts or questions? Yeah, you do a text file Yeah, so that is one thing that is relatively easy to do with the format that comes out of open MC So looking at the fucks the flux spectrum And what it is it's an array. So here we see You know most of our values are in the higher energy levels And this is a numpy array Which gives you the ability to use some of the features So we can save these to a text file So we can say let's see the file name so we could say our this is our fast box box spectrum not T TXC got a 3d array instead, so we'll flatten that the same thing is before this Function of numpy that we're using here that says save text We're gonna save this to a text file and it just doesn't like the fact that we were providing an array that had more than one dimension So we'll flatten it out give it another go And now if we look at the new file those created we can see all these values in a text file So this is kind of one of the advantages of working in like Python We have all these capabilities in place that we can build on and leverage Their follow-up. That's yeah, that's correct We could definitely we could add in the energy values and print them out pretty easily as well And then if we look at our tally's dot out file is this yeah, the flux is not in here But yeah, we could definitely write out the energy The energy widths and bins when we do that too any questions in the chat you Know any other questions in the room? Oh, yeah one of the back tutorials Locate what I'm sorry Maybe I miss for the tally Places we take to these values from the one cells or is there any Place specification for the tally taken taking to tally values So the is the question how do we get tally values for for cells and for materials and things like that Yeah, so similar to the tally Or is the energy filter that we applied to this tally You can apply cell filters or material material filters and then specify what cells go with those filters So that will give you results that only apply to a certain material or only apply to a certain cell region I see yeah, there are mesh tallies and Yeah, so the question was kind of we can do cell and material tallies. What about things like mesh tallies? Yeah, we have like a superimposed location in the geometry. So in open MC You can do mesh tallies as well. We have some examples of those in the notebooks repo that I sent out So you can you can do mesh tallies with a regular mesh or cylindrical or spherical meshes And then unstructured mesh also if you want to do like tetrahedral mesh, right? Yeah, that only applies to the tallies not for the geometry, right? There's a one more question like Yeah, how can we get a more continuous flux spectrum instead of the discretize when you just showed like By choosing the more energy groups or yeah, I think that's the best answer is there's so for the flux spectrum You can get integrate you can get values from Neutronics codes or from Monte Carlo codes that are integrated over the with continuous energy, but to view the Continuous flux You kind of you have to discretize it a little bit To be able to see it so you could do more energy groups to get something that's more continuous would certainly be one way there are also other More complex tally types where you could get a continuous flux, but it's It's not terribly straightforward. So I think my best answer would be like you once said to use more energy groups If you wanted a more continuous flux representation questions in the chat Okay. Well, yeah, I think we're we're a little early for the coffee break But let's go ahead and and do that and then we'll resume at like 315 320 something like that So 15 20 minutes here and we'll come back. Thank you all