 and we'll try the beginning first couple of one and a half hour we will I will try to give you an introduction to GenFoam theory practice the rest of the day we will try to do some hands-on see where we can get the very first part is about theory I will try to be short on that there are probably more slides than I can present but the idea is to then give you the slides this will give you keywords references things that can be useful for you in the future if you want to start using the tool so it's normal if I skip some slide the idea is to give you more material than I can present today this is something I already showed you and the main reason I'm showing it again is to say that GenFoam is not born from scratch it was born from the activities from PBMR from the activity on MSR in Europe from activities on sodium-fast reactors somehow lucky coincidence in 2014 four of us working on these different tools were on the same place in the same time and we decided to create GenFoam so it was born from the legacy of ten years of developments that were done in between 2000 and 2005 and 2015 it has been developed since 2014 mainly is with some EPFL PSI but we started having a lot of contributions from various institutions for instance their joint diffusion solver has been developed at UC Berkeley there has been work done in Cambridge pretty much what we do is that every time someone does a contribution we are knowledge it in the header file of the class that has been added so it's slowly transitioning from an institution-centric tool to a community-driven tool there are more and more contributions from the community we are thinking about changing a little bit the governance going in the direction of what open MC people do but it's a bit of a slow process it originally it was developed to complement legacy tools the very first reason we developed GenFoam 4 was sodium-fast reactors and the reason is that we needed to investigate I was working on that time in a fast reactor group at PSI and we needed to complement tools like parks with capabilities like for instance a simulation of the flowering of a sodium-fast reactor you can understand when you want to simulate that you have to have a structured mesh you have to be able to move your mesh these are capabilities that typically are not provided in legacy tools we also wanted to simulate things like assembly windows in sodium-fast reactors for the stabilization of boiling once again you have to have some specific capabilities so the idea was let's try to create something that is more flexible again if you go back ten years that was not obvious I mean ten years ago most of the work was done with tools that are legacy tools structured mesh is very restrictive in the way you can do things it's been distributed initially we kept it open source but you know distribution via mailing list then we just once we realized it was ready enough for a broader distribution we put it on github and now it's open you just can Google GenFoam github and you will find it status I consider it stable code now I would say we are in the alpha phase of distribution terms of verification validation is mostly verified validation is ongoing it will always be ongoing it's a never-ending process we have some reasonable documentation now we have a doxygen I will show you later what I mean for those of you who doesn't know who don't know what doxygen is it's a very flexible code you can model team from you know molten salt reactor experiment to flowering sodium-fast reactor to strange reactors like the Argonaut we have used it for standard light water reactors FHRs gas school fast reactors pretty much everything you can imagine we have used it for it was the original purpose known traditional reactor so you can do that as flexible code it also requires some commitment meaning it's not an easy tool it has a lot of options meaning you need some time to get used to those options and to understand the tool and in general when you speak about multi physics it is complicated by nature it means you have to understand thermal hydraulics neutronics in some cases thermal mechanics the coupling of the two and since this is based on a CFD tool you have to be relatively familiar with CFD if you want to be proficient with that you will have to know what is a wall function so you have to have some familiarity with CFD these are what we already presented to you on Monday I'm just you know giving it a gen from flavor so when you ever react or you typically have at least three different physics that you want to investigate and I'm simplifying because there is more than that but there is at least neutronics and the fluid dynamics thermal hydraulics of the coolant and there are the solid structures sometimes we forget about solid structure because they do not enter the safety analysis sometimes you cannot typically in fast reactors the deformations are very important because they are the main feedback for the activity for instance when you do neutronics you may want to a new tonic school and then solid you may want to have one measure multiple matches it's a choice it's not obvious there are advantages and disadvantages what we did for gen from is we want to have three different meshes in gen in open form language this is called multi region in open form usually speak about regions not meshes we have one mesh for neutronics one for fluids and one for solid and of course you have to have different fields and each field is solved on one specific mesh but something you have to be aware of is that when you have fields in one region that you're solving and you want to couple this region with the other one those same coupling fields will have to live on two different meshes for instance temperature you solve it in coolant but neutronic needs it for parametrization parametrization of cross sections right so if you have a field that is created in fluid that field will have to be projected into the neutronics because the neutronics need to know what's the temperature in order to correctly parametrize the cross section so in multi physics simulations is very normal if you see duplicated fields on different meshes and you have to be aware that that field is sold in one mesh and used in another one that is something that is important to keep in mind that is part of understanding a tool and it's important of course each mesh has its own equations neutronics you can have Newton transport diffusion you can have point kinetics in the coolant part you can have runs you can have alias you can have porous medium solid structure you can have heat conduction continuous mechanics in gen form what we have is that for neutronics you can choose between diffusion adjoin diffusion sp3 sn point kinetics we can do precursor transport this is something that we will see today in the MSFR exercise when you have a liquid fuel reactor you have to solve for the precursors that move around they are not statically there for thermal mechanics for the moment we have just a very simple linear elasticity because the main purpose was to simulate flowering and you don't get into a plastic behavior in these reactors for thermal hydraulics we have quite a bit because we have one and two phase and we have both standard runs CFD and porous medium and you can combine the two actually you can combine the three you can have two phase one phase some components in porous medium some components CFD can do whatever you want for the two phase we have validation for sodium we are working on the validation for water of course it's always a preliminary validation and I want to do a commercial dedication that is a whole different story but we try to provide a tool that is good enough to do research and good enough to be taken by a company if they want to do a commercial dedication of it since you have three different meshes regions in GenFoam the source code the case folder the control digs they are different compared to a standard open foam case except for one that is CHT multi region in open form there is one solver that is actually multi region it has actually multiple meshes so the case folder looks a lot like CHT multi region so instead of you know we told you that we have zero constant system do you remember from Monday right in GenFoam you will have zero and within zero you will have neutral region fluid region thermo mechanical region then you have constant and within constant you will have fluid region neutral region thermo mechanical region so the whole thing is multiplied by three why because you need three sets of fields three meshes and three sets of numerical ways of solving things so for every mesh you will need a Phoebe scheme and a Phoebe solution right so it's multiplied by three but it's not that strange as I said CHT multi region has this structure but that means there's a lot of inputs you'll see typically you see these both in the source code where we divided things in eutronics thermo hydraulic thermo mechanic in the case folder in the control dict you will see new flags right do you want to solve for energy yes no for free mechanics yes no for Neutronics yes or no this is all open form style so you different options are at runtime you do not have to recompile your tool if you want to solve for only Neutronics you just have to decide before that simulation do I want to solve for Neutronics or couple Neutronics thermo hydraulics this kind of things don't need to recompile every time open form is a very clever runtime selection mechanism that allows you to do that something you may wonder why three different meshes what's the reasoning behind well the reasoning is that doing mesh to mesh projections is not that computation inexpensive and it gives you a lot of flexibility you may want to have different refinements you may figure out you may realize that in your case you need the final mesh for Neutronics than for thermo hydraulics or the opposite if you have one mesh you are forced to use the finest mesh for all the physics and you don't want that right because you're just wasting computational time probably what is even more important imagine you have a this is a very simplified 2d model of the FFTF sodium fast reactor it's a mixed pool loop type and you know you want to solve for thermo hydraulics you want to solve it for the pool and for the pipes and for the at least part of the secondary circuit it was going to be a big mesh and does it make sense to solve Neutronics here probably not right so you may want to have a mesh for Neutronics that is in fact much much smaller than the mesh for thermo hydraulics so much more flexible a bit more complicated for the person who does the programming but we believe it was worth it how do we do the coupling operator splitting or segregated solver you will hear different ways of saying the same thing it means we solve one equation at a time and we solve through iteration does it mean it's not implicit or it's not tightly coupled no it is tightly coupled it's just you need to iterate depending on how much you iterate you can get more or less accuracy I tend to say that gen form is same I implicit and there is one reason for that it's a bit of a technicality but the CFD part for the CFD part we stand we follow a standard approach we follow what is called the pimple loop Stefano mentioned that I will not explain here I don't have time for that to explain what the pimple loop I think charge you pity can give a good answer but in general when we solve historically when we solve CFD we don't do fully implicit the reason is that people have found out that operator splitting is better and that you normally do not need to iterate at every iteration to get full convergence usually you iterate two three times four five so you get to a semi implicit solution and it's not open form the same exact algorithm is in open form in ANSYS in star CCM a solution for CFD is normally semi implicit and so that part of gen form is semi implicit the rest the neutronics thermal mechanics you can iterate it as much as you want and make it implicit that's what I just said it was just a snippet of the code in case you are curious to look at it but this is something I'll let you look at later if you want now if you look at the case folder as I said before you will have for instance in system you will have fluid region neutral region thermo mechanical region so in every region you will have a phv solution that phv solution will govern that specific physics you will also have a phv solution on the upper level just in the system folder why well because it's a multi physics thing and you have to decide things that pertains all the physics so things like do you want a tightly coupled solution yes or no that is not a flag that can be put inside fluid region neutral region or thermo mechanical region this is a choice of the overall simulation so within the case folder I'll show you later you enter into system inside system you will also you will already have a phv solution and a phv scheme but then you will also have a neutral region and inside the neutral region you will have another phv solution and other phv schemes so you will have phv solution phv schemes for the single physics and one that is general for all the physics that is on top so if you find a lot of phv solution phv schemes think about the logic behind something about the thermo hydraulics because I tend to find out that people tend to be a bit confused about porous medium approach so I prefer to give you some explanation about it I mentioned it briefly last time but the basic idea is when you have a tool like openform or moose that is based on the idea of solving PDEs on a general mesh the very natural way of doing CFD or doing thermo hydraulics for nuclear reactors is porous medium the reason is that porous mediums are the same equations as I said last time as CFD with the addition of a couple of terms a porosity and subscale interaction given by pressure drops and heat transfer pretty much and the nice thing about porous medium is that you can treat this is again a sodium fast reactor you can treat you know things in a reactor and in a heat exchanger using a porous medium approach and you can easily transition to standard CFD in the pools if you go back ten years this was not obvious if you go back ten years you look at the research that was done ten years ago people were trying to couple system codes or sub channel codes in the code with commercial or free CFD tool with external interfaces there was a lot of problem of numerical stability of numerical diffusion being able to transition within the same mesh from porous medium like or sub channel like solution to pool CFD solution and something that is very convenient if you want to simulate things like a sodium fast reactor if you want to simulate things like in a LWR boron injection from the primary from the cold leg and the nice thing about porous medium is that again you can turn it into a semi system tool like approach where you use correlations for pressure drops and heat transfer instead of solving for CFD porous medium is born to give you some a little bit of a theory behind when to get porous medium what you do is you start from standard conservation equations knowledge talks equations for momentum energy and mass you take your heterogeneous geometry imagine pins and channels you create control volumes you do a volume average that smears your structure so you end up with a mesh where your structure has disappeared and you can imagine that if the structure disappeared you need to have in your equations new terms that describe that structure because it's not there anymore but physical it is there right so you have to have something that describes it and the two things that describes it is the porosity and once again a term that described the interaction so if you do this volume averaging on the momentum equation you will have a porosity somewhere in your equation and you will have a source that is a momentum sink actually that described the fact that your fluid is losing momentum due to interaction with the structure and you imagine how you model that pressure drops with correlations the same as we do in trace the same as we do for sub channel codes you need correlations these are the sets of the three equations right so we have mass momentum energy and each time you will end up with an additional porosity and with an additional momentum sorry an additional source a momentum source and energy source or a mass source mass source most of the time doesn't make sense because you don't lose muscle in your structure to the fluid unless you're modeling chemistry but these are very general equations you may imagine that you have you know the solid phase is one phase you may have solid phase liquid phase and another liquid phase that is called two phase flow right so if you're all of a sudden have two phases you will also need a mass transfer between phases on these are very general equations that you can apply to porous medium single phase flow to phase flow multi-phase flow if you want again if we simplify the thing so these were very general equation for any number of phases if you stick to single phase these are the equations that you will see and if you look at them this is standard navier stocks with the addition of a porosity and moment source terms one that describes the momentum exchange between the sub scale structure and the fluid and one that describes the energy exchange between the sub scale structure and the fluid how do you model this you can do the old derivation I will not do it here you can prove that you can use standard pressure drops correlation to model the pressure drops in the momentum equations and that you can use standard noose and number correlations to model the energy exchange between your fluid and your structure structure imagine the pins in the reactor imagine the fuel how do you take trace or take a system code how do you model the transfer between the pins and the fluid use correlations the two's belter for instance right or remeasure doing fast reactors same exact thing you know in gen form if you want to do porous medium you will need correlation for pressure drops correlation for no cell number a little bit of a difference in gen form you can do 3d because it's a 3d solver so in principle if you want you can give 3 different set three different sets of correlations for the three different directions does that make sense well in principle yes because pressure drop a long bundle is not the same as a pressure drop across a bundle right you may have to have different correlations which is something typically was not possible in system tools which is one of the reason why we develop things like gen form because sometimes we need to model things that are not so standard and you may want to have a different correlations into different direction of the fluid that makes sense to you or less yeah so typically when you get into gen form you look at the various dictionaries same logic as open formula dictionaries where you throw in physical properties and correlations when you look at fluid you will find one dictionary that is very long it's the most the more complex you will find in gen form it's called face properties it includes all the properties of the porous medium simulation it will have things like regime maps it will have things like drug models it will have things like heat transfer models and the reason is what I just explained to you is that you need to simulate pressure drops of your fluid and heat transfer of your fluid for instance with fuel we will not look today at regime maps because of the time we have but if you are familiar with system codes you know that you can have different correlations depending on where you are the easiest is single phase you can be laminar you can be turbulent if you're laminar you will have a set of correlations for heat transfer and pressure drops if you're turbulent you will have another one typically no cell number for laminar flow constant around four three point something if I remember correctly no cell number for turbulent flow or I made it to spelter those kind of correlations and you can give it you can either use correlations that we created and you can just call them at runtime or if you realize I'm missing a correlation we have possibility to give a correlation as a simple a multiplied to the Reynolds to sum to an exponent print to an exponent plus a constant and you can decide all the exponents or you can learn how to program in open form and create your own correlations creating correlations very easy it's one file you copy paste and you will have you change the thing and you will have in runtime selectable new model for GenFoam this is the magic of object oriented programming it can be very easy to extend the code something you should be aware of you know we are focusing a lot on the fluid and the question is what happens to the structure because the poor structure we smeared it out and it's not there anymore but we may want to have it right if we are doing an Lwr we may want to have a decent solution of your temperature filled inside the pin but we don't have a pin anymore how do you do that you create a subscale model you say okay for each cell I assume that one pin is there and I calculate the temperature in the pin knowing what the temperature of the coolant the heat transfer coefficient between the coolant and the pin and the power the power will come some from somewhere you can impose it or it will come from neutronics but once you have that information you can solve for the temperature filled inside your pin it can be a electrically heated pin it can be a nuclear pin it can be a plate it can be whatever you want we have a certain number of subscale structure that we have prepared in GenFoam or you can create your own as usual this is the good thing about openform you can customize we have two type of structures in GenFoam if you want to understand the reason think about fast reactors fast reactors you have your coolant you have your fuel and you have wrappers around your assemblies right the fuel is a structure it's an active structure we call it a power model but we also have the wrapper that is simply a passive structure that is heated or cool it or cooled based on the coolant it's actually following the coolant with some delay it creates a energy sink if you want or an inertia in what happened in the core and it can be important to model it so we have the options on having a passive structure which can be your wrapper for instance or an active and or an active structure that can be for instance the fuel so you have this double option again if you need to have a sub-scale structure it means that somewhere in GenFoam you will find something to define a power model an active structure or a passive structure and here is an example this is the example it's actually an example for something we will do today you will find things like heat exchangers with a power model that is a fixed temperature or you will find more complicated things like power model that is of type nuclear fuel pin and if you need to have a nuclear fuel pin you need to define inner radius outer radius cladding material H gap conductance everything that you need to simulate a pin and here you start realizing the complexity of multi physics it's a lot of parameters but we cannot give these parameters as default this is something the user has to define so if you you know start using a tool like this and you realize it's very complicated while you have to understand that the physics behind is complicated it's a lot of things that happen in a reactor something I mentioned before just for your you know some of you is curious about that I said porous I said it last time porous medium is a generalized version of subscale it's not me saying that it's written black and white on the Kazimi Todrius Kazimi book you can derive it the thing is you can when you do porous medium you can separate for instance your assembly into different regions and give different sets of correlations to the to each region if you start having different set of correlation to different regions and you start having a mesh that follows the same structure as an assembly you end up exactly in the same situation as a sub-channel code so you can exactly replicate the results of sub-channel code it's a very tedious work if you want to do that but it's possible you just have to provide the same set of correlation to sub-channel code uses for the various regions these are just examples on how you can use this mixed porous medium sub-scale structure thing this is a poor pure course mesh you take an assembly you forget that you have pins inside you simulate it with 24 triangles and then you use a sub-scale structure or two one active one passive one that simulates your fuel one that simulates your clad your wrapper not pretty much done or if you want to simulate an entire primary circuit you can try to do something a bit more complex you can mix the two things you can say okay inside the core I want to have my fuel and I want to have my correlations for pressure drops and it transfer then I go into the pools and all of a sudden I have no structure anymore automatically GenFoam will revert back to standard CFD we don't need to tell GenFoam as soon as GenFoam sees porosity 0 or sorry porosity 1 it goes back to standard runs CFD simulation so you can set up these and just say okay I set up my mesh I in the face properties I give positive different than one I give some pressure drops correlation some models for the fuel in the core in the heat exchanger in the pumps and you will automatically have a porous medium simulation for those components and the runs CFD simulation for the rest you can also do fancy things like having a secondary circuit with heat exchanger model as a bit of an advanced capability that we are actually now abandoning because we found a smarter way to simulate the secondary circuit using modelica but this is for another time we have to face flow just for your curiosity will not touch to face flow this is a mess it's complicated it's very difficult to converge just for you to know if you need to do to face flow for sodium is there for water is almost there we need to add last few things make sure that everything works for Neutronics I already mentioned we have a certain number of tools diffusion joint fusion and so on this is just for you for your curiosity you know what it means to do well it's actually more than curiosity because we will use it later today what it means to do pre-car source in liquid fuel when you do pre-car source equations in a standard reactor you have a derivative over time you have production transition and you have decay when you have a liquid fuel reactor you have to add a divergent and a laplation you have to add a convective term because this precursor are convicted by your velocity and you need a laplation because this precursor can diffuse because they are in a liquid they can diffuse and the diffusion is non-negligible especially for any turbulent flow part about diffusion can change their activity of your reactor quite significantly so this is a question I usually get is diffusion worth modeling for pre-car CITs it can be important a bit too much you know once again this is like you can use when today we want to use chain form if ever to understand how to set dimensionality boundary condition which boundary conditions are available as usually in open form remember your mesh is always three-dimensional you want to do 1D or 2D you have to use specific boundary conditions like empty boundary condition or wedge boundary conditions for axis symmetric of course if you want to solve for Neutronics you will have to decide that you want to solve for Neutronics how do you do that you can imagine there is something in the control dict because there is always something in the control dict and what's you can what's in the control dict is there essentially a flag two flags one is not here one that will tell you do I need to solve for Neutronics true false you look at the control you'll see it and another one that is gonna tell you is this a liquid fuel reactor or not why is it in the control dict and not specific to Neutronics well because the fact that you have a liquid fuel reactor affects everything it's not just about moving precursors around it also goes into how do I generate power in fluids because if you have a solid fuel reactor your power will go to the pin that will go to the coolant if you have liquid fuel reactor you have a shortcut your power goes directly into the fluid so you have to have an option that is a global option that says okay this reactor is liquid fuel you will find it in the dictionary then control dict and then you will have within Neutronics you will have a dictionary called Neutronics properties where you can choose things if you want to solve for diffusion SN SP 3 point kinetics that's where you define this is very open-form logic in open-form imagine you're doing standard the pimple form and you want to decide whether you want to do us run cell yes where do you find it inside constant inside the dictionary that is called thermo physical properties for Neutronics in GenFoam you will find it in constant neutral region Neutronics properties it's all according to the open-form logic and in there you will find two options which model and here you can use the banana method so if you do not know how to sorry if you do not know how to call it write whatever you want in there write it wrong GenFoam will tell you I do not know the banana model for Neutronics what you can use is SN Neutronics diffusion Neutronics point kinetics and so on it will give you the options eigenvalue true or false eigenvalue those of you are not super familiar with Neutronics essentially means get it as a steady state means you're solving for a steady state solution for the Newton transport equation right it's a bit slightly more complicated than that but it's pretty much what we do in the end you set it to false it means you're assuming that your simulation is a transient simulation okay thermal mechanics I'll skip it because it's too much I wanted to give you some examples just to give you an idea of what you can do said before you can do two phase flow or in one channel in a core it's very computational expensive very painful to set up can do more fun things like flowering of a reactor can do discrete audience this is the discrete audience model of the Crocus reactor that we have in Switzerland they have is with another anymore you can do more than salt reactors and this is what we will do today because it's a fun reactor to study this is something we already covered last time same exact thing about how much computational power the units is almost exactly same slides as Monday so I will not go through it I will now go through another presentation it is about gen-forming practice while I transition do we have questions step to one share and share again yeah so they're asking me the difference between eigenvalue and transient an eigenvalue solution in Neutronics is a solution where you essentially in simple terms you essentially try to adapt your k effective so that you get to a steady state may seem strange but you know the k effective is that in your diffusion equation the k effective you can put it at the denominator of your production term so essentially you adjust the production term till you get to a steady state meaning to get to a critical state it seems strange but right because you're saying I'm changing a k effective to get to k effective one but that's what we do we actually modify the k effective so that there is a balance right so essentially you're getting to a steady state you're forcing your reactor to be sorry to be in a critical state in an equilibrium state transients you say okay I have whatever k in that parameter I fix it I put a time derivative in the equation and I let it go so you go from an equation where you do not have a time derivative and where you iterate so that you have a certain power and a certain well you're essentially searching for your first taken vector to a case where you say I'm simply solving in time a diffusion equation that makes sense you don't think you don't have to think about when we do this kind of calculations and this is not just gen form is in general when we do transients analysis with deterministic tools we do not try to change our cross sections to be critical this would be a very complicated process right so what we do is that we use an equations where we have our own cross sections and we have the parameter which is the k effective and that parameter appears at the denominator of the production term it appears as a modifications to the new sigma f right so we are implicitly when we try to search for an eigenvalue it is as if we were modifying our fission cross section so that the equation is balanced so that production equal absorption plus leakage right this is kind of an intuitive way to explain what the k effective is mathematically speaking the k effective is an eigenvalue so you can see the mathematical way or the physical way yeah and so basically when you do eigenvalue just say okay now this is important because we will bump into it in the in the exercise later so you when you do eigenvalue imagine that you have your equation and you take away the time derivative and you start adjusting your k effective till production equal leakage plus absorption at that point you have a k which is actually the k effective that balance is your equation then if you want to do a transient from that point what you do is you keep the k that you had found because this is the k that is balancing your equation from to do a transient you want to start from a steady state because if you start from something that is unbalanced you are starting from essentially creating a reactivity step so basically you keep that k so that your equation is balanced and from there you can run a transence as if you were starting from a steady state and the transient while the trans is the simplest thing is just you have derivative over time of equal to laplation plus production and you're simply solving the time-dependent diffusion equation but the k part is tricky it's always confusing because also how we presented very often in some books is presented in a very mathematical way as an eigenvalue of an eigenvalue problem from physical perspective they tell you that k effective is a balance and then you look into how we use it in deterministic codes and it feels like we use it to trick the equations actually told it's all the same it's just three different ways of looking at the same thing that makes sense so when you have the neutron transport equation you can solve it according to several different approximations if you look at deterministic methods there are a number of them and what we have in gen form the SN discrete ordinate method is the highest accuracy that we have is a method where you distinguish between energy groups and angles diffusion is a method where you assume that the flux is isotropic you don't have difference in angles you're just assuming isotropic flux and it's the easiest method that we use so is alternative either diffusion or SN SN is kind of a technical name for discrete ordinance now now we just have a power iteration we just get the first harmonic it shouldn't be difficult to modify the core to the code to get the higher the other harmonics but it's not implemented now yeah this is a standard open form capability so you just have you know when you create an application in open form you inherit all the capabilities of open form which means for instance you can do a time-dependent fixed flux boundary condition you can use every capability that open form already has which is very powerful is one of the things you get out of using open form as a base library I also have a question yeah how do you model with this porous media approach I would say to simulate how do models via via rapid pins and can you obtain this secondary flows no so what we do is the same as yes and no I'm sorry no it was a wrong answer it's in between meaning well we model pressure drops using correlations right can you get the secondary flow I know that there are people that are trying to get that we cannot do that in general form because that implies you can create that secondary flow in principle because what you need to create is a momentum source in a specific direction and add it yeah you need to create an anisotropic it's very complicated it is feasible but it requires modifying a little bit the code I mean implementing an anisotropic momentum sink or source it's something you can do it's in the capabilities of open form in general it's not implemented in gen form I may assume it's not an obvious it's probably full PhD so not you cannot do it probably more I will just move forward because otherwise I will not get to the end of what I want to present to you I wanted to give you you know some introduction how to use the code again this is much longer than what I can present today and there is one reason is that I this is filled with references and keywords that can make your life much easier in the future if you want to approach gen form so it's so almost user manual almost so don't get frustrated if I don't present all those lines this is for your benefit something important about approaching gen form what you can do you can download it and start modeling nuclear reactor wrong always learn open form if you try to go straight to gen form you will enter trust me I've seen it in many cases you will enter an endless loop of frustration go step by step when you are comfortable with open form when you feel like I must have open form then you transition to gen form if you try gen form straight away it's a lot to take all of a sudden anyway if like nothing is working and then then you simply don't know that the problem was a CFD problem and then you think that it might be neotronics or the fluid or the structures and there's so many parameters that becomes very difficult to master it and to handle it and it can be very daunting so my suggestion is always try to go step by step start from understanding CFD start from understanding open form once you are there go to gen form unless you have a problem that is very similar to a tutorial in that case you can skip some of the steps but the basic suggestion is try to go step by step in the end it will feel like slow in the end you will spare a lot of time this is something we already presented and I keep it there so that it's easy for you in the future for your reference learn open form you can use the user guide tutorial guide there is a wiki there is this very nice three week series tutorial there is the source code guide there are lectures on YouTube this one is a very very good lecture from Yazakh which I believe I wrote wrong there is an extra C in there but this is like in one hour one and a half hour gives you a very nice introduction to finite volumes again this presentation for wolf dynamics are very very well done again I really beat it we already said it with open form there is always a way out you may feel it's not working it does work it's just you will need to find the way to do it that's the nice thing of open source and of open source when it's nicely written you will understand the source code you will understand where the problem is don't get discouraged entry barrier may seem steep because the CFD there is Linux if you're not familiar with Linux there is using machine tools post processing tools all of a sudden it's a lot to take that you will learn a lot of skills that are very transferable to anything else if you learn how to use open form it's gonna be super easy to use star CCM it's gonna be super easy to use parks it's gonna be super easy to use pretty much anything else and the nice thing is that you will have access to the source code and you will be able to understand which equations are solved it's not gonna be a black box this is for learning purposes this is probably the best thing you can do open form or any other open source tool it's not an advertisement to open for me advertisement to open source in general some additional background compared to just knowing open form I mentioned before we use three different matches this means that we as I said before you're gonna have three different sets of folders in zero in constant in system it's something you have to always keep in mind so in a case folder instead of having case zero fields constants dictionary system dictionaries you will have zero neutral region with his own fields fluid region with some fields thermo mechanical region fields and inside constants you will have neutral region with its own dictionaries fluid region with some diction is is a lot a lot of dictionaries welcome to multi physics second little piece of information that I think you asked me it was about multi material of course if you do nuclear reactors you need that why imagine you're doing neutronics and you have a core and a reflector well you need two different sets of cross sections for your core and for the reflector so you need this kind of multi material capabilities which is available in open form not often used in the standard open form applications so if you become very familiar with open form and then you start using gen form and you may get into the situation what are cell zones and materials and this is the reason why I added this slide so in principle in open form you are allowed to add what we call cell zones in every mesh generation tool as is its own name for this thing sometimes they call physical volumes I think Salome called it physical volumes g mesh probably calls it materials I'm not sure and I'm sure answers and star system they have names for creating different materials but the underlying thing and if you could open you know the mesh format of answers you will see the basic idea you simply for every cell you add a label you just say okay for this cell it's not just a number of faces and points that define the cell it's also a name that can be fuel can be cladding can be reflector can be graphite can be anything it's just a name and cell zone in general in open form are just a way to give a name to a set of cells and this is the same approach that you will find in any mesh yeah it's called cells on sometimes called materials sometimes it's called something else it's always the same thing now you imagine you have a mesh and imagine you have a mesh where you have a core and a reflector and you call them literally core and reflector and then you may wonder how do I assign different cross sections to the different materials how do I say which cross section to the core and with which cross sections to the reflector you can imagine that you will have a dictionary somewhere that associate a certain set of cross sections to the name core or to the cells on core and other cross sections to the cells on reflector this is the same approach that you will find in any multi-material solver in open form this is not a gen form thing you will find the same thing in alphabet you will likely find the same thing in containment form if they have different materials you will find the same thing now in open form because now they have introduced a multi zone thermo physical properties so it's always the same logic so you will find for instance in open form in gen form within constant within neutron region you will find a nuclear data file and the nuclear data file you will have zones that are divided for instance into control rods core reflector and for each zone you give a different set of cross sections think about the logic there's no other way right you create gave a name to cells and now you have to say to the solver look to that name I want to associate a certain set of cross sections or a certain conductivity if you're doing it conduction or a certain set of thermo mechanical properties if you're doing thermo mechanics you need to be able to associate different properties to different cell zones how does that work as I said all mesh generators allows for the option to generate cell zones they're called different ways so yeah here I write they're called physical volumes in g-mesh and they are called groups in salon and I have no idea how they are called in other tools but they guess every tool has its own name but then when you do the mesh conversion so you do mesh to foam magically you will have a mesh with cell zones most of the time depending on which tool you're using for the conversion but open form comes with a set of routines for converting matches to open form format if you look into the case folder you saw last time the mesh is inside a folder that's called poly mesh you open poly mesh and you have created cells on you will see that there is another file that is called cell zones simple as that and that file I don't have it here unfortunately it's gonna look like this it's gonna be sorry I'm lost it's gonna be a file where you have for instance seven cells on the first one is called control road and control road includes cells number zero one two three etc. it's very simple file where for each name you associate the label of each cell very transparent that's a nice thing of open form if you are I've doubt you enter the poly mesh you look at things you see there is something called cell zones and if you have created seven cells on you will see a seven and seven group of cells with different names so always think it's an open source thing there is a way you can find out things are done how do you get it you go on Google search for GenFoam GitLab you will find it how do you download it well GitLab allows you the possibility to download at the repository as a zip file it's not forbidden you can do that you can download it that way if I have to suggest to you an approach start using Git it is a versioning tool it may seems at the beginning of a PhD an additional step in so many things that you have to learn it's totally worth it it will allow you to have a very well ordered way of doing things because you can keep track of the versions of the tool if you modify it you can keep track of versions of case files if you're modifying it you can do a day-by-day thing or a milestone by milestone thing and you will have the history of everything you have done and well GitLab is based on Git and if you clone you will get if you literally type on your terminal on Linux git clone and you add the address that GitLab will show you when you click on clone so you will have git clone and then something like HTTPS something something something this will clone it will duplicate this repository into your computer so it's extremely necessary you can download and use in a standard way Git takes half a day to learn or maybe one day to learn and it's extremely useful when you look into GenForm since it's Git based you have different version of it we call them branches there is a master branch that is the stable branch and there is a developed branch that is the most updated one so develop is what developer as develop we use to include new feature master is what we believe has been sufficiently tested to be considered a stable solution so if you need advanced capabilities you probably would need to get the develop branch if you want to be absolutely sure that there are no more or less sure that there are no mistakes in the code you get the master branch how to install you download the openform you already did it install openform you prepared environment you already did it right you remember that when you use openform even after installation most of the time you have to source your environment you have to source the environmental variables to use openform and then you either download or git clone GenForm how many of you have GenForm already downloaded anyone we will need to do that as soon as we can because it may take a while to install it we will what I suggest is that we try before the coffee break we try to download the thing and that we let it run during the coffee break because even the compilation of GenForm is easy it's a dot slash all w make it takes a while it's a big piece of code still have 15 minutes so like in five minutes we will start doing this installation thing so maybe you can start preparing your computer for that for visualization you know we use ParaView do you have ParaView on your computer now how many of you can you raise your hands okay there's gonna be enough ParaView for you in every group what's inside inside GenForm you will find documentation the source code documentation the source code some tools and a lot of tutorials documentation the most important one is the doxygen based documentation I'll show it to you if you go to the git lab repository and you look at the readme file there is a link to a doxygen generated documentation doxygen is an automatic system that is able to read code and provide you with well-ordered representation of that code including for object oriented things like dependencies of classes and things that you may need the day you will start modifying the code and this is what also openform people do in addition to that since we know that GenForm is a complicated tool we added calypherial documentation like introduction auto compile preprocessing running post-processing and a little bit of a user manual that includes Neutronics, Thermal etrolics, Thermal mechanics, coupling, time-stepping, a list of tutorials and tips and tricks it takes probably two hours to read this documentation if you want to use GenForm do that it's gonna be well spent time it's not a large documentation but it's gonna give you hints that will spare you so much time afterwards so it goes through the documentation is minimal it's worth it what we are doing now for every functionality that we have that is into a class we are starting to add a description for instance if you have a correlation in the header file you will find the description of the correlation where it comes from how to use it it's gonna take a while to do that but we have it for most of functionalities so inside there if you search for instance for albedo boundary condition you will get a link that will give you bring you to the page where you can look at the source code and you can look at the description of the thing and it can probably look at how to use it in GenForm so we are trying as many other people in the computational world we are trying to go into a close merging of code and documentation for multiple reasons one is that it's good that people that use the code under tend that there is programming behind and that can look at the source code if they need and find it in a very straightforward way it's also a way to make sure that documentation stays updated with code this is a very basic best practice that was developed within the on core initiative and that is well known outside the nuclear field is to try to always have a one-to-one between your code and your documentation I'll give you an example here imagine you want to use the rame correlation you start typing in the RAM and then you will see that the oxygen suggests you some answers you can click on the answers and you will get into a page that will explain to you things about this correlation where it come from was the reference and a link to the source code you can look at the source code these are the additional pages I mentioned imagine you click on thermal hydraulics you will end up in a page that explain to you what it is how to use it to the subsolvers you scroll down you will find for instance explicit explanation about the various dictionaries that you find in GenFoam for instance about turbulence properties and inside very often you will find links to the source code for instance you click on porous capsilon dot H it will bring you to a page where it tells you look this thing this is you know for developers it will tell you things okay these things is derived from runs model and from ad viscosity you will find the list of classes of functionalities of members of the class and you click on more and typically it will provide you an explanation it will tell you that is very similar to the standard open form but it's provided with an additional model it will tell you how to use it it will tell you that you will need to use these entries inside the turbulence properties dictionary so you will find how to use things so it's all linked together you click on something you end up in something that gives you the code gives you how to use it we're trying to go again in a direction where everything is integrated into the same environment this is just an example about source code when I say the source code tend to be quite transparent if you look into the code of the nusselt number correlation based on exponents and coefficients you will find that what we are calculating is literally something like a plus b power Reynolds to the c power pram to the d this is as transparent as it is imagine you want to take this thing and you want to add a dependency over another parameter you copy paste this thing you add your parameter you compile it and all of a sudden you will have a new runtime selectable correlation for your code so this is the power of open source and object oriented programming when you start being a user very quickly you become a developer and you can develop thing in a very simple way of course this is a correlation if you want to change the equations yes gonna be a bit more complicated if you want to change the linear solver is gonna be even more complicated but it's all very layered so it's easy to add the correlations a bit more difficult to add new equations a bit more difficult to change numerical schemes but you see the logic here like it's a class it's a class that is called nusselt it's a class that reads some constants from a dictionary and that use these constants and gives it gives it back to the equation it's fairly transparent and most of the time for things that are not obvious we includes comments into the code very often in the documentation you will also find links to the tutorials this is important imagine you don't know how to use this turbulence properties you know you can go into the source code this doxigen look at things understand how it works or sometimes I can tell you look there is a tutorial where we use it and you can run the tutorial understand how it works and you click on these you will find yourself inside the dictionary that we use in that tutorial where we explain things like you will find this dictionary you will find the porous capsicum properties for these regions and you will find every parameter that is explained you will find things like convergence length and it's you'll tell you get KNF style and will exponentially conversion equilibrium according to these exponent so you will find all the information you need they are a bit spread out welcome to open source but they are there again the documentation is designed to promote understanding of the source code and integration of code use in development because integration of fusing and developing is the way you will get the most out of any open form solver you can use it but the day you become a developer you will understand the power of this thing you can do everything you want you can add correlations do research you can use this tool to get to the state of the art and from there go beyond it with your research modifying the code this is something is very difficult to do with or almost impossible to do with closed source tools it's a black box you cannot changing you can do applicative research it's very difficult to do any development right open source is the only way you can do that we're not going to the source code this is something I leave it there I will distribute the slides after the course we'll not go through the tutorials because today we will essentially do a tutorial what I would like to do in the I still have five minutes right what I would like to do is to try to install download and install GenForm so I can try to do that together so let me stop share and share my screen you have to have open form and you have to have open form 2306 which is the one we asked you to install typically when you when I will show you so if you go on Google or whatever search engine you like and you search for GenForm heat lab you should find it it's under the phone for neutral project you click on it and you will find what I showed you before you have the repository all right now you have two way of doing things and I would suggest the clone way and I will show you now how to do it you go to clone and you copy paste the HTTPS link you just have to click here it's gonna be copy pasted to your computer your bullet are you all there okay I don't know how many of you are using Linux how many how many of you are using Linux directly and how many are using the Windows subsystem Mac one Mac so I will not able to help you because I don't know to use it and it's always a mess for me but we'll try to do it anyway I think it's pretty much you can open a terminal that is Linux like terminal right on Mac okay okay it's very random each time I do a workshop and there are people using Mac there is always one for which doesn't work I don't know why there is some dependency that misses okay okay maybe make sense I have zero experience with it so sorry about that I'm using WSL so I'm doing it the hard way if you're using WSL you can open a window maybe yeah and you can go anywhere you want actually you can stay on home if you want and you just do git clone and you copy paste what you got from the website git clone HTTPS column slash slash it this is you know you can copy paste it from git lab are you all there you do it oh it's because I already have it sorry let me do it somewhere else Mac dear test you do it again this time should work unless you already had it like in my case it was just telling me look you already have it it may take surprisingly long time I assume we have a slow connection to megabyte per second so gonna take a while is this thing working for everybody anything anyone that is having problem with this you let me know I'm not hesitate don't be shy yeah the connections surprisingly slow it's okay gives us time to see if everything is working in the meantime do you remember that when you use open form you have to source you know what it source means maybe not we will do it no worries let me open another folder another terminal okay my download is completed are you all done is any anyone still waiting for the download it's done okay so now if you want to compile gen form you have to keep in mind that gen form is an open form application which means you have to have open form installed and environmental variable of open form loaded how do you do that this is something that you find typically on open form manual installation instructions you essentially have to do something like this source then you have to give the path to a file that contains the environmental variable of open form typically what we do is that we throw this thing to the bash RC so that you can use it using an alias each time but you can simply call if you see let me make it let me see if I can make it bigger I just don't remember how I think I can oh it's very big do you see if you can type this thing I can send it to chat good idea where's the chat I don't see the chat I should be up there is just a time I control shift alt oh yeah I found it for some reason I cannot copy paste okay it's on the chat now are we there so once you have that you just enter the folder so cd gen form you look at what's inside and you realize again there is everything that I said before so well there is a copyright there is documentation the source code which I should start calling source there's the license there's a read me file tools and tutorials you get into the source code you use cd again into gen form okay so cd gen form and again cd gen form you look inside and there is the source code I can get a stephano can you take a look he has no such fire on the directory on the gen form you did the git clone I didn't clone I would like just to run the thing because it takes 10 minutes to compile it's really so once you are there the only thing that is missing once you are in the source you just type dot slash all W make if you want to make it quick you are the J option it just will do things in parallel taking all the course available on your machine now I do it and if it doesn't work I will be very sad it will take a while I think we can try to solve things later hopefully for most of you it will have worked is it compiling is it compiling okay so we can let it compile and we go for a coffee break okay let's take a coffee break start compilation and when we back it will be done download I did it from scratch and