Home - nagimov/cyclotron-cryopanel GitHub Wiki

Development

File structure

We are going to develop this project using issues-based roadmap. Every issue will be submitted to a separate folder called issue_01, issue_02, etc.

File names has to be more or less consistent within the project, e.g. ode_solver.m, hx_energy_eqn_streams_ab.m, hx_copper_heat_capacity.m, etc.

Results and discussions

Results have to be submitted to the corresponding issue being solved. Pictures (sketches, graphs, etc.) and a brief text description of the result must be attached to the issue as well. Source code files must be committed and pushed to the repo, one folder per issue.

Bugfixes and same-issue updates must be properly described in the commit message and briefly touched in the issue discussion thread (i.e. T_a_in variable changed to T_c_in commit message and variable names fix issue thread comment).

Code agreements

Variable names

Basic properties

  • p - pressure [kPa]
  • h - enthalpy [J/kg]
  • u - internal energy [J/kg]
  • T - temperature of the stream [K]
  • T_wA - temperature of wall A - between top/bottom [K]
  • T_wB - temperature of wall B - between left/right sides of the cryopanel [K]
  • S - entropy [J/(kg*K)]
  • Q - heat [J]
  • rho - density [kg/m^3]
  • V - volume [m^3]
  • M - mass [kg]
  • m - mass flow [kg/s]
  • F - volumetric flow [m^3/s]
  • x - quality (percentage of the liquid at a two-phase state), 0 <= x <= 1
  • As - surface area [m^2]
  • Ac - cross sectional area [m^2]
  • diam - diameter [m]
  • radius - radius [m]

Heat transfer properties

  • sigma - Stefan-Boltzmann constant 5.676e-8 [W/m^2 * K^4]
  • Cp - isobaric heat capacity [J/kg * K]
  • F - radiation heat transfer view factor
  • K - conductive heat-transfer coefficient in solid [W/K]
  • L - conductive heat-transfer coefficient in liquid [W/K]
  • Pr - Prandtl number
  • mu - viscosity [Pa * s]

Derivatives

  • dudt - Delta of internal energy w.r.t. time
  • dhdx - Delta of enthalpy energy w.r.t. length
  • dTdx - Delta of temperature w.r.t. length
  • dTdt - Delta of wall temperature w.r.t. time

Solver parameters

  • CP_dump - How often do we dump the cool prop library
  • SW1 - 0 for counter-current, 1 for co-current
  • SW2 - 0 for linked streams, 1 for non-linked streams
  • eps - Error between function and zero in fsolve
  • t - How many time steps?
  • delta_t - Time delta between time steps

Indexing streams

  • streams are indexed with letters, e.g. p_a, T_b
  • inlets and outlets are indexed with _in and _out, e.g. p_a_in, T_b_out
  • initial conditions are _init
  • external temperature for radiation is _ext
  • cond - conduction
  • rad - radiation
  • nom - means nominal values

Heat exchanger parameters

  • HX_UA - total heat-exchange coefficient (UA) [W/K]
  • HX_slices - number of length slices
  • Wall_slices - number of wall slices
  • N - total number of slices across heat exchanger (1+Wall_slices+1 if two streams)

If the heat flux is constant, we use the subscript to describe the streams between which heat transfer is taking place. For example HX_UA_bc means the heat flux is from stream B to stream C

  • HX_L - total heat exchanger length (L) [m]
  • b_x - wall width [m]

Units

Since there's no internal functionality of MATLAB to keep track of units, we are working in SI units everywhere. A special care has to be taken with REPFOP outputs, since those are sometimes are not in SI (e.g. pressure is in kPa).

Project features

Calculation of flow conditions

For gases, it is easy to describe a current thermal state of the fluid using pressure and temperature. In our case, we are dealing with two-phase flows, so we are going to use pressure and enthalpy as a base fluid state parameters. When the temperature and quality of the flow is specified, the first step is to convert that to pressure-enthalpy coordinates.