pytanksim.classes.onephasefluidsimclasses
Module for simulating one phase fluid storage tanks without sorbents.
Classes
Base class for one phase fluid simulations. |
|
Class for simulating fluid storage dynamics in the one phase region. |
|
Simulate the dynamics of a fluid tank venting at constant pressure. |
|
Simulates a tank being cooled to maintain constant pressure. |
|
Simulates a tank being heated to discharge at a constant pressure. |
Module Contents
- class pytanksim.classes.onephasefluidsimclasses.OnePhaseFluidSim(simulation_params: SimParams, storage_tank: pytanksim.classes.storagetankclasses.StorageTank, boundary_flux: BoundaryFlux)
Bases:
pytanksim.classes.basesimclass.BaseSimulation
Base class for one phase fluid simulations.
Initialize the BaseSimulation class.
- Parameters:
simulation_params (SimParams) – Object containing simulation-specific parameters.
storage_tank (StorageTank) – Object containing attributes and methods specific to the storage tank being simulated.
boundary_flux (BoundaryFlux) – Object containing information on the mass and energy going in and out of the tank during the simulation.
- Raises:
ValueError – If the simulation is set to begin on the saturation line but the initial values for liquid and gas in the tank, or, alternatively, the initial vapor quality, was not specified.
ValueError – If both the initial values for liquid and gas in the tank is specified as well as the initial vapor quality, but the values don’t match each other.
- Returns:
A simulation object which can be run to get results.
- Return type:
- class pytanksim.classes.onephasefluidsimclasses.OnePhaseFluidDefault(simulation_params: SimParams, storage_tank: pytanksim.classes.storagetankclasses.StorageTank, boundary_flux: BoundaryFlux)
Bases:
OnePhaseFluidSim
Class for simulating fluid storage dynamics in the one phase region.
Initialize the BaseSimulation class.
- Parameters:
simulation_params (SimParams) – Object containing simulation-specific parameters.
storage_tank (StorageTank) – Object containing attributes and methods specific to the storage tank being simulated.
boundary_flux (BoundaryFlux) – Object containing information on the mass and energy going in and out of the tank during the simulation.
- Raises:
ValueError – If the simulation is set to begin on the saturation line but the initial values for liquid and gas in the tank, or, alternatively, the initial vapor quality, was not specified.
ValueError – If both the initial values for liquid and gas in the tank is specified as well as the initial vapor quality, but the values don’t match each other.
- Returns:
A simulation object which can be run to get results.
- Return type:
- solve_differentials(time: float, p: float, T: float) numpy.ndarray
Find the right hand side of the governing ODE at a given time step.
- Parameters:
time (float) – Current time step (in s).
p (float) – Current pressure (Pa).
T (float) – Current temperature (K).
- Returns:
An array containing the right hand side of the ODE.
- Return type:
np.ndarray
- run() pytanksim.classes.simresultsclass.SimResults
Run the dynamic simulation.
- Raises:
TerminateSimulation – Stops the simulation when it detects an event such as hitting the saturation line, or hitting the maximum pressure limit of the tank.
- Returns:
An object for storing and manipulating the results of the dynamic simulation.
- Return type:
- class pytanksim.classes.onephasefluidsimclasses.OnePhaseFluidVenting(simulation_params: SimParams, storage_tank: pytanksim.classes.storagetankclasses.StorageTank, boundary_flux: BoundaryFlux)
Bases:
OnePhaseFluidSim
Simulate the dynamics of a fluid tank venting at constant pressure.
Initialize the BaseSimulation class.
- Parameters:
simulation_params (SimParams) – Object containing simulation-specific parameters.
storage_tank (StorageTank) – Object containing attributes and methods specific to the storage tank being simulated.
boundary_flux (BoundaryFlux) – Object containing information on the mass and energy going in and out of the tank during the simulation.
- Raises:
ValueError – If the simulation is set to begin on the saturation line but the initial values for liquid and gas in the tank, or, alternatively, the initial vapor quality, was not specified.
ValueError – If both the initial values for liquid and gas in the tank is specified as well as the initial vapor quality, but the values don’t match each other.
- Returns:
A simulation object which can be run to get results.
- Return type:
- solve_differentials(time: float, T: float) numpy.ndarray
Solve for the right hand side of the governing ODE.
- Parameters:
time (float) – Current time step in the simulation (s).
T (float) – Current temperature (K).
- Returns:
Numpy array containing values for the RHS of the governing ODE.
- Return type:
np.ndarray
- run()
Run the dynamic simulation.
- Raises:
TerminateSimulation – Stops the simulation when it detects an event such as hitting the saturation line, or hitting the maximum pressure limit of the tank.
- Returns:
An object for storing and manipulating the results of the dynamic simulation.
- Return type:
- class pytanksim.classes.onephasefluidsimclasses.OnePhaseFluidCooled(simulation_params: SimParams, storage_tank: pytanksim.classes.storagetankclasses.StorageTank, boundary_flux: BoundaryFlux)
Bases:
OnePhaseFluidSim
Simulates a tank being cooled to maintain constant pressure.
Initialize the BaseSimulation class.
- Parameters:
simulation_params (SimParams) – Object containing simulation-specific parameters.
storage_tank (StorageTank) – Object containing attributes and methods specific to the storage tank being simulated.
boundary_flux (BoundaryFlux) – Object containing information on the mass and energy going in and out of the tank during the simulation.
- Raises:
ValueError – If the simulation is set to begin on the saturation line but the initial values for liquid and gas in the tank, or, alternatively, the initial vapor quality, was not specified.
ValueError – If both the initial values for liquid and gas in the tank is specified as well as the initial vapor quality, but the values don’t match each other.
- Returns:
A simulation object which can be run to get results.
- Return type:
- solve_differentials(time: float, T: float) numpy.ndarray
Solve for the right hand side of the governing ODE.
- Parameters:
time (float) – Current time step in the simulation (s).
T (float) – Current temperature (K).
- Returns:
Numpy array containing values for the RHS of the governing ODE.
- Return type:
np.ndarray
- run()
Run the dynamic simulation.
- Raises:
TerminateSimulation – Stops the simulation when it detects an event such as hitting the saturation line, or hitting the maximum pressure limit of the tank.
- Returns:
An object for storing and manipulating the results of the dynamic simulation.
- Return type:
- class pytanksim.classes.onephasefluidsimclasses.OnePhaseFluidHeatedDischarge(simulation_params: SimParams, storage_tank: pytanksim.classes.storagetankclasses.StorageTank, boundary_flux: BoundaryFlux)
Bases:
OnePhaseFluidSim
Simulates a tank being heated to discharge at a constant pressure.
Initialize the BaseSimulation class.
- Parameters:
simulation_params (SimParams) – Object containing simulation-specific parameters.
storage_tank (StorageTank) – Object containing attributes and methods specific to the storage tank being simulated.
boundary_flux (BoundaryFlux) – Object containing information on the mass and energy going in and out of the tank during the simulation.
- Raises:
ValueError – If the simulation is set to begin on the saturation line but the initial values for liquid and gas in the tank, or, alternatively, the initial vapor quality, was not specified.
ValueError – If both the initial values for liquid and gas in the tank is specified as well as the initial vapor quality, but the values don’t match each other.
- Returns:
A simulation object which can be run to get results.
- Return type:
- solve_differentials(time: float, T: float) numpy.ndarray
Solve for the right hand side of the governing ODE.
- Parameters:
time (float) – Current time step in the simulation (s).
T (float) – Current temperature (K).
- Returns:
Numpy array containing values for the RHS of the governing ODE.
- Return type:
np.ndarray
- run()
Run the dynamic simulation.
- Raises:
TerminateSimulation – Stops the simulation when it detects an event such as hitting the saturation line, or hitting the maximum pressure limit of the tank.
- Returns:
An object for storing and manipulating the results of the dynamic simulation.
- Return type: