Particle balance constraint updated - #4395
Conversation
j-a-foster
left a comment
There was a problem hiding this comment.
Just a couple of notes, otherwise happy with the changes.
| f"Plasma power: {mfile.get('p_plasma_alpha_mw', scan=scan):.4f} MW\n" | ||
| f"Beam power: {mfile.get('p_beam_alpha_mw', scan=scan):.4f} MW\n\n" | ||
| f"Rate density total: {mfile.get('fusden_alpha_total', scan=scan):.4e} particles/m$^3$/sec\n" | ||
| f"Rate density, plasma: {mfile.get('fusden_plasma_alpha', scan=scan):.4e} particles/m$^3$/sec\n\n" |
There was a problem hiding this comment.
Why are these /sec and not /s?
| linewidths=2, | ||
| ) | ||
|
|
||
| # Plot star for mfile values |
There was a problem hiding this comment.
Is it worth adding a note or legend that explains what the star means in the PDF?
jonmaddock
left a comment
There was a problem hiding this comment.
- Please sort out the PR description: I think it's too verbose and misses/buries the key point which is that you're introducing constraints to enforce density equilibrium of individual ion species. Why are you making this PR?
- Have you removed the original
molflow_plasma_fuelling_requiredas an output? I might have missed that - I counted 6 new optimisation parameters and 5 new constraints: as per our conversation, can you describe how this might work in solution mode, i.e. when we require a determined system?
- Some plots to demonstrate these changes would be useful: for example how the constraints are accommodated with increasing te or ne, for example. How does this change the current large tokamak solution?
- Please don't rebase until the PR is approved, so we can track comments
- How does this compare to the existing burnup calculation? Has it been removed?
- The created docs were excellent
- I'd like this PR to include what equations and parameters should be included in optimisation and solution scenarios. If the solution system is under-determined, how useful is it?
- I'm not sure about the fuelling composition constraint and total fuelling rate. Would individual species rates reduce the dimensionality?
- Should the recycling fraction and fuelling efficiency be optimisation parameters? (I realise we've discussed this, but I think it should be made clear why these can be used to solve the constraints).
Thanks for the fixed-up commits, this was much easier to review.
|
|
||
| Notes | ||
| ----- | ||
| The fusion rate is multiplied by two to convert from nucleus pairs to particles, |
There was a problem hiding this comment.
Not multiplied by 2 here.
| * data.physics.vol_plasma | ||
| * data.physics.f_plasma_fuel_helium3 | ||
| ) / ( | ||
| data.physics.t_energy_confinement |
There was a problem hiding this comment.
Does He3 follow the energy confinement time rather than the tau_alpha / tau_E = 5 relation?
There was a problem hiding this comment.
This is a point we should discuss, I dont see why we wouldn't treat it the same as 4He
| f_{\text{fuelling,D}} + f_{\text{fuelling,T}} + f_{\text{fuelling,3He}} = 1.0 | ||
| $$ | ||
|
|
||
| **It is recommended to have this constraint on as it is a plasma consistency model** |
There was a problem hiding this comment.
I think you need to be more explicit about the system of equations (i.e. all of the above constraints) and the solution parameters (i.e. optimisation parameters) used to solve them. What's should the user do to enforce all of these constraints in their optimisation problem?
|
@timothy-nunn If I try and use the functions in |
5c17efc to
8becc55
Compare
grmtrkngtn
left a comment
There was a problem hiding this comment.
I have a few questions about how this will handle a beam-fusion reactor, as this introduces some additional complications.
First, the thermal fuel mix is no longer necessarily 50/50, and the beam introduces both an additional fuel source and an additional fusion sink. I have left some comments in PlasmaFuelling on how the beam-target contribution could be accounted for in the species balances.
My understanding is that the existing PROCESS composition logic starts from electron density, calculates the total fuel-ion density, and then derives the individual D, T and He3 densities from the prescribed fuel fractions. If that is still the case, the composition routine may overwrite or constrain the same species densities that these new particle-balance constraints are intended to solve.
Have you also updated the density closure so that the absolute D and T densities can vary independently, with electron density and the fuel fractions then derived from charge neutrality? Otherwise, I am not sure that the D and T balances can act as independent solution constraints.
| ) | ||
|
|
||
| @staticmethod | ||
| def calculate_deuterium_burnup_fraction( |
There was a problem hiding this comment.
There's an issue for beam target fusion tokamaks here, like VNS.
In a D beam case, the reaction is D_beam + T_thermal. Therefore thermal tritium is consumed but not thermal deuterium.
In this case, we cannot use the total DT rate, as it would overestimate D_thermal consumption, and therefore the required D fuelling.
Could we separate thermal DT from beam-target DT and create a beam-target sink according to the beam isotope fraction?
thermal_d_dt_consumption = (fusrat_dt_thermal + f_beam_tritium * fusrat_dt_beam)
Something like the above.
There was a problem hiding this comment.
This will require a bit more work and most likely other constraints for the rate of fast D and T thermalisation. A bit like what will be added for the fast alphas. At the moment the total amount of D and T assumptions is just measured
| return 2 * fusrat_total / molflow_plasma_fuelling_vv_injected | ||
|
|
||
| @staticmethod | ||
| def calculate_tritium_burnup_fraction( |
There was a problem hiding this comment.
Also here we need to make a modification for the beam-fusion/VNS case.
For a D beam, both thermal–thermal DT and beam-target DT consume thermal tritium. For a T beam, the beam-target reaction consumes thermal deuterium instead.
There was a problem hiding this comment.
Have added the fuelling components for the tritium beam
| * eta_plasma_fuelling | ||
| * molflow_plasma_fuelling_vv_injected | ||
| ) | ||
| + fusrat_plasma_dhe3 |
There was a problem hiding this comment.
Should this be a subtraction and not an addition? We're fuelling with He3 and consuming with fusion.
742f08b to
0d319b3
Compare
| ) | ||
|
|
||
| # Deuterium and tritium ion densities | ||
| nd_plasma_deuterium = nd_plasma_fuel_ions_vol_avg * f_deuterium_plasma |
There was a problem hiding this comment.
Should we add these to output? Might be useful/interesting.
There was a problem hiding this comment.
We do have nd_plasma_fuel_ions_vol_avg which is the total fuel ion mix but not the individual species. May put a PR up to add this in a extra
…ng to be used to solve the fuelling and burnup equations
…riton, needed to know the indvidual fuel production and removal rates
…ude the equations for main fuel species flow and thermal alpha flow
…PlasmaFuelling model
…Physics class run workflow
…euterium, helium-3, and alpha particles
… for the burnup and fuelling rate now being calculated implicitly
…to previous functions and tests
…ass. Add details for some fusion reactions also
…ay in summary file
…itium source and loss rates. Implement these new methods in the constraints
Co-authored-by: Graeme Turkington <107113942+grmtrkngtn@users.noreply.github.com>
Co-authored-by: Graeme Turkington <107113942+grmtrkngtn@users.noreply.github.com>
…uterium source and loss rates
…g class; update constraints and flow rate calculations accordingly.
… update related constraints and documentation accordingly.
… thermal alpha particle source and loss rates; update related calculations in constraints and plotting functions.
…uelling and update related constraints and plotting functions
…e consistent notation for time derivatives.
… equilibrium solution models
0d319b3 to
2f8db51
Compare
This pull request introduces a comprehensive plasma fuelling model to the codebase, including new physical variables, input parameters, constraints, and documentation. The main focus is to enable detailed particle balance and burnup fraction calculations for deuterium, tritium, and helium-3 in the plasma, and to ensure consistency through new constraint equations. Several new variables and iteration parameters are added to support these models, and the documentation is expanded to explain the physical basis and equations.
Key changes:
1. Plasma fuelling and particle balance model:
plasma_fuelling.md). This includes explanations of fuelling efficiency, recycling, and burnup fractions.PhysicsDatafor burnup fractions and detailed fusion reaction rates, enabling more granular tracking of fuel species and reactions.2. New input and iteration variables:
input.pyfor fuelling efficiency, injected fuel rates, and fuelling fractions for each species.3. Particle balance and consistency constraints:
constraints.pyto enforce particle balance for tritium, deuterium, helium-3, alpha particles, and to ensure fuelling fractions sum to unity. These constraints help maintain physical consistency in the plasma model.4. Documentation and navigation updates:
mkdocs.yml, making the new model easily accessible in the documentation site.5. Miscellaneous improvements:
scan.py.These changes collectively provide a robust framework for modeling plasma fuelling, tracking individual fuel species, and ensuring physical consistency in fusion plasma simulations.
🎨 Output additions
Expanded and added more values for rates to the fusion reaction summary page:

Added a fuelling summary page that shows the contour graphs of the fuelling solutions, along with burnup data:
Checklist
I confirm that I have completed the following checks: