Introduction
In this exercise, you will investigate one-dimensional flows using the 1D solver available in CFLOW. In total five problems should be solved of which two deals with 1D flow with heat addition and three deals with 1D flow with friction.
OBS Read chapters 1-3 in the course book before starting with the exercise!
When you have done the assignment, you should write a short report and hand in for assessment of this course element (instructions at the bottom of this page).
The CFLOW solver is a solver for simulation of compressible flows based on an explicit time-marching finite-volume-method (FVM) approach for which you can find a thorough description in the lectures on time-marching methods (Lectures 13 and 14). In order to be able to solve the tasks, you will have to make changes to the solver settings in accordance with the task description such as tube geometry, number of cells, number of time steps, boundary conditions, and initial flow properties. In order for the solver to run in a stable manner, you will also need to make changes to the solver numerics settings in some of the cases. In cases with steep gradients or discontinuities, extra damping will be needed. The extra damping is activated in the Numerics section. Pressure damping is used for shocks and density damping is for cases with steep temperature gradients.
Note that for compressible flows, the CFL-number is defined as:
$$CFL=\frac{\Delta t(c+|u|)}{\Delta x}$$
where \(\Delta t\) is the time step size, \(c\) is the speed of sound, \(u\) is the fluid velocity, and \(\Delta x\) is the local cell size. Since the solver uses explicit time marching, it is important that the CFL-number is below unity, otherwise the computation may diverge. You can find more details on the numerics of compressible flow solvers in the lecture notes on time-marching methods.
Detailed description of the solver settings and solver functionality can be found in the solver manual.
Computational Domain
The figure below shows a schematic representation of the computational domain in CFLOW. Note that the solver is of finite-volume-method (FVM) type, which means that it solves for cell averages of flow properties.
Convergence
The convergence history is visualized in the solver log. Depending on task, the number of iterations needed in order to reach convergence will vary. In case the solver is not converged when the specified number of iterations are completed, increase the number of iterations and restart the solver.
Postprocessing
CFLOW will produce graphs of \(\rho\), \(u\), \(p\), \(T\), \(M\), \(p_o\), and \(T_o\) for each obtained solution. Study the graphs and make sure that you can explain what you see.
Export
When done with one of the tasks below, save the CFLOW state to a JavaScript data base file (JSON) using the export functionality. The file can later be used to restore the solver state and should be submitted in Canvas along with the report.
The following tasks should be solved both analytically and numerically. Note that in order to be able to apply the correct boundary conditions in the numerical simulations, you will need to solve the problems analytically first!
Task 1 - 1D flow with heat addition
Task 1a - subsonic flow with heat addition
Heat is added to an air flow through a 0.3 m diameter pipe. The inlet Mach number is \(M_1\)=0.2 and at the inlet plane the air temperature is \(T_1\)=293.0 K and the pressure is \(P_1\)=1.0 bar (1.e5 Pa). Set up the CFLOW Q1D solver for heat addition simulation with a heat addition corresponding to 90% of the heat needed to get thermal choking \((q=0.9 q^\ast)\).
Remember to export the solver state to a JSON-file when you are done with the task.
Geometry definition |
pipe type |
constant-area pipe |
left-end coordinate |
0.0 |
right-end coordinate |
pipe length is not important - use 1.0 m |
Mesh properties |
Number of cells |
100 (refine later if needed) |
Numerics |
Artificial damping (shocks) |
0 - not needed (no shocks) |
Artificial damping (temperature) |
0 - not needed (no steep temperature gradients) |
Time-stepping mode |
local time stepping |
CFL number |
0.9 |
Run parameters |
Number of time steps |
with the specified settings the solver should converge within 20000 iterations - check convergence after completing the simulation though and add more iterations if needed. If you increased the cell count, you will most likely need to increase the number of iterations to get a converged solution. |
Gas properties |
|
use the default settings for air |
Initial flow field |
Initialization mode |
constant values |
Flow field data |
use the exit conditions as initial flow |
Boundary conditions |
Left-end boundary |
subsonic inflow |
Right-end boundary |
subsonic outflow |
Sources |
Wall heat |
90% of thermal choking heat (note! if specified as J/kg you will need to specify the massflow as well) |
Task 1b - supersonic flow with heat addition
Same as Task 1a but with supersonic inlet flow
Heat is added to an air flow through a 0.3 m diameter pipe. The inlet Mach number is \(M_1\)=2.0 and at the inlet plane the air temperature is \(T_1\)=293.0 K and the pressure is \(P_1\)=1.0 bar (1.e5 Pa). Set up the CFLOW Q1D solver for heat addition simulation with a heat addition corresponding to 90% of the heat needed to get thermal choking \((q=0.9 q^\ast)\).
Remember to export the solver state to a JSON-file when you are done with the task.
Geometry definition |
Pipe type |
constant-area pipe |
left-end coordinate |
0.0 |
right-end coordinate |
pipe length is not important - use 1.0 m |
Mesh properties |
Number of cells |
100 (refine later if needed) |
Numerics |
Artificial damping (shocks) |
0 - not needed (no shocks) |
Artificial damping (temperature) |
0 - not needed (no steep temperature gradients) |
Time-stepping mode |
local time stepping |
CFL number |
0.9 |
Run parameters |
Number of time steps |
with the specified settings the solver should converge within 1500 iterations - check convergence after completing the simulation though and add more iterations if needed. If you increased the cell count, you will most likely need to increase the number of iterations to get a converged solution. |
Gas properties |
|
use the default settings for air |
Initial flow field |
Initialization mode |
constant values |
Flow field data |
use the inlet conditions as initial flow |
Boundary conditions |
Left-end boundary |
supersonic inflow |
Right-end boundary |
supersonic outflow |
Sources |
Wall heat |
90% of thermal choking heat (note! if specified as J/kg you will need to specify the massflow as well) |
Task 2 - 1D flow with friction
Task 2a - subsonic flow with friction
Air flows through a 0.3 m diameter pipe with the average friction factor \(\bar{f}=0.005\). The inlet Mach number is \(M_1\)=0.2 and at the inlet plane the air temperature is \(T_1\)=293.0 K and the pressure is \(P_1\)=1.0 bar (1.e5 Pa). Set up the CFLOW Q1D solver for simulation of flow with friction simulation with a pipe length corresponding to 80% of the length needed to get friction choking \(L=0.8L^\ast\).
Remember to export the solver state to a JSON-file when you are done with the task.
Geometry definition |
pipe type |
constant-area pipe |
left-end coordinate |
0.0 |
right-end coordinate |
80% of \(L^\ast_1\) |
Mesh properties |
Number of cells |
100 (refine later if needed) |
Numerics |
Artificial damping (shocks) |
0 - not needed (no shocks) |
Artificial damping (temperature) |
0 - not needed (no steep temperature gradients) |
Time-stepping mode |
local time stepping |
CFL number |
0.9 |
Run parameters |
Number of time steps |
with the specified settings the solver should converge within 5000 iterations - check convergence after completing the simulation though and add more iterations if needed. If you increased the cell count, you will most likely need to increase the number of iterations to get a converged solution. |
Gas properties |
|
use the default settings for air |
Initial flow field |
Initialization mode |
constant values |
Flow field data |
use the exit conditions as initial flow |
Boundary conditions |
Left-end boundary |
subsonic inflow |
Right-end boundary |
subsonic outflow |
Sources |
Wall friction |
0.005 |
Task 2b - supersonic flow with friction
Same as Task 2a but with supersonic inlet flow
Air flows through a 0.3 m diameter pipe with the average friction factor \(\bar{f}=0.005\). The inlet Mach number is \(M_1\)=2.0 and at the inlet plane the air temperature is \(T_1\)=293.0 K and the pressure is \(P_1\)=1.0 bar (1.e5 Pa). Set up the CFLOW Q1D solver for simulation of flow with friction simulation with a pipe length corresponding to 80% of the length needed to get friction choking \(L=0.8L^\ast\).
Remember to export the solver state to a JSON-file when you are done with the task.
Geometry definition |
pipe type |
constant-area pipe |
left-end coordinate |
0.0 |
right-end coordinate |
80% of \(L^\ast_1\) |
Mesh properties |
Number of cells |
100 (refine later if needed) |
Numerics |
Artificial damping (shocks) |
0 - not needed (no shocks) |
Artificial damping (temperature) |
0 - not needed (no steep temperature gradients) |
Time-stepping mode |
local time stepping |
CFL number |
0.9 |
Run parameters |
Number of time steps |
with the specified settings the solver should converge within 1200 iterations - check convergence after completing the simulation though and add more iterations if needed. If you increased the cell count, you will most likely need to increase the number of iterations to get a converged solution. |
Gas properties |
|
use the default settings for air |
Initial flow field |
Initialization mode |
constant values |
Initialization mode |
constant values |
Flow field data |
use the inlet conditions as initial flow |
Boundary conditions |
Left-end boundary |
supersonic inflow |
Right-end boundary |
supersonic outflow |
Sources |
Wall friction |
0.005 |
Task 2c - supersonic friction choking
Same as Task 2b but with friction choking
Air flows through a 0.3 m diameter pipe with the average friction factor \(\bar{f}=0.005\). The inlet Mach number is \(M_1\)=2.0 and at the inlet plane the air temperature is \(T_1\)=293.0 K and the pressure is \(P_1\)=1.0 bar (1.e5 Pa). Set up the CFLOW Q1D solver for simulation of flow with friction simulation with a pipe length corresponding to 150% of the length needed to get friction choking \(L=1.5L^\ast\).
Remember to export the solver state to a JSON-file when you are done with the task.
Geometry definition |
pipe type |
constant-area pipe |
left-end coordinate |
0.0 |
right-end coordinate |
150% of \(L^\ast_1\) |
Mesh properties |
Number of cells |
100 (refine later if needed) |
Numerics |
Artificial damping (shocks) |
0.5 (there will be a shock in the pipe) |
Artificial damping (temperature) |
0 - not needed (no steep temperature gradients) |
Time-stepping mode |
local time stepping |
CFL number |
0.9 |
Run parameters |
Number of time steps |
with the specified settings the solver should converge within 50000 iterations - check convergence after completing the simulation though and add more iterations if needed. If you increased the cell count, you will most likely need to increase the number of iterations to get a converged solution. |
Gas properties |
|
use the default settings for air |
Initial flow field |
Initialization mode |
constant values |
Flow field data |
use the inlet conditions as initial flow |
Boundary conditions |
Left-end boundary |
supersonic inflow |
Right-end boundary |
subsonic outflow |
Sources |
Wall friction |
0.005 |
Assignment Report
In order to complete the assignment, a report should be written and handed in for assessment. A suggested report structure is given below.
For each of the tasks, report the following:
- Analytical solution
- you may include photos/scans of hand-written calculations if you want
- CFLOW solver settings
- you only need to report solver settings if you have used something else than the recommended settings for the task
- Solver convergence
- residual plot (found under convergence in the cflow solver)
- Do you consider the solution to be converged enough? Justify your answer
- Where there any problems getting the solver to converge for this specific case. If so, speculate on the cause for this behavior.
- Results
- Flow field plots (for example Mach number, temperature, pressure and/or any of the other available flow field variables if you find something that is particularly interesting) - flow field plots are found under postprocessing in the cflow solver
- Comment on what you see (are there any specific flow features that can be observed in the results)
- Discussion
- Are there any significant deviations from the analytical solution? If so, what is the reason for the deviations? (it might be difficult to answer exactly but a speculation will do)
- Are there any indications of numerical errors in the solution?
- wiggles in flow field data
- changes in total temperature for cases that should be adiabatic
- changes in total pressure for cases that should be isentropic
- other indications of numerical errors
When done, submit the report along with the exported JSON-files in Canvas