示例#1
0
    def __init__(self, name, T0, sub_comp=[], timer=Timer()):
        """Initalizes a thermal hydraulic super component.

        :param name: The name of the supercomponent (i.e., "fuel" or "cool")
        :type name: str.
        :param T0: The initial temperature of the supercomponent
        :type T0: float.
        :param sub_comp: List of components that makes up the supercomponent.
        The sub_components should be in order from the center to the outside
        :type sub_comp: list of THComponent
        :param timer: The timer instance for the sim
        :type timer: Timer object
        """
        THComponent.__init__(self, name=name,
                             mat=Material(),
                             vol=0.0*units.meter**3,
                             T0=T0,
                             alpha_temp=0*units.delta_k/units.kelvin,
                             timer=timer,
                             heatgen=False,
                             power_tot=0*units.watt,
                             sph=False,
                             ri=0*units.meter,
                             ro=0*units.meter)
        self.sub_comp = sub_comp
        self.T = units.Quantity(np.zeros(shape=(timer.timesteps(),),
                                         dtype=float), 'kelvin')
        self.T[0] = T0
        self.conv = {}
        self.add_conduction_in_mesh()
        self.alpha_temp = 0.0*units.delta_k/units.kelvin
示例#2
0
def f_th(t, y_th, si):
    """Returns the thermal hydraulics solution at time t

    :param t: the time [s] at which the update is occuring.
    :type t: float.
    :param y: the solution vector
    :type y: np.ndarray
    :param si: the simulation info object
    :type si: SimInfo
    """
    t_idx = si.timer.t_idx(t * units.seconds)
    f = units.Quantity(np.zeros(shape=(si.n_components(), ), dtype=float),
                       'kelvin / second')
    power = si.y[t_idx][0]
    o_i = 1 + si.n_pg
    o_f = 1 + si.n_pg + si.n_dg
    omegas = si.y[t_idx][o_i:o_f]
    for idx, comp in enumerate(si.components):
        f[idx] = si.th.dtempdt(component=comp,
                               power=power,
                               omegas=omegas,
                               t_idx=t_idx)
    return f
示例#3
0
文件: timer.py 项目: tylerweis14/pyrk
    def __init__(self,
                 t0=0.0 * units.seconds,
                 tf=1.0 * units.seconds,
                 dt=1.0 * units.seconds,
                 t_feedback=0.0 * units.seconds):
        """Initialize the timer object. There should be only one.

        :param t0: first times in the simulation
        :type t0: float, units of seconds
        :param tf: last time in the simulation
        :type tf: float, units of seconds
        :param dt: size of the timestep
        :type dt: float, units of seconds
        """
        self.t0 = validation.validate_ge("t0", t0, 0.0 * units.seconds)
        self.t_feedback = validation.validate_ge("t_feedback", t_feedback, t0)
        self.tf = validation.validate_ge("tf", tf, t_feedback)
        self.dt = validation.validate_g("dt", dt, 0.0 * units.seconds)
        self.series = units.Quantity(
            np.linspace(start=t0.magnitude,
                        stop=tf.magnitude,
                        num=self.timesteps()), 'seconds')
        self.ts = 0
        self.t_idx_feedback = self.t_idx(t_feedback)
示例#4
0
#
#############################################

# Timing: t0=initial, dt=step, tf=final
t0 = 0.00 * units.seconds
dt = 0.005 * units.seconds
tf = 5.0 * units.seconds

# Temperature feedbacks of reactivity (Ragusa2009)
# Fuel: Note Doppler model not implemented
alpha_f = (-0.8841 * units.pcm / units.kelvin)
# Coolant
alpha_c = (0.1263 * units.pcm / units.kelvin)

# Initial Temperatures
t_fuel = units.Quantity(525.0, units.degC)
t_fuel.ito(units.kelvin)
t_cool = units.Quantity(440.0, units.degC)
t_cool.ito(units.kelvin)
t_inlet = units.Quantity(400.0, units.degC)
t_inlet.ito(units.kelvin)

# Neglect decay heating
kappa = 0.00

# Geometry
# fuel pin radius
r_fuel = 0.00348 * units.meter
# active core height
h_core = 0.8 * units.meter
# surface area of fuel pin
示例#5
0
文件: input.py 项目: wuhao1938/pyrk
k_cool = 1 * units.watt / (units.meter * units.kelvin)
cp_cool = random.gauss(
    2415.78, 2415.78 * 0.05) * units.joule / (units.kg * units.kelvin)
rho_cool = DensityModel(a=2415.6 * units.kg / (units.meter**3),
                        b=0.49072 * units.kg / (units.meter**3) / units.kelvin,
                        model="linear")

mu0 = 0 * units.pascal * units.second
cool = LiquidMaterial('cool', k_cool, cp_cool, rho_cool, mu0)

# Coolant flow properties
h_cool_rd = random.gauss(
    4700.0, 4700.0 * 0.05) * units.watt / units.kelvin / units.meter**2
h_cool = ConvectiveModel(h0=h_cool_rd, mat=cool, model='constant')
m_flow = 976.0 * units.kg / units.second
t_inlet = units.Quantity(600.0, units.degC)  # degrees C

mod = th.THComponent(name="mod",
                     mat=Moderator,
                     vol=vol_mod,
                     T0=t_mod,
                     alpha_temp=alpha_mod,
                     timer=ti,
                     sph=True,
                     ri=0.0 * units.meter,
                     ro=r_mod)

fuel = th.THComponent(name="fuel",
                      mat=Fuel,
                      vol=vol_fuel,
                      T0=t_fuel,
示例#6
0
文件: min.py 项目: tylerweis14/pyrk
# Timing: t0=initial, dt=step, tf=final
t0 = 0.00 * units.seconds
dt = 0.005 * units.seconds
tf = 5.0 * units.seconds
t_feedback = 0.05 * units.seconds

# Temperature feedbacks of reactivity (Ragusa2009)
# Fuel: Note Doppler model not implemented
alpha_f = (-0.8841 * units.pcm / units.kelvin)
# Coolant
alpha_c = (0.1263 * units.pcm / units.kelvin)

# Initial Temperatures
t_fuel = 737.033 * units.kelvin
t_cool = 721.105 * units.kelvin
t_inlet = units.Quantity(400.0, units.degC)
t_inlet.ito(units.kelvin)

# Neglect decay heating
kappa = 0.00

# Geometry
# fuel pin radius
r_fuel = 0.00348 * units.meter
# active core height
h_core = 0.8 * units.meter
# surface area of fuel pin
a_fuel = 2 * math.pi * r_fuel * h_core
# volume of a fuel pin
vol_fuel = math.pi * pow(r_fuel, 2) * h_core
# hydraulic area per fuel pin
示例#7
0
#############################################
#
# User Workspace
#
#############################################

# Thermal hydraulic params
# Temperature feedbacks of reactivity (ragusa_consistent_2009)
# Doppler
# actually this coeff is to per C^d... crap.
alpha_f = (-0.8841 * units.pcm / units.kelvin)
# Coolant
alpha_c = (0.1263 * units.pcm / units.kelvin)
# below from ragusa_consistent_2009
t_fuel = units.Quantity(525.0, units.degC).to(units.kelvin)
t_clad = units.Quantity(525.0, units.degC).to(units.kelvin)
t_cool = units.Quantity(440.0, units.degC).to(units.kelvin)
t_inlet = units.Quantity(355.0, units.degC).to(units.kelvin)

# [m] ... matrix(4mm) + coating(1mm)
kappa = 0.00  # TODO if you fix omegas, kappa ~ 0.06

# Initial time
t0 = 0.00 * units.seconds

# Timestep
dt = 0.005 * units.seconds

# Final Time
tf = 10.0 * units.seconds
示例#8
0
文件: input.py 项目: tylerweis14/pyrk
#############################################
#
# User Workspace
#
#############################################

# Thermal hydraulic params
# Temperature feedbacks of reactivity (ragusa_consistent_2009)
# Doppler
# actually this coeff is to per C^d... crap.
alpha_f = (-0.8841*units.pcm/units.kelvin)
# Coolant
alpha_c = (0.1263*units.pcm/units.kelvin)
# below from ragusa_consistent_2009
t_fuel = units.Quantity(525.0, units.degC).to(units.kelvin)
t_clad = units.Quantity(525.0, units.degC).to(units.kelvin)
t_cool = units.Quantity(440.0, units.degC).to(units.kelvin)
t_inlet = units.Quantity(355.0, units.degC).to(units.kelvin)

# [m] ... matrix(4mm) + coating(1mm)
kappa = 0.00  # TODO if you fix omegas, kappa ~ 0.06

# Initial time
t0 = 0.00*units.seconds

# Timestep
dt = 0.005*units.seconds

# Final Time
tf = 10.0*units.seconds
示例#9
0
    def __init__(self, name=None,
                 mat=Material(),
                 vol=0.0*units.meter**3,
                 T0=0.0*units.kelvin,
                 alpha_temp=0*units.delta_k/units.kelvin,
                 timer=Timer(),
                 heatgen=False,
                 power_tot=0*units.watt,
                 sph=False,
                 ri=0*units.meter,
                 ro=0*units.meter):
        """Initalizes a thermal hydraulic component.
        A thermal-hydraulic component will be treated as one "lump" in the
        lumped capacitance model.

        :param name: The name of the component (i.e., "fuel" or "cool")
        :type name: str.
        :param mat: The material of this component
        :type mat: Material object
        :param vol: The volume of the component
        :type vol: float meter**3
        :param T0: The initial temperature of the component
        :type T0: float.
        :param alpha_temp: temperature coefficient of reactivity
        :type alpha_temp: float
        :param timer: The timer instance for the sim
        :type timer: Timer object
        :param heatgen: is this component a heat generator (fuel)
        :type heatgen: bool
        :param power_tot: power generated in this component
        :type power_tot: float
        :param sph: is this component a spherical component, spherical
        equations for heatgen, conduction are different,
        post-processing is different too
        :type sph: bool
        :param ri: inner radius of the sph/annular component, ri=0 for sphere
        :type ri: float
        :param ro: outer radius of the sph/annular component,
        ro=radius for sphere
        :type ro: float
        """
        self.name = name
        self.vol = vol.to('meter**3')
        self.mat = mat
        self.k = mat.k
        self.cp = mat.cp
        self.dm = mat.dm
        self.timer = timer
        self.T = units.Quantity(np.zeros(shape=(timer.timesteps(),),
                                         dtype=float), 'kelvin')
        self.T[0] = T0
        self.T0 = T0
        self.alpha_temp = alpha_temp.to('delta_k/kelvin')
        self.heatgen = heatgen
        self.power_tot = power_tot
        self.cond = {}
        self.conv = {}
        self.adv = {}
        self.mass = {}
        self.cust = {}
        self.prev_t_idx = 0
        self.convBC = {}
        self.sph = sph
        self.ri = ri.to('meter')
        self.ro = ro.to('meter')