Skip to content

Commit

Permalink
Added Friction Factor and Nusselt Number Module readin capabilities.
Browse files Browse the repository at this point in the history
  • Loading branch information
thurstonsd committed May 3, 2024
1 parent 4153b60 commit e51a6ce
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 74 deletions.
33 changes: 12 additions & 21 deletions LoadedTACO/src/FrictionFactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,6 @@
@author: skyet
"""

import LoadedTACO.src.HT9Props as clad
import LoadedTACO.src.HexDhCal as Geom
import LoadedTACO.src.HegNu as Nu
import LoadedTACO.src.TempBulkCal as TempBulk
import TACOCAT_Read_In_File as TCinput
import LoadedTACO.src.Geometry_Value as Geometry
from scipy.integrate import trapz
from scipy.integrate import quad
from LoadedTACO.src.Fuel_Props import Fuel_props
from LoadedTACO.src.Geometry_Value import Core_Geometry
from LoadedTACO.src.Coolant_Value import Coolant

#References:
# 1.)https://www.sciencedirect.com/science/article/pii/S073519332030347X
#2.)https://www.thermal-engineering.org/what-is-dittus-boelter-equation-definition/
Uinlet = TCinput.Uinlet #average inlet velocity in a subchannel - m/s
Coolant_Type = TCinput.Coolant
Geometry_Type = TCinput.Geometry
Re = (Uinlet*Core_Geometry[Geometry_Type]["InnerHydraulicDiameter"]/Coolant[Coolant_Type]["nu"])
Dh=Core_Geometry[Geometry_Type]["InnerHydraulicDiameter"]
L=Geometry.z

def Blasius(Re,Geometry_Type):
f = 0.316*Re**(-0.25)
Expand All @@ -38,3 +17,15 @@ def Blasius(Re,Geometry_Type):
def lam(Re):
f=64/Re
return f

def Haaland (Re, roughness):
f=0.3086/(((log(6.9/Re+roughness*D)^1.11))^2)
return f

#Preparing Functions for dictionary
Friction_Factor={
"Blasius":Blasius,
"laminar":lam,
"Haaland":Haaland,
}

53 changes: 12 additions & 41 deletions LoadedTACO/src/NusseltNumber.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,55 +4,26 @@
@author: skyet
"""
import LoadedTACO.src.HT9Props as clad
import LoadedTACO.src.HexDhCal as Geom
import LoadedTACO.src.HegNu as Nu
import LoadedTACO.src.TempBulkCal as TempBulk
import TACOCAT_Read_In_File as TCinput
import LoadedTACO.src.Geometry_Value as Geometry
from scipy.integrate import trapz
from scipy.integrate import quad
from LoadedTACO.src.Fuel_Props import Fuel_props
from LoadedTACO.src.Geometry_Value import Core_Geometry
from LoadedTACO.src.Coolant_Value import Coolant

#References:
# 1.)https://www.sciencedirect.com/science/article/pii/S073519332030347X
#2.)https://www.thermal-engineering.org/what-is-dittus-boelter-equation-definition/
Uinlet = TCinput.Uinlet #average inlet velocity in a subchannel - m/s
Coolant_Type = TCinput.Coolant
Geometry_Type = TCinput.Geometry
Pr = Coolant[Coolant_Type]["Cp"]*Coolant[Coolant_Type]["nu"]*Coolant[Coolant_Type]["rho"]/Coolant[Coolant_Type]["k"] #Prandtl Number Calculation
Re = (Uinlet*Core_Geometry[Geometry_Type]["InnerHydraulicDiameter"]/Coolant[Coolant_Type]["nu"])
b=0.4 #This is for heating. May need to revise in the future
f = 0.316*Re**(-0.25) #Re should be Re1. This is to test Nusselt Number Capabilities. Needs to be revised in the future
Dh=Core_Geometry[Geometry_Type]["InnerHydraulicDiameter"]
L=Geometry.z
Prw=Pr #We assume that Prandlt Number at the wall is the same as the Prandlt number at the middle of the channel
# Defining Nusselt Number functions


def Nu_DB(Re,Pr,b):
Nu=0.023*(Re**0.8)*(Pr**b)
return Nu
#Nu_DB (1,5,7)
#print (Nu)



def Nu_Gn(f,Re,Pr,Dh,L,Prw):
Nu=(((f/8)*(Re-1000)*Pr)/(1+12.7*((f/8)**(1/2))*((Pr**(2/3))-1)))*((1+((Dh/L)**(2/3)))*((Pr/Prw)**0.11))
return Nu
# Nu_Gn (9,11,13,15,17,19)
#print (Nu)
# Preparing Functions for dictionary
Nu_dittus = Nu_DB(Re,Pr,b)
Nu_Gniel=Nu_Gn(f,Re,Pr,Dh,L,Prw)

Nus_DB={"NuCorrelation":Nu_dittus,}
Nus_Gn={"NuCorrelation":Nu_Gniel,}
#Dictionary
def Nu_Shad(PtoD,Pe):
if Pe<=150:
Nu = 4.496*(-16.15 + 24.96*PtoD - 8.55*(PtoD**2))
else:
Nu = 4.496*(-16.15 + 24.96*PtoD - 8.55*(PtoD**2))*(Pe/150)**0.3
return Nu

# Preparing Functions for dictionary
Nusselt={
"DittusBoelter":Nus_DB,
"Gnilenski":Nus_Gn,
"DittusBoelter":Nu_DB,
"Gnilenski":Nu_Gn,
"Shad":Nu_Shad,
}

36 changes: 26 additions & 10 deletions TACOCAT.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@
import pandas as pd
from LoadedTACO.src.Clad_Props import Clad_Props
import LoadedTACO.src.HexDhCal as Geom
import LoadedTACO.src.HegNu as Nu
#import LoadedTACO.src.HegNu as Nu
import LoadedTACO.src.TempBulkCal as TempBulk
import TACOCAT_Read_In_File as TCinput
import LoadedTACO.src.Geometry_Value as Geometry
import LoadedTACO.src.NusseltNumber as Nusselt
from LoadedTACO.src.NusseltNumber import Nusselt
from scipy.integrate import trapz
from scipy.integrate import quad
from LoadedTACO.src.Fuel_Props import Fuel_props
from LoadedTACO.src.Geometry_Value import Core_Geometry
from LoadedTACO.src.Coolant_Value import Coolant
from LoadedTACO.src.Flux_Profiles import Fluxes
from LoadedTACO.src.FrictionFactor import Friction_Factor
#Assumptions
#1. The core thermal production is assumed to set after heat deposition
#(i.e. gamma isn't relevant)
Expand All @@ -39,11 +40,12 @@
Uinlet = TCinput.Uinlet #average inlet velocity in a subchannel - m/s
Cladding = TCinput.Clad_Props
Nusselt_Type=TCinput.Nusselt
Friction_Factor_Type=TCinput.Friction
roughness=TCinput.roughness

#Coolant Parameters
Cp = Coolant[Coolant_Type]["Cp"]
rho = Coolant[Coolant_Type]["rho"]
Nu=Nusselt[Nusselt_Type]["NuCorrelation"]

#Geometry Parameters
z = Geometry.z
Expand All @@ -60,6 +62,9 @@
## Core Geometry Calculations
# Geometric Calculations
CVol = Core_Geometry[Geometry_Type]["FaceArea"]*Hc #Volume of the core - m^3
Dh=Core_Geometry[Geometry_Type]["InnerHydraulicDiameter"]
L = Geometry.z
PtoD = Geometry.PtoD

#----------------------------------------------------------------------------------#
## Core Parameter Calculations
Expand All @@ -74,16 +79,29 @@
mdot = Uinlet*Coolant[Coolant_Type]["rho"]*Core_Geometry[Geometry_Type]["CoolantFlowArea"] # Mass flow rate for the fluid - kg/s
Re = (Uinlet*Core_Geometry[Geometry_Type]["InnerHydraulicDiameter"]/Coolant[Coolant_Type]["nu"])
Pe = Re*Pr # Peclet Number for Fluid
#Nu = Nusselt[Nu_correlation]["NuCorrelation"]

Prmax = Coolant[Coolant_Type]["Cpmax"]*Coolant[Coolant_Type]["numax"]*Coolant[Coolant_Type]["rhomax"]/Coolant[Coolant_Type]["kmax"]#Prandtl Number Calculation
Uoutlet = mdot/(Coolant[Coolant_Type]["rhomax"]*Core_Geometry[Geometry_Type]["CoolantFlowArea"]) # Outlet Velocity in a inner channel
Pemax = Prmax*Uoutlet*Geometry.FoCD/Coolant[Coolant_Type]["numax"] # Max Peclet number in a inner channel
Pravg = (Pr + Prmax)/2 # Average Prandtl Number in a inner channel
Peavg = (Pe + Pemax)/2 # Average Peclect number in a inner channel
Re1 = Peavg/Pravg # Average Reynolds number in a inner channel
fsm = 0.316*Re1**(-0.25)
Nu=Nusselt.Nu_DB(Re,Pr,0.4)
#fsm = 0.316*Re1**(-0.25)

Friction_Fact=Friction_Factor[Friction_Factor_Type]

args_ff= {
"Blasius": (Re,Geometry_Type),
"laminar": (Re),
"Haaland": (Re, roughness)
}
Fr_Fact=Friction_Fact(*args_ff[Friction_Factor_Type])

Nu_func=Nusselt[Nusselt_Type]
args_Nu = {
"DittusBoelter":(Re,Pr,0.4),
"Gnilenski":(Fr_Fact,Re,Pr,Dh,L,Pr),
}
Nu = Nu_func(*args_Nu[Nusselt_Type])

h = Nu*Coolant[Coolant_Type]["k"]/Core_Geometry[Geometry_Type]["InnerHydraulicDiameter"] #Heat Transfer Coefficient for Rod Bundles - W/m^2 - C

Expand Down Expand Up @@ -122,8 +140,6 @@ def HotFBulkTemp(Tbulkin,FluxPro,z,NFuel,qlinHotF,Cp,Uinlet,rho,A_xs):
# Centerline Temperature of Fuel in Hottest Channel - C
TclHotF[i] = TbulkHotF[i] + ((FluxPro[i]*qlinHotF)/(2*np.pi))*((1/(h*(Geometry.FoCD/2))) + (1/(2*Fuel_props[Fuel_Type]["kfuel"])) + (1/kclad)*np.log(Geometry.FoCD/Geometry.FoD))

print(Tcl)

Tavg = (Tbulk[0] + Tbulk[Geometry.steps-1])/2
THotFavg = (TbulkHotF[0] + TbulkHotF[Geometry.steps-1])/2
#Max and Averaged quantities with calculated outlet temperature
Expand All @@ -134,7 +150,7 @@ def HotFBulkTemp(Tbulkin,FluxPro,z,NFuel,qlinHotF,Cp,Uinlet,rho,A_xs):
M = ((1.034/(Geometry.PtoD**0.124))+(29.7*(Geometry.PtoD**6.94)*Re1**0.086)/(Geom.LeadW(FoCD,WoD)/Geometry.FoCD)**2.239)**0.885 #modifier
else:
M = 1
dP = M*fsm*(Hc/Core_Geometry[Geometry_Type]["InnerHydraulicDiameter"])*0.5*rhoavg*Uavg**2
dP = M*Fr_Fact*(Hc/Core_Geometry[Geometry_Type]["InnerHydraulicDiameter"])*0.5*rhoavg*Uavg**2

#Heat Load Calculation
QPri = Uavg*rhoavg*Core_Geometry[Geometry_Type]["CoolantFlowArea"]*((Coolant[Coolant_Type]["Cp"] + Coolant[Coolant_Type]["Cpmax"])/2)*(Tbulk[Geometry.steps-1]-Tbulk[0])
Expand Down
11 changes: 9 additions & 2 deletions TACOCAT_Read_In_File.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,21 @@
#Provide flux profile. Flux profile includes: Flatline, Linear, Exponential, Chopped_Cosine
Flux = "Chopped_Cosine"


#Provide cladding material. Cladding types include:
#Graphite_384_2,Zirc_2_Nickel_Free,Stain_Steel_316,Stain_Steel_304L,Stain_Steel_304,Zirc_2,Kanth_AMPT
#Provide Clad Properties. Cladding includes:

Clad_Props = "Graphite_384_2" #Cladding Properties for Graphite

#Provide desired Nusselt Number Corrilation. Corrilations include:Nus_DB and Nus_Gn

#Provide desired Nusselt Number Corrilation. Corrilations include:DittusBoelter,Gnilenski, and Shad

Nusselt="DittusBoelter"

#Friction Factor Correlations Corrilations include: Blasius,laminar, and Haaland
Friction="Blasius"

roughness = 1*10**-4
Hc = 0.35 #Active Height of Core is 2m
Qth = 3*10**6 #Core Thermal Production - W
#Mdot = #Total mass flow rate for the reactor. This will then be divided for subchannels.
Expand Down

0 comments on commit e51a6ce

Please sign in to comment.