-
Notifications
You must be signed in to change notification settings - Fork 28
🎨 Add blkt pipes output #4369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
chris-ashe
wants to merge
40
commits into
main
Choose a base branch
from
add_blkt_pipes_output
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
🎨 Add blkt pipes output #4369
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
095a1f4
Move elbow coeffieicnt calc from blanket to pumping
chris-ashe 3c6c1ec
Add coolant properties to BlanketData class
chris-ashe ea69715
Add coolant friction loss parameters and output functions for blanket…
chris-ashe dd1779a
Add function to plot blanket coolant channel structure and update mai…
chris-ashe f1dd90d
Refactor pressure drop assertions in blanket tests for clarity and co…
chris-ashe 1fd6bc0
Add function to plot outboard blanket coolant properties along the po…
chris-ashe 336d33e
Tidy some variable names to match style guide
chris-ashe 48e26e8
Create mass flow required function and implement
chris-ashe 78352ac
🔄 Rename FW and Blkt heat capacity variables
chris-ashe 244dc59
Add output for outboard blanket piping
chris-ashe 566a920
Add output table for outboard blanket
chris-ashe 1c1666f
Refactor coolant friction loss parameters and update related tests
chris-ashe 5f030f3
Enhance inboard blanket coolant channel output and pressure drop calc…
chris-ashe e32fffd
Move FW number of bends to FW file
chris-ashe 1f43d47
Remove pipe plotting
chris-ashe bba36de
Update summary positions of tables
chris-ashe 39bd360
Post rebase fixes
chris-ashe cb5f145
Remove unused CoolProp imports and related plotting functions for out…
chris-ashe 843e6da
Post merge coflict fixes
chris-ashe 95ca6b9
Move all of the pumping related function from `BlanketLibrary` into t…
chris-ashe 300ff55
Update some output formatting
chris-ashe a7e09c7
Fix some coolant pumping power function imports
chris-ashe 9e7f961
Refactor pumping outputs to be specifically for inboard and outboard …
chris-ashe caf239e
Add coolant mass flow rate output
chris-ashe c49eaa8
Refactor coolant pumping power types to use CALCULATE_PRESSURE_DROP a…
chris-ashe b66dfec
Rename mass flow rate variables for clarity in blanket model
chris-ashe b6dabed
Add coolant mass flow rate and velocity outputs for single channels i…
chris-ashe 4db51ce
Post rebase fixes
chris-ashe 4d245fc
Only output pumping variables if pressure drop is calculated
chris-ashe f490d43
Add pumping power calculation option output in first wall pumping det…
chris-ashe 095ba18
Update process/models/blankets/blanket_library.py
chris-ashe f060e26
Refactor blanket models to use pipe_hydraulic_diameter function and a…
chris-ashe ddedc01
Remove unnecessary @staticmethod decorators from calculate_reynolds_n…
chris-ashe 42a80d1
Update process/models/engineering/pumping.py
chris-ashe 7e8e0d6
Refactor pressure drop output formatting in plot_blanket_coolant_prop…
chris-ashe f11c93a
Calculate adiabatic index directly from CoolProp properties. and catc…
chris-ashe 8d193fc
Clarify explanation of specific heat capacity usage in pumping system…
chris-ashe 9096884
:bug: Fix haaland equation not using the full pipe hydraulic diameter
chris-ashe c63ddfa
Tidy some docstrings
chris-ashe 8eca27e
Refactor blanket coolant properties plotting to reduce code duplicati…
chris-ashe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,82 @@ | ||
| # Pumping Methods | ||
|
|
||
|
|
||
| ## Coolant mechanical pumping power | `coolant_pumping_power()` | ||
|
|
||
| To calculate the coolant pumping power we use the change in enthalpies of the coolant as it goes through the pump. | ||
| **We assume the pump is isentropic so the entropy change of the coolant is 0**. | ||
|
|
||
| The mechanical pumping power is defined as: | ||
|
|
||
| $$ | ||
| P = \frac{\frac{\dot{m} \times \left(H_{\text{out}}-H_{\text{in}}\right)}{\eta}}{\left(1-f_p\right)} | ||
| $$ | ||
|
|
||
| where $\dot{m}$ is the coolant mass flow rate, $H$ is the coolant enthalpy, $\eta$ is the isentropic efficiency of the pump and $\gamma$ is the adiabatic index of the coolant. | ||
|
|
||
| $f_p$ is a seocondary correction accounting for the fact that some of the pump's mechanical work reheats the coolant, and that reheat is already implicitly present in the prescribed $\left(T_{\text{pump,in}}-T_{\text{pump,out}}\right)$ used elsewhere in the plant energy balance, without this correction that portion of the pump work would be double counted. The term uses the classical isentropic ideal-gas relation $T_2/T_1 = (P_2/P_1)^{(\gamma-1)/\gamma}$ | ||
|
|
||
| $$ | ||
| f_p = \frac{T_{\text{pump,out}}\left(\frac{P_{\text{pump,out}}}{P_{\text{pump,in}}}\right)^{-\frac{\gamma -1}{\gamma}}}{\eta \left(T_{\text{pump,in}}-T_{\text{pump,out}}\right)} | ||
| $$ | ||
|
chris-ashe marked this conversation as resolved.
|
||
|
|
||
| ------------------ | ||
|
|
||
| ## Coolant pressure drop | `coolant_friction_pressure_drop()` | ||
|
|
||
| The pressure drop in the coolant is given by the [Darcy-Weisbach Equation](https://en.wikipedia.org/wiki/Darcy%E2%80%93Weisbach_equation) | ||
|
|
||
| For a cylindrical pipe of uniform diameter the pressure loss due to viscous effects can be characterized by: | ||
|
|
||
| $$ | ||
| \Delta P = L\left[f_{\text{D}}\frac{\rho}{2}\frac{\langle v \rangle^2}{D_{\text{H}}}\right] | ||
| $$ | ||
|
|
||
| where $L$ is the pipe length, $f_{\text{D}}$ is the [Darcy friction factor](https://en.wikipedia.org/wiki/Darcy_friction_factor_formulae), $\rho$ is the coolant density, $\langle v \rangle$ is the mean flow coolant velocity and $D_{\text{H}}$ is the hydraulic diameter or the pipe diameter in this case. | ||
|
|
||
| To find the Darcy friction factor we need to know the Reynolds number given by: | ||
|
|
||
| $$ | ||
| \text{Re} = \frac{\rho v L}{\mu} | ||
| $$ | ||
|
|
||
| here $L$ is the characteristic length which we set to be the pipe diameter and $\mu$ is the coolant dynamic viscosity. | ||
|
|
||
| Using the Reynolds number we calculate the Darcy friction factor using the Haaland approximation calculated by [`darcy_friction_haaland()`](../eng-models/generic_methods/pumping.md#pumping-coolant-friction--darcy_friction_haaland). | ||
|
|
||
| For the radius of the pipe bend we assume it to be 3 times the radius of the coolant channel. | ||
|
|
||
| The elbow coefficients for the 90 and 180 degree bends $\left(f_{\text{90,elbow}}, f_{\text{180,elbow}}\right)$ are calculated via [`elbow_coeff()`](#pipe-bend-elbow-coefficient--elbow_coeff). | ||
|
|
||
| The pressure drop for the straights along the entire pipe length is the same as above: | ||
|
|
||
| $$ | ||
| \Delta P = L\left[f_{\text{D}}\frac{\rho}{2}\frac{\langle v \rangle^2}{D_{\text{H}}}\right] | ||
| $$ | ||
|
|
||
| where we define $\frac{f_{\text{D}}L}{D_{\text{H}}}$ as our straight section coefficient. | ||
|
|
||
| The pressure drop for the 90 and 180 degree bends are: | ||
|
|
||
| $$ | ||
| \Delta P = N_{\text{90}} \left[f_{\text{90,elbow}} \frac{\rho \langle v \rangle^2}{2}\right] | ||
| $$ | ||
|
|
||
| $$ | ||
| \Delta P = N_{\text{180}} \left[f_{\text{180,elbow}} \frac{\rho \langle v \rangle^2}{2}\right] | ||
| $$ | ||
|
|
||
| where $N_{\text{90}}$ and $N_{\text{180}}$ are the number of 90 and 180 degree bends in the system. | ||
|
|
||
| The total returned pressure drop is simply: | ||
|
|
||
| $$ | ||
| \Delta P = L\left[f_{\text{D}}\frac{\rho}{2}\frac{\langle v \rangle^2}{D_{\text{H}}}\right] + N_{\text{90}} \left[f_{\text{90,elbow}} \frac{\rho \langle v \rangle^2}{2}\right] + N_{\text{180}} \left[f_{\text{180,elbow}} \frac{\rho \langle v \rangle^2}{2}\right] | ||
| $$ | ||
|
|
||
| ------------------- | ||
|
|
||
|
|
||
| ## Pumping coolant friction | `darcy_friction_haaland()` | ||
|
|
||
| The pressure drop is based on the Darcy friction factor, using the [Haaland equation](https://en.wikipedia.org/wiki/Darcy_friction_factor_formulae#Haaland_equation), an approximation to the implicit Colebrook–White equation. | ||
|
|
@@ -61,4 +138,62 @@ where $\rho$ is the coolant density and $\mu$ is the coolant viscosity. | |
|
|
||
| $$ | ||
| h = \frac{\mathrm{Nu_D}k}{2r_{\text{channel}}} | ||
| $$ | ||
| $$ | ||
|
|
||
| ------------------------- | ||
|
|
||
| ## Pipe bend elbow coefficient | `elbow_coeff()` | ||
|
|
||
| This function calculates the elbow bend coefficients for pressure drop calculations. | ||
|
|
||
| $$ | ||
| a = 1.0 \quad \text{if} \ \theta = 90^{\circ} \\ | ||
| a = 0.9 \times \sin{\left(\frac{\theta \pi}{180^{\circ}}\right)} \quad \text{if} \ \theta < 70^{\circ} \\ | ||
| a = 0.7 + 0.35 \times \sin{\left(\frac{\theta}{90^{\circ}} \times \frac{\pi}{180^{\circ}}\right)} \quad \text{if} \ \theta > 90^{\circ} \\ | ||
| $$ | ||
|
|
||
| where $\theta$ is the angle of the pipe bend. | ||
|
|
||
| $$ | ||
| b = \frac{0.21}{\sqrt{\frac{R_{\text{elbow}}}{D_{\text{pipe}}}}}\quad \text{if} \ \frac{R_{\text{elbow}}}{D_{\text{pipe}}} \ge 1 \\ | ||
| b = \frac{0.21}{\left(\frac{R_{\text{elbow}}}{D_{\text{pipe}}}\right)^{2.5}}\quad \text{if} \ \frac{R_{\text{elbow}}}{D_{\text{pipe}}} \le 1 \\ | ||
| \text{else} \quad b =0.21 | ||
| $$ | ||
|
|
||
| The elbow coefficient is given by: | ||
|
|
||
| $$ | ||
| ab + \left( f_{\text{D}} \times \frac{R_{\text{elbow}}}{D_{\text{pipe}}}\right) \times \theta \times \left(\frac{\pi}{180^{\circ}}\right) | ||
| $$ | ||
|
|
||
| -------------- | ||
|
|
||
| ## Required mass flow rate | `calculate_required_mass_flow_rate()` | ||
|
|
||
| The required mass flow rate of a coolant is given simply by the fundamental heat transfer equation: | ||
|
|
||
| $$ | ||
| \dot{m} = \frac{P}{c_{\text{p}}(T)\times \Delta T} | ||
| $$ | ||
|
|
||
| where $\dot{m}$ is the required mass flow rate in, $P$ is the heating power to be removed, $c_{\text{p}}$ is the coolant specific heat capacity for constant pressure and $\Delta T$ is the temperature change in the coolant. | ||
|
|
||
| !!! note "Variation specific heat capacity" | ||
|
|
||
| The heat capacity itself is a function of temperature. Therefore it is common to use the heat capacity value at the simple average between the initial and final temperature. | ||
| This however assumes a linear relationship. Ideally the equation should be solves as: | ||
|
|
||
| $$ | ||
| \dot{m} = \frac{P}{\int_{T_{\text{in}}}^{T_{\text{in}}}c_{\text{p}}(T) dT} | ||
|
chris-ashe marked this conversation as resolved.
|
||
| $$ | ||
|
athoynilimanew marked this conversation as resolved.
|
||
|
|
||
|
|
||
| !!! info "Choice of specific heat capacity" | ||
|
|
||
| For pumping, the specific heat capacity for constant pressure $(c_{\text{p}})$ is used because | ||
| cooling loops are open, steady-flow systems: coolant flows continuously through pipes, heat | ||
| exchangers and pumps at a system pressure that is actively maintained by the pump's operating | ||
| point and any pressure-control components (e.g. pressurisers, control valves), rather than | ||
| varying freely with the coolant's volume. | ||
|
|
||
| You would only use the specific heat capacity for constant volume $(c_{\text{v}})$ if the coolant was completely sealed inside a rigid, unyielding container with zero flow, where heating it would cause the pressure to spike but the volume to stay exactly the same. | ||
|
Comment on lines
+170
to
+199
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this bit of doc is new, so probably worth an @ukaea/process-model-review looking at it
athoynilimanew marked this conversation as resolved.
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you have completely moved the documentation, this file should be deleted, No?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This just removes the generic pumping equations and puts them into the pumping file. The blanket overview page will still be needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, then could you please write here something like "To be written" or similar? File with just a heading and section heading but no text looks odd