diff --git a/documentation/source/eng-models/blanket_overview.md b/documentation/source/eng-models/blanket_overview.md index 71ea951c2..66a84b15f 100644 --- a/documentation/source/eng-models/blanket_overview.md +++ b/documentation/source/eng-models/blanket_overview.md @@ -44,7 +44,7 @@ $$ 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()`. +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. diff --git a/documentation/source/eng-models/fw-blanket.md b/documentation/source/eng-models/fw-blanket.md index d1ca05bca..a1cdf2aa2 100644 --- a/documentation/source/eng-models/fw-blanket.md +++ b/documentation/source/eng-models/fw-blanket.md @@ -137,9 +137,9 @@ This function is used to calculate the first wall heating, it assumes the same c \mathtt{temp_k} = \frac{T_{\text{outlet}} + T_{\text{FW,peak}}}{2} $$ -8. Calculate the FW thermal conductivity at $\mathtt{temp_k}$ using the [`fw_thermal_conductivity()`](#fw-thermal-conductivity--fw_thermal_conductivity) function. +8. Calculate the FW thermal conductivity at $\mathtt{temp_k}$ using the [`eurofer97_thermal_conductivity()`](../eng-models/generic_methods/materials.md#eurofer97-thermal-conductivity--eurofer97_thermal_conductivity) function. -9. Determine the heat transfer coefficient using the [`heat_transfer()`](#fw-heat-transfer--heat_transfer) function. +9. Determine the heat transfer coefficient using the [`gnielinski_heat_transfer_coefficient()`](../eng-models/generic_methods/pumping.md#gnielinski-heat-transfer--gnielinski_heat_transfer_coefficient) function. 10. Compute the worst-case load. @@ -193,78 +193,8 @@ $$ where $\texttt{tkfw}$ is the thermal conductivity of the first wall material and $\texttt{onedload}$ is the heat load per unit length. -------------- - -### FW heat transfer | `heat_transfer()` - -1. **Calculate the Reynolds number:** - - $$ - \mathrm{Re} = \frac{\rho v \left(2r_{\text{channel}}\right)}{\mu} - $$ - - where $\rho$ is the coolant density and $\mu$ is the coolant viscosity. - -2. **Calculate the Prandtl number:** - - $$ - \mathrm{Pr} = \frac{c_{\text{p}}\mu}{k} - $$ - - were $c_{\text{p}}$ is the coolant heat capacity and $k$ is the coolant thermal conductivity. - -3. **Calculate the Darcy friction factor using the [`darcy_friction_haaland()`](#fw-coolant-friction--darcy_friction_haaland) method:** - - $$ - f = \texttt{darcy_friction_haaland()} - $$ - -4. **Calculate the Nusselt number using the [Gnielinski correlation](https://en.wikipedia.org/wiki/Nusselt_number#Gnielinski_correlation):** - - $$ - \mathrm{Nu_D} = \frac{\left(f/8\right)\left(\mathrm{Re}-1000\right)\mathrm{Pr}}{1+12.7\left(f/8\right)^{0.5}\left(\mathrm{Pr}^{2/3}-1\right)} - $$ - - The relation is valid for: - - $$ - 0.5 \le \mathrm{Pr} \le 2000 \\ - 3000 \le \mathrm{Re} \le 5 \times 10^6 - $$ - -5. **Calculate the heat transfer coefficient with the Nusselt number:** - - $$ - h = \frac{\mathrm{Nu_D}k}{2r_{\text{channel}}} - $$ - - -------------- -### FW coolant friction | `darcy_friction_haaland()` - - The pressure drop is based on the Darcy fraction factor, using the [Haaland equation](https://en.wikipedia.org/wiki/Darcy_friction_factor_formulae#Haaland_equation), an approximation to the implicit Colebrook–White equation. - -$$ -\frac{1}{\sqrt{f}} = -1.8 \log{\left[ \left(\frac{\epsilon / D}{3.7}\right)^{1.11} \frac{6.9}{\text{Re}} \right]} -$$ - ------------- - -### FW thermal conductivity | `fw_thermal_conductivity()` - -The thermal conductivity of the first wall is assumed to be that of Eurofer97 using the relation below[^1] [^2]: - -$$ -K_{\text{Eurofer97}} = 5.4308 + 0.13565T - 0.00023862T^2 + 1.3393 \times 10^{-7} T^3 -$$ - -!!! warning Thermal conductivity validity bounds - - The sources for the stated thermal conductivity relation above state that the relation is only valid up to 800K [^1] [^2]. - -------------- - ### Model Switches @@ -323,9 +253,4 @@ There are three model options, chosen by the user to match their selected blanke | Variable | Units | Itvar. | Usage | Default | Description | | :----------------------: | :-------: | ------ | ----------- | ------- | ------------------------------------------------------------------- | -| `bz_channel_conduct_liq` | A V-1 m-1 | 72 | ifci = 0, 2 | 8.33D5 | Liquid metal coolant/breeder thin conductor or FCI wall conductance | - - -[^1]: A. A. Tavassoli et al., “Materials design data for reduced activation martensitic steel type EUROFER,” Journal of Nuclear Materials, vol. 329–333, pp. 257–262, Aug. 2004, doi: https://doi.org/10.1016/j.jnucmat.2004.04.020. - -[^2]: Tavassoli, F. "Fusion Demo Interim Structural Design Criteria (DISDC)/Appendix A Material Design Limit Data/A3. S18E Eurofer Steel." CEA, EFDA_TASK_TW4-TTMS-005-D01 (2004). \ No newline at end of file +| `bz_channel_conduct_liq` | A V-1 m-1 | 72 | ifci = 0, 2 | 8.33D5 | Liquid metal coolant/breeder thin conductor or FCI wall conductance | \ No newline at end of file diff --git a/documentation/source/eng-models/generic_methods/materials.md b/documentation/source/eng-models/generic_methods/materials.md new file mode 100644 index 000000000..b775d8efa --- /dev/null +++ b/documentation/source/eng-models/generic_methods/materials.md @@ -0,0 +1,17 @@ +# Materials Methods + +## Eurofer97 thermal conductivity | `eurofer97_thermal_conductivity()` + +The thermal conductivity of the first wall is assumed to be that of Eurofer97 using the relation below[^1] [^2]: + +$$ +K_{\text{Eurofer97}} = \frac{\texttt{fwbs\_variables.fw\_th\_conductivity}}{28.34}\left(5.4308 + 0.13565T - 0.00023862T^2 + 1.3393 \times 10^{-7} T^3\right) +$$ + +!!! warning Thermal conductivity validity bounds + + The sources for the stated thermal conductivity relation above state that the relation is only valid up to 800K [^1] [^2]. + +[^1]: A. A. Tavassoli et al., “Materials design data for reduced activation martensitic steel type EUROFER,” Journal of Nuclear Materials, vol. 329–333, pp. 257–262, Aug. 2004, doi: https://doi.org/10.1016/j.jnucmat.2004.04.020. + +[^2]: Tavassoli, F. "Fusion Demo Interim Structural Design Criteria (DISDC)/Appendix A Material Design Limit Data/A3. S18E Eurofer Steel." CEA, EFDA_TASK_TW4-TTMS-005-D01 (2004). \ No newline at end of file diff --git a/documentation/source/eng-models/generic_methods/pumping.md b/documentation/source/eng-models/generic_methods/pumping.md new file mode 100644 index 000000000..a4822ba00 --- /dev/null +++ b/documentation/source/eng-models/generic_methods/pumping.md @@ -0,0 +1,64 @@ +# Pumping Methods + +## 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. + +$$ +\frac{1}{\sqrt{f}} = -1.8 \log_{10}{\left[ \left(\frac{\epsilon / D}{3.7}\right)^{1.11} + \frac{6.9}{\text{Re}} \right]} +$$ + +------------------- + +## Reynolds number | `calculate_reynolds_number()` + +$$ +\mathrm{Re} = \frac{\rho v \left(2r_{\text{channel}}\right)}{\mu} +$$ + +where $\rho$ is the coolant density and $\mu$ is the coolant viscosity. + +------------------- + +## Gnielinski heat transfer | `gnielinski_heat_transfer_coefficient()` + +1. **Calculate the Reynolds number:** + + $$ + \mathrm{Re} = \frac{\rho v \left(2r_{\text{channel}}\right)}{\mu} + $$ + + where $\rho$ is the coolant density and $\mu$ is the coolant viscosity. + +2. **Calculate the Prandtl number:** + + $$ + \mathrm{Pr} = \frac{c_{\text{p}}\mu}{k} + $$ + + were $c_{\text{p}}$ is the coolant heat capacity and $k$ is the coolant thermal conductivity. + +3. **Calculate the Darcy friction factor using the [`darcy_friction_haaland()`](#pumping-coolant-friction--darcy_friction_haaland) method:** + + $$ + f = \texttt{darcy_friction_haaland()} + $$ + +4. **Calculate the Nusselt number using the [Gnielinski correlation](https://en.wikipedia.org/wiki/Nusselt_number#Gnielinski_correlation):** + + $$ + \mathrm{Nu_D} = \frac{\left(f/8\right)\left(\mathrm{Re}-1000\right)\mathrm{Pr}}{1+12.7\left(f/8\right)^{0.5}\left(\mathrm{Pr}^{2/3}-1\right)} + $$ + + The relation is valid for: + + $$ + 0.5 \le \mathrm{Pr} \le 2000 \\ + 3000 \le \mathrm{Re} \le 5 \times 10^6 + $$ + +5. **Calculate the heat transfer coefficient with the Nusselt number:** + + $$ + h = \frac{\mathrm{Nu_D}k}{2r_{\text{channel}}} + $$ \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 74ba107a8..42595c58b 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -118,6 +118,9 @@ nav: - Plant Availability: eng-models/plant-availability.md - Power Requirements: eng-models/power-requirements.md - Vacuum Vessel: eng-models/vacuum-vessel.md + - Generic Engineering Methods: + - Pumping: eng-models/generic_methods/pumping.md + - Materials: eng-models/generic_methods/materials.md - Unique Models: - Water Use: unique-models/water_use.md - Power Plant Building Sizes: unique-models/buildings_sizes.md diff --git a/process/models/blankets/blanket_library.py b/process/models/blankets/blanket_library.py index 3ec2b9361..dfc47fa0e 100644 --- a/process/models/blankets/blanket_library.py +++ b/process/models/blankets/blanket_library.py @@ -21,6 +21,10 @@ primary_pumping_variables, ) from process.models.build import FwBlktVVShape +from process.models.engineering.pumping import ( + calculate_reynolds_number, + darcy_friction_haaland, +) from process.models.power import PumpingPowerModelTypes logger = logging.getLogger(__name__) @@ -3073,17 +3077,22 @@ def coolant_friction_pressure_drop( dia_pipe = self.pipe_hydraulic_diameter(i_ps) # Reynolds number - reynolds_number = den_coolant * vel_coolant * dia_pipe / visc_coolant + reynolds_number = calculate_reynolds_number( + den_coolant=den_coolant, + vel_coolant=vel_coolant, + radius_channel=dia_pipe / 2, + visc_coolant=visc_coolant, + ) # Calculate Darcy friction factor # N.B. friction function Uses Haaland approx. which assumes a filled circular pipe. # Use dh which allows us to do fluid calculations for non-cicular tubes # (dh is estimate appropriate for fully developed flow). - darcy_friction_factor = self.fw.darcy_friction_haaland( - reynolds_number, - fwbs_variables.roughness_fw_channel, - fwbs_variables.radius_fw_channel, + darcy_friction_factor = darcy_friction_haaland( + reynolds=reynolds_number, + roughness_channel=fwbs_variables.roughness_fw_channel, + radius_channel=fwbs_variables.radius_fw_channel, ) # Pressure drop coefficient diff --git a/process/models/engineering/__init__.py b/process/models/engineering/__init__.py new file mode 100644 index 000000000..bc3ce8494 --- /dev/null +++ b/process/models/engineering/__init__.py @@ -0,0 +1 @@ +"""Engineering models package.""" diff --git a/process/models/engineering/materials.py b/process/models/engineering/materials.py new file mode 100644 index 000000000..2dfacebc4 --- /dev/null +++ b/process/models/engineering/materials.py @@ -0,0 +1,45 @@ +"""Materials module for engineering calculations and properties.""" + +import logging + +from process.data_structure import ( + fwbs_variables, +) + +logger = logging.getLogger(__name__) + + +def eurofer97_thermal_conductivity(temp: float) -> float: + """Calculates the thermal conductivity of the first wall material (Eurofer97). + + Parameters + ---------- + temp: + Property temperature in Kelvin (K). + + Returns + ------- + : + Thermal conductivity of Eurofer97 in W/m/K. + + Notes + ----- + Valid up to about 800 K + + References + ---------- + - A. A. Tavassoli et al., “Materials design data for reduced activation martensitic + steel type EUROFER,” + Journal of Nuclear Materials, vol. 329-333, pp. 257-262, Aug. 2004, + doi: https://doi.org/10.1016/j.jnucmat.2004.04.020. + + - Tavassoli, F. "Fusion Demo Interim Structural Design Criteria (DISDC)/Appendix A + Material Design Limit Data/A3. S18E Eurofer Steel." + CEA, EFDA_TASK_TW4-TTMS-005-D01 (2004) + """ + # temp in Kelvin + return ( + (5.4308 + 0.13565 * temp - 0.00023862 * temp**2 + 1.3393e-7 * temp**3) + * fwbs_variables.fw_th_conductivity + / 28.34 + ) diff --git a/process/models/engineering/pumping.py b/process/models/engineering/pumping.py new file mode 100644 index 000000000..8afca58ee --- /dev/null +++ b/process/models/engineering/pumping.py @@ -0,0 +1,165 @@ +"""Engineering models for pumping system analysis.""" + +import logging + +import numpy as np + +logger = logging.getLogger(__name__) + + +def darcy_friction_haaland( + reynolds: float, roughness_channel: float, radius_channel: float +) -> float: + """Calculate Darcy friction factor using the Haaland equation. + + Parameters + ---------- + reynolds: + Reynolds number. + roughness_channel: + Roughness of the first wall coolant channel (m). + radius_channel: + Radius of the first wall coolant channel (m). + + Returns + ------- + : + Darcy friction factor. + + Notes + ----- + The Haaland equation is an approximation to the implicit Colebrook-White equation. + It is used to calculate the Darcy friction factor for turbulent flow in pipes. + + References + ---------- + - https://en.wikipedia.org/wiki/Darcy_friction_factor_formulae#Haaland_equation + """ + # Bracketed term in Haaland equation + bracket = (roughness_channel / radius_channel / 3.7) ** 1.11 + 6.9 / reynolds + + # Calculate Darcy friction factor + return (1.8 * np.log10(bracket)) ** (-2) + + +def gnielinski_heat_transfer_coefficient( + mflux_coolant: float, + den_coolant: float, + radius_channel: float, + heatcap_coolant: float, + visc_coolant: float, + thermcond_coolant: float, + roughness_channel: float, +) -> float: + """Calculate heat transfer coefficient using Gnielinski correlation. + + Parameters + ---------- + mflux_coolant: + Coolant mass flux in a single channel (kg/m²/s). + den_coolant: + Coolant density (average of inlet and outlet) (kg/m³). + radius_channel: + Coolant pipe radius (m). + heatcap_coolant: + Coolant specific heat capacity (average of inlet and outlet) (J/kg/K). + visc_coolant: + Coolant viscosity (average of inlet and outlet) (Pa.s). + thermcond_coolant: + Thermal conductivity of coolant (average of inlet and outlet) (W/m.K). + roughness_channel: + Roughness of the coolant channel (m). + + Returns + ------- + : + Heat transfer coefficient (W/m²K). + + Notes + ----- + Gnielinski correlation. Ignore the distinction between wall and + bulk temperatures. Valid for: 3000 < Re < 5e6, 0.5 < Pr < 2000 + + References + ---------- + - https://en.wikipedia.org/wiki/Nusselt_number#Gnielinski_correlation + + """ + # Calculate pipe diameter (m) + diameter = 2 * radius_channel + + # Calculate flow velocity (m/s) + vel_coolant = mflux_coolant / den_coolant + + # Calculate Reynolds number + reynolds = calculate_reynolds_number( + den_coolant=den_coolant, + vel_coolant=vel_coolant, + radius_channel=diameter / 2, + visc_coolant=visc_coolant, + ) + + # Calculate Prandtl number + pr = heatcap_coolant * visc_coolant / thermcond_coolant + + # Calculate Darcy friction factor, using Haaland equation + f = darcy_friction_haaland( + reynolds=reynolds, + roughness_channel=roughness_channel, + radius_channel=radius_channel, + ) + + # Calculate the Nusselt number + nusselt = ( + (f / 8.0) + * (reynolds - 1000.0) + * pr + / (1 + 12.7 * np.sqrt(f / 8.0) * (pr ** (2 / 3) - 1.0)) + ) + + # Calculate the heat transfer coefficient (W/m^2K) + heat_transfer_coefficient = nusselt * thermcond_coolant / (2.0 * radius_channel) + + # Check that Reynolds number is in valid range for the Gnielinski correlation + if (reynolds <= 3000.0) or (reynolds > 5.0e6): + logger.error("Reynolds number out of range : [3e3-5000e3]. %s", reynolds) + + # Check that Prandtl number is in valid range for the Gnielinski correlation + if (pr < 0.5) or (pr > 2000.0): + logger.error("Prandtl number out of range : [0.5-2000]. %s", pr) + + # Check that the Darcy friction factor is in valid range for the Gnielinski + # correlation + if f <= 0.0: + logger.error("Negative Darcy friction factor (f). %s", f) + + return heat_transfer_coefficient + + +def calculate_reynolds_number( + den_coolant: float, vel_coolant: float, radius_channel: float, visc_coolant: float +) -> float: + """Calculate Reynolds number for flow in a pipe. + + Parameters + ---------- + den_coolant: + Coolant density (average of inlet and outlet) (kg/m³). + vel_coolant: + Coolant velocity in a single channel (m/s). + radius_channel: + Coolant pipe radius (m). + visc_coolant: + Coolant viscosity (average of inlet and outlet) (Pa.s). + + Returns + ------- + : + Reynolds number. + + """ + # Calculate pipe diameter (m) + diameter = 2 * radius_channel + + # Calculate Reynolds number + return den_coolant * vel_coolant * diameter / visc_coolant diff --git a/process/models/fw.py b/process/models/fw.py index 59dadcb9e..11b091b12 100644 --- a/process/models/fw.py +++ b/process/models/fw.py @@ -22,6 +22,10 @@ eshellarea, ) from process.models.build import FwBlktVVShape +from process.models.engineering.materials import eurofer97_thermal_conductivity +from process.models.engineering.pumping import ( + gnielinski_heat_transfer_coefficient, +) logger = logging.getLogger(__name__) @@ -457,17 +461,17 @@ def fw_temp( ) # Thermal conductivity of first wall material (W/m.K) - tkfw = self.fw_thermal_conductivity(temp_k) + tkfw = eurofer97_thermal_conductivity(temp=temp_k) # Heat transfer coefficient (W m^-2 K^-1) - hcoeff = self.heat_transfer( - mflux_fw_coolant, - outlet_coolant_properties.density, - radius_fw_channel, - outlet_coolant_properties.specific_heat_const_p, - outlet_coolant_properties.viscosity, - outlet_coolant_properties.thermal_conductivity, - fwbs_variables.roughness_fw_channel, + hcoeff = gnielinski_heat_transfer_coefficient( + mflux_coolant=mflux_fw_coolant, + den_coolant=outlet_coolant_properties.density, + radius_channel=radius_fw_channel, + heatcap_coolant=outlet_coolant_properties.specific_heat_const_p, + visc_coolant=outlet_coolant_properties.viscosity, + thermcond_coolant=outlet_coolant_properties.thermal_conductivity, + roughness_channel=fwbs_variables.roughness_fw_channel, ) # Temperature drops between first-wall surface and bulk coolant ! @@ -646,163 +650,6 @@ def fw_temp( mflow_fw_coolant, ) - def fw_thermal_conductivity(self, temp: float) -> float: - """Calculates the thermal conductivity of the first wall material (Eurofer97). - - Parameters - ---------- - temp: - Property temperature in Kelvin (K). - - Returns - ------- - : - Thermal conductivity of Eurofer97 in W/m/K. - - Notes - ----- - Valid up to about 800 K - - References - ---------- - - A. A. Tavassoli et al., “Materials design data for reduced activation martensitic steel type EUROFER,” - Journal of Nuclear Materials, vol. 329-333, pp. 257-262, Aug. 2004, - doi: https://doi.org/10.1016/j.jnucmat.2004.04.020. - - - Tavassoli, F. "Fusion Demo Interim Structural Design Criteria (DISDC)/Appendix A Material Design Limit Data/A3. S18E Eurofer Steel." - CEA, EFDA_TASK_TW4-TTMS-005-D01 (2004) - """ - # temp in Kelvin - return ( - (5.4308 + 0.13565 * temp - 0.00023862 * temp**2 + 1.3393e-7 * temp**3) - * fwbs_variables.fw_th_conductivity - / 28.34 - ) - - def heat_transfer( - self, - mflux_coolant: float, - den_coolant: float, - radius_channel: float, - heatcap_coolant: float, - visc_coolant: float, - thermcond_coolant: float, - roughness_fw_channel: float, - ) -> float: - """Calculate heat transfer coefficient using Gnielinski correlation. - - Parameters - ---------- - mflux_coolant: - Coolant mass flux in a single channel (kg/m^2/s). - den_coolant: - Coolant density (average of inlet and outlet) (kg/m^3). - radius_channel: - Coolant pipe radius (m). - heatcap_coolant: - Coolant specific heat capacity (average of inlet and outlet) (J/kg/K). - visc_coolant: - Coolant viscosity (average of inlet and outlet) (Pa.s). - thermcond_coolant: - Thermal conductivity of coolant (average of inlet and outlet) (W/m.K). - roughness_fw_channel: - Roughness of the first wall coolant channel (m). - - Returns - ------- - : - Heat transfer coefficient (W/m^2K). - - Notes - ----- - Gnielinski correlation. Ignore the distinction between wall and - bulk temperatures. Valid for: 3000 < Re < 5e6, 0.5 < Pr < 2000 - - References - ---------- - - https://en.wikipedia.org/wiki/Nusselt_number#Gnielinski_correlation - - """ - # Calculate pipe diameter (m) - diameter = 2 * radius_channel - - # Calculate flow velocity (m/s) - velocity = mflux_coolant / den_coolant - - # Calculate Reynolds number - reynolds = den_coolant * velocity * diameter / visc_coolant - - # Calculate Prandtl number - pr = heatcap_coolant * visc_coolant / thermcond_coolant - - # Calculate Darcy friction factor, using Haaland equation - f = self.darcy_friction_haaland( - reynolds, - roughness_fw_channel, - radius_channel, - ) - - # Calculate the Nusselt number - nusselt = ( - (f / 8.0) - * (reynolds - 1000.0) - * pr - / (1 + 12.7 * np.sqrt(f / 8.0) * (pr ** (2 / 3) - 1.0)) - ) - - # Calculate the heat transfer coefficient (W/m^2K) - heat_transfer_coefficient = nusselt * thermcond_coolant / (2.0 * radius_channel) - - # Check that Reynolds number is in valid range for the Gnielinski correlation - if (reynolds <= 3000.0) or (reynolds > 5.0e6): - logger.error("Reynolds number out of range : [3e3-5000e3]. %s", reynolds) - - # Check that Prandtl number is in valid range for the Gnielinski correlation - if (pr < 0.5) or (pr > 2000.0): - logger.error("Prandtl number out of range : [0.5-2000]. %s", pr) - - # Check that the Darcy friction factor is in valid range for the Gnielinski correlation - if f <= 0.0: - logger.error("Negative Darcy friction factor (f). %s", f) - - return heat_transfer_coefficient - - def darcy_friction_haaland( - self, reynolds: float, roughness_fw_channel: float, radius_fw_channel: float - ) -> float: - """Calculate Darcy friction factor using the Haaland equation. - - Parameters - ---------- - reynolds - Reynolds number. - roughness_fw_channel - Roughness of the first wall coolant channel (m). - radius_fw_channel - Radius of the first wall coolant channel (m). - - Returns - ------- - : - Darcy friction factor. - - Notes - ----- - The Haaland equation is an approximation to the implicit Colebrook-White equation. - It is used to calculate the Darcy friction factor for turbulent flow in pipes. - - References - ---------- - - https://en.wikipedia.org/wiki/Darcy_friction_factor_formulae#Haaland_equation - """ - # Bracketed term in Haaland equation - bracket = ( - roughness_fw_channel / radius_fw_channel / 3.7 - ) ** 1.11 + 6.9 / reynolds - - # Calculate Darcy friction factor - return (1.8 * np.log10(bracket)) ** (-2) - @staticmethod def calculate_total_fw_channels( a_fw_inboard: float, diff --git a/tests/unit/models/engineering/test_materials.py b/tests/unit/models/engineering/test_materials.py new file mode 100644 index 000000000..e56867059 --- /dev/null +++ b/tests/unit/models/engineering/test_materials.py @@ -0,0 +1,10 @@ +import pytest + +from process.data_structure import fwbs_variables +from process.models.engineering.materials import eurofer97_thermal_conductivity + + +def test_eurofer97_thermal_conductivity(monkeypatch): + monkeypatch.setattr(fwbs_variables, "fw_th_conductivity", 28.9) + + assert eurofer97_thermal_conductivity(1900.0) == pytest.approx(326.70406785462256) diff --git a/tests/unit/models/engineering/test_pumping.py b/tests/unit/models/engineering/test_pumping.py new file mode 100644 index 000000000..6b1898bb1 --- /dev/null +++ b/tests/unit/models/engineering/test_pumping.py @@ -0,0 +1,35 @@ +import pytest + +from process.models.engineering.pumping import ( + calculate_reynolds_number, + darcy_friction_haaland, + gnielinski_heat_transfer_coefficient, +) + + +def test_darcy_friction_haaland(): + assert darcy_friction_haaland( + reynolds=5500, roughness_channel=1e-6, radius_channel=0.1 + ) == pytest.approx(0.0366668931278784) + + +def test_gnielinski_heat_transfer_coefficient(): + assert gnielinski_heat_transfer_coefficient( + mflux_coolant=112.19853108876258, + den_coolant=8.8673250601290707, + radius_channel=0.0060000000000000001, + heatcap_coolant=5184.9330299967578, + visc_coolant=4.0416219836935569e-05, + thermcond_coolant=0.3211653052986152, + roughness_channel=6e-8, + ) == pytest.approx(1929.2042015869506) + + +def test_calculate_reynolds_number(): + + assert calculate_reynolds_number( + den_coolant=8.8673250601290707, + vel_coolant=12.649110769896881, + radius_channel=0.0060000000000000001, + visc_coolant=4.0416219836935569e-05, + ) == pytest.approx(33302.602975971815) diff --git a/tests/unit/models/test_fw.py b/tests/unit/models/test_fw.py index db4c1be64..dc7867b2f 100644 --- a/tests/unit/models/test_fw.py +++ b/tests/unit/models/test_fw.py @@ -164,27 +164,3 @@ def test_fw_temp(fwtempparam, monkeypatch, fw): assert rhofmean == pytest.approx(fwtempparam.expected_rhofmean, rel=1e-4) assert massrate == pytest.approx(fwtempparam.expected_massrate, rel=1e-4) - - -def test_darcy_friction_haaland(fw): - assert fw.darcy_friction_haaland(5500, 1e-6, 0.1) == pytest.approx( - 0.0366668931278784 - ) - - -def test_heat_transfer(fw): - assert fw.heat_transfer( - mflux_coolant=112.19853108876258, - den_coolant=8.8673250601290707, - radius_channel=0.0060000000000000001, - heatcap_coolant=5184.9330299967578, - visc_coolant=4.0416219836935569e-05, - thermcond_coolant=0.3211653052986152, - roughness_fw_channel=6e-8, - ) == pytest.approx(1929.2042015869506) - - -def test_fw_thermal_conductivity(monkeypatch, fw): - monkeypatch.setattr(fwbs_variables, "fw_th_conductivity", 28.9) - - assert fw.fw_thermal_conductivity(1900.0) == pytest.approx(326.70406785462256)