예제 #1
0
    def __init__(self, name, T0, sub_comp=None, 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 if sub_comp else []
        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
파일: driver.py 프로젝트: samgdotson/pyrk
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
    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
파일: input.py 프로젝트: samgdotson/pyrk
alpha_c = -1.8 * units.pcm / units.kelvin
alpha_m = -0.7 * units.pcm / units.kelvin
alpha_r = 1.8 * units.pcm / units.kelvin
# below from steady state analysis
t_fuel = 955.58086 * units.kelvin
t_cool = 936.57636 * units.kelvin
t_refl = 923.18521 * units.kelvin
t_mod = 937.39862 * units.kelvin
t_graph_peb = 936.40806 * units.kelvin
t_core = 970.54064 * units.kelvin

# the data below comes from design doc rev c

# self._vol_flow_rate = 976.0*0.3 # kg/s TODO 0.3 is nat circ guess
vel_cool = 2. * units.meter / units.second  # m/s
t_inlet = units.Quantity(600.0, units.degC)  # degrees C
# [m] ... matrix(4mm) + coating(1mm)
thickness_fuel_matrix = 0.005 * units.meter
kappa = 0.00  # TODO if you fix omegas, kappa ~ 0.06
core_height = 3.5 * units.meter  # [m] (TODO currently approximate)
core_inner_radius = 0.35 * units.meter  # m
core_outer_radius = 1.25 * units.meter  #

# Initial time
t0 = 0.00 * units.seconds

# Timestep
dt = 0.005 * units.seconds

# Final Time
tf = 5.0 * units.seconds
예제 #5
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')
예제 #6
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
예제 #7
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