https://serpent.vtt.fi/mediawiki/api.php?action=feedcontributions&user=Bilodid&feedformat=atomSerpent Wiki - User contributions [en]2022-08-11T04:41:36ZUser contributionsMediaWiki 1.25.3https://serpent.vtt.fi/mediawiki/index.php?title=Coupled_multi-physics_calculations&diff=2494Coupled multi-physics calculations2016-05-12T11:47:20Z<p>Bilodid: small correction in the iteration procedure</p>
<hr />
<div>Serpent 2 has been written with multi-physics applications in mind. The capability to model arbitrarily detailed density and temperature distributions means that most temperature and density distributions given by e.g. thermal hydraulics or CFD solvers can be brought into Serpent using one of the [[multi-physics interface]] file formats without loss of detail. There are dedicated routines for controlling the iteration between the neutronics solver (Serpent) and the solver(s) for the coupled fields in order to obtain the converged coupled solution. <br />
<br />
== Multi-physics interface ==<br />
<br />
The universal multi-physics interface can be used to easily bring in temperature and density solutions from any external solvers. With the multi-physics interface, the solution fields (temperature/density) can be overlaid on top of the base geometry model without having to make additional modifications (such as defining multiple materials with different temperatures) to the input.<br />
<br />
See the detailed description: [[multi-physics interface]].<br />
<br />
== External coupling ==<br />
[[File:External_coupling.png|thumb|350px|Solution flow in the externally coupled calculation mode used for multi-physics calculations.]]<br />
Serpent 2 has been designed to externally couple to a wide range of external solvers using the [[Multi-physics interface|universal multi-physics interface]].<br />
<br />
The external coupling is based on the sequential exchange of [[Multi-physics interface|input and output files]] between Serpent and the external solver.<br />
<br />
To avoid restarting Serpent after each neutron transport solution (and thus having to do all the pre-processing again) Serpent has a separate coupled calculation mode, where Serpent communicates with an external code to control the solution flow. In the coupled calculation mode, Serpent will go to sleep after each neutronics solution to wait for the updated interface files. The detailed solution flow is described in the following chapters.<br />
<br />
The coupled calculation mode is enabled by defining a communication mode in the Serpent input. The currently available communication modes are <br />
<br />
*File based communication ([[Input syntax manual#set comfile|set comfile]]) <br />
*POSIX-signal based communication ([[Input syntax manual#set ppid|set ppid]])<br />
<br />
In the coupled calculation mode Serpent will send a SIGUSR1 signal after each transport solution has been completed and the interface output files have been updated. After this Serpent will go to sleep and wait for a signal from the external program to wake it up.<br />
<br />
After Serpent receives a signal (SIGUSR1 or SIGUSR2) Serpent will read the updated interface files and continue based on the received signal. SIGUSR1 means that the current state point should be iterated again (if the maximum number of iterations hasn't been reached) while SIGUSR2 tells Serpent to move to the next state point (burn up step / time interval). SIGUSR2 can thus be used if the convergence of the solution is calculated by the external code during the simulation. If SIGUSR1 was received and the next iteration would exceed the maximum number of iterations, Serpent will send a SIGUSR2 and wait for updated interfaces for the next state point after which, the first neutron transport solution of the next state point is obtained.<br />
<br />
After Serpent has simulated all of the specified iterations for all of the specified state points, Serpent will send a SIGTERM to the coupled code before finalizing its own simulation and exiting.<br />
<br />
The solution flow for one depletion step using constant extrapolation/forward euler (no corrector) with [[Input syntax manual#set ccmaxiter|<tt>set ccmaxiter 2</tt>]]:<br />
<br />
*Neutron transport solution (STEP 1, ITER 1)<br />
*SIGUSR1 (sss->ext)<br />
**External solution (STEP 1, ITER 1)<br />
**SIGUSR1 (ext->sss)<br />
*Neutron transport solution (STEP 1, ITER 2)<br />
*SIGUSR1 (sss->ext)<br />
**External solution (STEP 1, ITER 2)<br />
**SIGUSR1 (ext->sss)<br />
*Depletion solution (STEP 1 -> STEP 2)<br />
*SIGUSR2 (sss->ext) !Iteration of current step over!<br />
**External solution (STEP 2, ITER 0) !Initial fields for next step!<br />
**SIGUSR1 (ext->sss)<br />
*Neutron transport solution (STEP 2, ITER 1)<br />
*SIGUSR1 (sss->ext)<br />
**External solution (STEP 2, ITER 1)<br />
**SIGUSR1 (ext->sss)<br />
*Neutron transport solution (STEP 2, ITER 2)<br />
*SIGUSR1 (sss->ext)<br />
**External solution (STEP 2, ITER 2)<br />
**SIGUSR1 (ext->sss)<br />
*SIGTERM (sss->ext) !Simulation over!<br />
<br />
=== Examples ===<br />
* A very simple example is given on the [[Minimal Serpent Coupling Script]] page.<br />
<br />
== Internal solvers ==<br />
<br />
Serpent is able to internally couple to the [[FINIX fuel behavior module]] that can be licensed separately from VTT.<br />
<br />
== Iteration ==<br />
<br />
The coupled calculation routines in Serpent have been designed with the Picard-iteration style multi-physics calculations in mind (also referred to as tight coupling in some sources). In this iteration type, the separate solvers can be iterated subsequently for a certain state-point until a convergence is reached, after which the simulation will move to the next time point.<br />
<br />
The maximum number of iterations between the different solvers at each time point can be specified with the [[Input_syntax_manual#set_ccmaxiter|set ccmaxiter]] input-option.<br />
<br />
== Power relaxation ==<br />
<br />
Serpent relaxes the power distribution calculated in the iterations using the stochastic approximation based method<ref>Dufek, J. and Gudowski, W. "''Stochastic Approximation for Monte Carlo Calculation of Steady-State Conditions in Thermal Reactors''", Nucl. Sci. Eng, 152 (2006) 274-283</ref>, where the power distribution at iteration <math>n</math> is calculated by<br />
<br />
<math>P_{\mathrm{rel}}^{n} = P_{\mathrm{rel}}^{n-1} - \frac{s_{n}}{\sum_{i = 1}^{n} s_{n}} d \left(P_{\mathrm{rel}}^{n-1} - P^{n}\right),</math><br />
<br />
where <math>P^{n}</math> is the unrelaxed power distribution tallied on iteration <math>n</math>, <math>P_{\mathrm{rel}}^{n-1}</math> is the relaxed power distribution after the previous iteration, <math>s_{i}</math> is the active neutron population simulated on iteration <math>i</math> and <math>d</math> is an underrelaxation factor that can be defined by the [[Input syntax manual#set relfactor|set relfactor]] option.<br />
<br />
== Output ==<br />
<br />
Description of the output files of the multi-physics interfaces are described on the [[Multi-physics interface]] page.<br />
<br />
Description of the convergence criteria calculated and printed by Serpent.<br />
<br />
== References ==</div>Bilodid