CFD Toolbox: The CFD practitioner’s Swiss Army Knife

This page serves as documentation for the CFD Toolbox, a free Google chrome extension that can be downloaded from chrome web store.

When we set up CFD simulations, there is a lot of input required. Some software may hide some of that from us and try to guess sensible default values, while other codes may require the user to specify the smallest of details explicitly. There are common tasks that need to be done over and over again and the goal of the CFD Toolbox is to provide a set of calculators that are specific to CFD applications and create a quick setup and processing of simulation results.

The following calculators are included:

  • Y+ Calculator: Based on freestream properties, a reference length, and the desired target Y+ value, the size of the first cell is calculated. If you need a refresher on the calculation of the Y+ value, then look at my write up the Y+ value and its importance for mesh generation.
  • Turbulence Boundary Conditions: This calculator requires similar freestream parameters and a description of the flow (i.e. internal/external flow). Based on this input, it approximates the turbulence length scale and turbulence quantities that can be specified at the inlet as freestream condition for pretty much any turbulence model (Spalart-Allmaras, k-\epsilon, k-\omega and k-\omega SST, Reynold Stress Models, and transitional RANS models).
  • Grid Convergence Study: This calculator provides capabilities to calculate the mesh-induced uncertainty on the solution. It uses the widely adopted concept of the grid convergence index (GCI). The calculator also allows you to determine the optimal number of cells and obtain the expected value through the Richardson extrapolation. If you want to find out more about its use cases, limitations, and common pitfalls, I have written an in-depth review of the grid convergence study.
  • Parallel computations: This calculator estimates how many cores/processors you should use for parallel simulation to achieve a good trade-off between parallel efficiency and computational speed. It allows you to specify the size of your simulation and what type of solver you want to use (commercial/open-source/in-house), which will be used to determine the number of cores.
  • CO2 Calculator: What’s that got to do with CFD? Read the section and look at the example to get an idea, in short, if you are using CFD and you are engaging in high-performance computing, you are consuming a considerable amount of energy which may release a significant level of CO2 depending on how the energy was generated to operate the cluster. This calculator provides a means to estimate the equivalent CO2 levels based on average electricity energy generation techniques.
  • International Standard Atmosphere (ISA) Calculator: When dealing with aeronautical applications, freestream conditions are usually set in accordance with the international standard atmosphere. This calculator provides values for the thermodynamic quantities which are based only on the height within the atmosphere and temperature on the ground / mean sea level (MSL).

In the following sections, each calculator is discussed in detail, explaining each input and output for each calculator.

Y+ Calculator

Remember that there is a theory writeup on the Y+ value computation here: The Y+ value and its importance for mesh generation.

The Y+ calculator has the following inputs

Flow properties

  • Velocity: This is the velocity in the freestream / undisturbed flow region. Typically taken at the inlet.
  • Density: Equally considered to be the density in the freestream / undisturbed flow region. Typically taken at the inlet. If it is an incompressible flow without variable density formulation, it is a constant value.
  • Reference length: The reference length should be a characteristic length in the flow domain such as the chord length of an airfoil. It should be the same characteristic length scale that is used to define the Reynolds number.
  • Kinematic Viscosity: Same as the velocity and density, it is the kinematic viscosity at the inlet, typically, i.e. in a region in which the flow is undisturbed. May be constant depending on your flow setup.
  • Target Y+ value: This is the value for the Y+ value that you are trying to achieve. Based on this value, the first cell height will be computed.
  • Correction factor (optional): Y+ values are calculated based on skin-friction approximation for a flat plate. This may not be correct for your case. If you know a correction factor, by how much the first layer height should be multiplied to achieve a desired y+ value, you can specify it here. This correction factor needs to be determined from simulations (measure the actual y+ value you have achieved in your simulation and compare that to the target y+ value, the ratio of the two is the correction factor). For airfoils, a correction factor of 0.5 typically works well.

Inflation layer settings

Based on the flow properties provided, the boundary layer height can be approximated. It is assumed that the boundary layer can develop freely, this may be different in confined spaces such as internal channel and pipe flows. With that knowledge in mind, we can calculate how many inflation layers we would need to cover the entire boundary layer. We have two options here:

  • Specify total number of layers: If you want to limit the number of layers, due to computational resources, for example, set the number of layers you want, and the corresponding growth rate will be calculated.
  • Specify growth rate of layers: If you want to ensure a specific growth rate in your simulation, based on your turbulence modelling requirements, for example, then choose the growth rate by how much subsequent layers should grow. The total number of inflation layers will be calculated.

The algorithm behind the inflation layer calculation is based on a Newton-Raphson implementation to iteratively find the solution. This means that the algorithm may be prone to wrong results if the first cell height is close to the boundary layer height. Results need to be judged accordingly. Y+ values close to 1 usually give good results, y+ values larger than that need to be judged on a case by case basis.

The Y+ calculator has the following outputs

Results

  • First Cell Height: This is the height of the first cell adjacent to your wall boundaries for which we have calculated a cell height based on the target Y+ value above.
  • Reynolds number: based on the flow properties provided, the Reynolds number can be calculated and is shown here.

Turbulence Boundary Conditions

The Turbulence Boundary Conditions calculator has the following inputs

Flow properties

  • Velocity: Same definition as provided for velocity in Y+ calculator, see above.
  • Density: Same definition as provided for velocity in Y+ calculator, see above.
  • Reference length: Same definition as provided for velocity in Y+ calculator, see above.
  • Kinematic Viscosity: Same definition as provided for velocity in Y+ calculator, see above.
  • Turbulence Intensity: This is the turbulence intensity in the freestream, provided in percent. It is defined as
I=\frac{\sqrt{u'^2}}{U},

where I is the turbulence intensity, \sqrt{u'^2} the root mean square velocity of the turbulent fluctuations, and U the mean velocity magnitude in the freestream. As a guideline, a low-speed wind tunnel may achieve a turbulence intensity of as little as 0.05%, while a moderate turbulence intensity for external aerodynamics may be considered around 1% – 2%, and internal flows may be as high as 5% – 10%. Use these values as rough guides in the absence of any other data you can consult.

Turbulence length scale calculation

The turbulence length scale can be calculated in a variety of ways and will depend on the flow type. The CFD toolbox differentiates between internal and external flows and also allows to prescribe a custom turbulence length scale in the case that any of the provided methods to approximate the turbulence length scale are insufficient. The following methods are available:

  • Internal flow – Circular pipe: For fully developed pipe flows, the turbulence length scale can be uniquely determined from the hydraulic diameter and for a circular pipe the hydraulic diameter is the same as the pipe’s diameter. Hence, for this input, only the diameter needs to be specified. The turbulence length scale l is then calculated from the hydraulic diameter d_h as
l=0.038\cdot d_h
  • Internal flow – Square pipe: For a square pipe, we simply have to adjust the calculation for the hydraulic diameter. Given the height and width of a square channel’s cross-section (i.e. as seen when looking into the pipe at its inlet) as h and w, respectively, the hydraulic diameter can then be calculated as
d_h=2\frac{wh}{w+h}

The turbulence length scale is then computed the same way as for the circular pipe.

  • External flows / Free wall-bounded boundary layers: In this case, the boundary layer is assumed to develop freely (i.e. no influence from walls or blockages), which is typically the case for external aerodynamic applications. The turbulence length scale is assumed to be a 22% of the height of the turbulent boundary layer. This, we first need to find the height of a fully developed turbulent boundary layer, for which we can use Schlichting’s empirical correlation
\delta_x=0.37\frac{x}{Re^{0.2}},

where delta_x is the height of the boundary layer at a location x downstream of a wall. It is customary to approximate the boundary layer height at its largest possible value, i.e. for the largest x which means that x=L, where L is our characteristic reference length. With that value known, we can take 22% of it to find the size of the turbulence length scale as

l=0.22\cdot\delta_{x,max}
  • Custom turbulence length scale: Use this option if none of the above-described methods are applicable to your case and you would rather directly specify a turbulence length scale that you have either approximated through other means or know from experiments/measurements.

The Turbulence Boundary Conditions calculator has the following outputs

Results

All of the following results should be imposed as inlet boundary conditions (Dirichlet-type).

  • Turbulence length scale: This is the turbulence length scale calculated based on the previously defined calculation (i.e. internal/external flow or custom).
  • Reynolds number: The Reynolds number based on the provided freestream inputs.
  • Modified turbulent viscosity \mathbf{\tilde{\nu}}: This is the modified turbulent viscosity employed by the Spalart-Allmaras model. There is some flexibility in the way it can be calculated. Some suggest taking it as \tilde{\nu}=\sqrt{1.5}UIl while others suggest \tilde{\nu}=5\nu, i.e. the modified turbulent viscosity is five times the normal viscosity. The latter treatment is working better in my experience and thus this is what you will find implemented in the CFD Toolbox.
  • Turbulence Kinetic Energy: This value is calculated from the definition of the turbulence intensity. Recall that we have
I=\frac{\sqrt{u'^2}}{U}

with \sqrt{u'^2} being the root mean square of the turbulence fluctuating velocity. The turbulence kinetic energy is defined as

k=\frac{1}{2}\left(u'^2+v'^2+w'^2\right).

If we now assume that all fluctuations are isentropic, i.e. u'^2=v'^2=w'^2, then we can write

k=\frac{1}{2}(u'^2+u'^2+u'^2)=\frac{1}{2}(3u'^2)=\frac{3}{2}\left(u'^2\right).

Solving for u'^2 we have u'^2=2/3 \cdot k. Now we first square the equation for the turbulence intensity and write the fluctuating velocity component on the left-hand side to get

u'^2=(UI)^2

Inserting our definition for k, we get

k=\frac{3}{2}(UI)^2.

Thus we can see how we use the turbulence intensity as a surrogate to define our turbulence kinetic energy.

  • Dissipation rate: 2 equation models such as the k-\epsilon model typically assume that the turbulence length scale can be computed from the two quantities that the turbulence model is solving for. In the case of k and \epsilon, a correlation that is sufficiently accurate has been determined as
l=C_\mu\frac{k^{3/2}}{\epsilon}.

Since we already have a way of approximating the turbulence length scale l, we can rewrite this correlation as

\epsilon=C_\mu\frac{k^{3/2}}{l}

Here, C_\mu=0.09 is a empirical coefficient that has been found to provide a good agreement with a wide range of applications, and with the turbulence kinetic energy calculated, we can find the dissipation rate with the above correlation.

  • Specific dissipation rate: The specific dissipation rate \omega can be directly obtained from the turbulence kinetic energy k and the turbulence length scale as
\omega=\frac{\sqrt{k}}{l}
  • Reynolds stress tensor: For the Reynolds stress tensor, we typically assume that only stresses on the main diagonal of the Reynolds stress tensor are active in the freestream. We approximate them through the turbulence kinetic energy as
R=\left(\begin{matrix}u'^2 & 0 & 0\\0 & v'^2 & 0 \\ 0 & 0 & w'^2\end{matrix}\right)\approx\left(\begin{matrix}u'^2 & 0 & 0\\0 & u'^2 & 0 \\ 0 & 0 & u'^2\end{matrix}\right)\approx\left(\begin{matrix}2/3k & 0 & 0\\0 & 2/3k & 0 \\ 0 & 0 & 2/3k\end{matrix}\right)
  • Turbulence intermittency: The turbulence intermittency \gamma specifies the ratio between laminar and turbulent flows. A value of \gamma=0 indicates a fully laminar flow while a value of \gamma=1 indicates a fully turbulent flow. A value between 0 and 1 indicates the transition from laminar flow to turbulence. The turbulence intermittency is used in transitional turbulence models such as the transition k-\omega SST 4 equation model. It is set to 1 at the inlet (which may be counter-intuitive but is a requirement by the transition model to work properly).
  • Transitional Reynolds number: The transitional Reynolds number Re_{\theta,t} is the Reynolds number at which flow starts to transition from laminar to turbulent flows. It is used in the k-\omega SST 4 equation model and specified at the inlet (again, counter-intuitive but a requirement by the model, which in itself is a fascinating discussion …) and we can approximate this as
Re_{\theta,t}=\begin{cases}
\begin{aligned}
1173.51 - 589.428\cdot I + 0.2196\cdot I^{-2}\qquad &I\le1.3\% \\
331.5 \cdot (I - 0.5658)^{-0.671}  \qquad  &I>1.3\%
\end{aligned}
\end{cases}
  • Turbulence Kinetic Energy (transitional k-k_l-\omega model): In the transitional k-k_l-\omega model, we have to specify 2 kinetic energies; the turbulence kinetic energy k and the laminar kinetic energy k_l. The turbulence kinetic energy k is set in the same way as the standard turbulence kinetic energy above, i.e. as
k=\frac{3}{2}(UI)^2.
  • Laminar Kinetic Energy (transitional k-k_l-\omega model): The laminar kinetic energy k_l is set to zero at the inlet for the k-k_l-\omega transition model.

Grid Convergence Study

If you are new to the grid convergence index, please look at my write-up on the grid convergence index to understand what it does and how to avoid common pitfalls.

The grid convergence study calculator has the following inputs

Grid properties

  • Number of grid cells on coarse grid: This is the number of cells used to define the coarse grid.
  • Number of grid cells on medium grid: This is the number of cells used to define the medium grid.
  • Number of grid cells on fine grid: This is the number of cells used to define the fine grid.

Note that you must ensure that the fine grid contains more cells than the medium grid, and that the medium grid contains more cells than the coarse grid, otherwise, the calculation will not work as intended.

Solution properties

  • Solution on coarse grid: The is the value of your integral quantity obtained on the coarse grid.
  • Solution on medium grid: The is the value of your integral quantity obtained on the medium grid.
  • Solution on fine grid: The is the value of your integral quantity obtained on the fine grid.

Characteristic length scale calculation

If you have a Cartesian grid with uniformly changing grid spacings, calculating a characteristic length scale may be overkill (you could simply take the square or cube root of your 2D or 3D elements and use that as you characteristic length. However, for cases where we have to deal with a variety of cell sizes, e.g. cases where we want to resolve turbulent boundary layers and require small cells close to walls, or where we have little control over the cell sizes, e.g. unstructured grids, it is necessary to calculate a cell size that is representative for the domain. That cell size may not be present anywhere in your domain but describes an average cell. Based on your simulation dimension (e.g. 1D, 2D, 3D), the characteristic length scale is calculated based on the following formula

h=\left[\frac{1}{N}\sum_{i=1}^N \Delta V_i\right]^{1/D},

where D is the dimension of your simulation and \Delta V_i the length (1D), area (2D) or volume (3D) of the i^{th} cell.

Thus, the following inputs are required for the characteristic length scale computation:

  • Dimension of simulation: Either 1D, 2D or 3D

You may wonder where the volume definition has gone. If we inspect the equation for the characteristic length above, we note that the summation over all cells will return the volume of the entire domain. Since we usually only change the grid spacing within the domain but not the location of the boundaries, the overall volume of the domains does not change during a GCI study.

Since the refinement ratio r_{21}=h_2/h_1 divides the characteristic lengths by each other, and since the volume does not change between simulations, the volume will be divided by itself, and thus it is ignored as an input (you do not have to specify the volume of the domain).

In other sources, you may come across a term such as the effective grid refinement ratio, where we use the fact that the volume is divided by itself when we calculate the refinement ratio, and so it is ignored altogether. It does not matter if you use the effective grid refinement ratio or a refinement ratio based on the characteristic length given above as long as the domain size does not change (which it should not for grid dependency studies).

Target GCI

Optionally, you can also specify what GCI value you would like to obtain in per cent. Based on your results, this toolbox will then proceed to calculate how many cells you would need in order to determine your target GCI value.

Thus, the following input is optional, and no output will be provided if this is left empty

  • Target GCI value [%] (optional): Your target GCI value in per cent.

The grid convergence study calculator has the following outputs

Results

  • GCI32 from coarse to medium grid [%]: The mesh-induced uncertainty for the medium to coarse grid. It is calculated as
GCI_{32}=\frac{1.25\epsilon_{32}}{r_{32}^p-1}

The properties r, p and \epsilon are defined below.

  • GCI21 from medium to fine grid [%]: The mesh-induced uncertainty for the fine to medium grid. It is calculated in a similar manner as
GCI_{21}=\frac{1.25\epsilon_{21}}{r_{21}^p-1}
  • Convergence ratio: The convergence ratio is defined in the following way:
CR=\frac{\phi_2-\phi_1}{\phi_3-\phi_2}

It provides a numerical value to check whether the solution is converging or diverging. This is done by checking the convergence condition, which is introduced next. You can also read my write-up on the convergence condition for more information.

  • Convergence condition: The convergence condition simply classifies the type of convergence that we have based on the convergence ratio CR. The following cases are possible:
    • CR < -1: Oscillatory divergence
    • -1 \le CR < 0: Oscillatory convergence
    • 0 \le CR < 1: Monotonic convergence
    • CR \ge 0: Monotonic divergence

Ideally, we woudl like to achieve monotonic convergence, where the solution converges monotonically to a specific value. This is a prerequisite for the Richardson extrapolation. Oscillatory convergence can occur in cases where transient effects are picked up by the solver, even when it is run ins teady state mode. Both monotonic and oscilatory divergence means we are not approaching a grid indipendent result.

  • Asymptotic range (should be around 1 for convergence): This value will check by how much your GCI has decreased as a result of your mesh refinement going either from the coarse to medium or medium to fine grid. It is calculated as
AR=r^p\frac{GCI_{21}}{GCI_{32}}

As the input suggests, a value close to 1 indicates that further refinement of the mesh will yield diminishing effects in terms of accuracy and thus signals that the mesh has converged to a solution which is independent of the mesh.

  • Numerical order p of solution: The numerical order achieved during the simulation is indicated by this value. Nominal, we would expect this value to be identical or close to our numerical order of the discretization, say p=2 for a second-order spatial discretization. However, this value will be reduced in the presence of grid non-orthogonality. It is iteratively calculated as
\begin{aligned}
p&=\frac{1}{\mathrm{ln}(r_{21})}\left|\mathrm{ln}\left(\frac{\phi_3-\phi_2}{\phi_2-\phi_1}\right)\right| +\left|\mathrm{ln}\left(\frac{r_{21}^p-s}{r_{32}^p-s}\right)\right|, \\
s&=sign\left(\frac{\phi_3-\phi_2}{\phi_2-\phi_1}\right).
\end{aligned}
  • Richardson extrapolated value: This is the value for the integral quantity that we would expect on a grid for which there is no more grid-induced uncertainty, i.e. for the case in which the GCI value goes to zero. It is calculated based on a Taylor Series expansion and can be given as
\phi_{extrapolated}=r_{21}^p\frac{\phi_1-\phi_2}{r_{21}^p-1}
  • Refinement ratio from medium to coarse grid r21: This is the refinement ratio going from the medium to the fine grid. It is calculated as r_{21}=h_1/h_2 and the following always holds true r_{21}>1.
  • Refinement ratio from fine to medium grid r32: This is the refinement ratio going from the coarse to the medium grid. It is calculated as r_{32}=h_2/h_3 and the following always holds true r_{32}>1.
  • Error from medium to coarse grid ε21: This is the relative error going from the medium to the fine grid. It is calculated as \epsilon_{21}=\mathrm{abs}[(\phi_1-\phi_2)/\phi_1].
  • Error from fine to medium grid ε32: This is the relative error going from the coarse to the medium grid. It is calculated as \epsilon_{32}=\mathrm{abs}[(\phi_2-\phi_3)/\phi_2].

Parallel Computations

When the CFD simulation grows beyond a certain number of cells (typically 200,000 cells or more), you may want to consider running simulations in parallel to obtain results faster. Unfortunately, there are lower limits as to how few cells you should have on a per processor count; otherwise, most of your computational time will be spent on waiting for results to be communicated between processors. Thus, we can provide a reasonable estimate as to how many cores should be used as a trade-off between good parallel efficiency and a low computationa cost.

This calculator is a conservative estimator, in that it assumes that your solver is using the message passing interface (MPI) for the parallel implementation. If you have a more parallel implementation, then you may be able to use more cores than what is predicted by this tool.

The parallel computations has the following inputs

Parallel computations

  • How many cells does your grid have?: Specify the number of cells that you have in your grid here.
  • What type of solver are you using?: This option allows you to specify the type of solver you are using, which can be either a commercial, an oopen-source, or in-house code. The differentiation is required as commercial CFD solvers will spend time and money optimising their parallel implementations, while open-source or in-house code don’t (necessarily). If you are using a highly-optimised parallel open-source or in-house CFD solver, select commercial here as well (though open-source and in-house will give you always more conservative estimates).

Results

  • Optimum number of cores: This will tell you how many cores you should use if you are looking for an optimum parallel efficiency at the lowest computational cost. It is restricted to values of 2^N\quad N=1, 2, 3, ... for optimal efficiency. See this as an upper limit, if you don’t have that many cores available, use how ever many you have; your parallel efficiency will likely be better but your computational cost will also be higher.
  • Cells per core: This value will tell you how many cells each core will have to have. For commercial solvers, the calculator will find the number of cores so that you have 50,000 – 100,000 cells per core. From experimentation and seeing results from commercial CFD solver vendors, this seems to be a reasonable estimate for best parallel efficiency. For open-source and in-house solver, this number is doubled, and so we try to have 100,000-200,000 cells per core.

CO2 Calculator

CFD calculations can be one of the most resource-intensive types of simulations you can do. This calculator shows you how much CO2 you are generating with each simulation by calculating the power required to power the resources used and then approximating the amount of CO2 released as part of the energy generation process. If you are using 100% green energy, this calculator may not make sense, but if the electricity you use generates CO2 somewhere along the generation process, then you may want to check what your carbon footprint is.

This calculator is inspired by one of my PhD students who kept submitting Large Eddy Simulations to our university cluster without properly checking the boundary condition setup and results. The student did only look at pressure distributions on 1D plots and they seemed wrong. Once the student asked me to have a look at the results, we quickly identified the issue and were looking at a few months worth of unsuccessful simulations that could have been avoided.

The CO2 calculator has the following inputs

Simulation parameters

  • Number of cores / processors used during calculation: This is the total number of cores used (physical cores, hyperthreading is ignored here). So if you are running with MPI, for example, you have something like mpirun -np X app, where X is the number of cores you use. This is the value you should be putting here. If you are using a pure GPU code with NVIDIA GPUs, then put here the number of GPUs you are using.
  • Number of cores / processors per CPU: This is the number of cores you have available per CPU. A typical CPU on a personal computer has 4 – 6 cores these days. If you are running on a personal PC, use 1 here. If you are running on a cluster requesting a total of 32 cores, and you know that each CPU (in this case, rather, each node) contains 16 cores, then you would specify here 16. This value is then used to calculate a multiplier for how units you actually use as
multiplier=num\_cores / num\_cores\_per\_CPU
  • Peak Power Usage / Thermal Design Point (TDP) of CPU: This is how much energy your processing unit is using (e.g. your CPU (personal PC) or node (cluster)). It is usually given as the thermal design point (TDP) and should be given in units of Watts [W]. With the multiplier defined above, we can then calculate how much energy is required to run the simulation as
power\_required = multiplier*TDP
  • Total duration of simulation: This is the wall clock time, i.e. the duration it takes between starting and finishing the simulation. This is not the total CPU hours, which is a multiplication of the total duration times the number of CPUs. We want to know how long we have been using our resources for so that we can compute power consumption in [kWh]. Specify the duration in hours, and then we can compute the power consumption as (keeping in mind that the thermal design point was given in Watts, not kilowatts)
power\_consumption = \frac{1}{1000}power\_required * duration
  • Price of electricity: This is the cost per unit of electricity, measured in [£/kWh]. If you happen to find yourself outside the beautiful island that is Great Britain (entirely possible), replace £ here mentally with whatever currency makes sense to you. A default value of £0.50 is specified, though you may adjust that to reflect your actual cost of electricity. The default value that is provided is approximated from the Electricity Cost Calculator UK (energyguide.org.uk). With that value, we can calculate the cost in terms of electricity that our simulation produces as
cost=\frac{1}{1000}power\_consumption*electricty\_price\_per\_kWh
  • CO2 emissions produced in kg per kWh: This value is a bit tricky to estimate and will depend on the type of electricity you use. If you use 100% electricity, you may specify 0 here, although you need to make sure that there was no additional CO2 produced between generating the electricity and getting it to your PC / cluster. There typically are losses, and a value of 0 may be unrealistic (unless you plug your PC / cluster straight into your own solar panel). In the absence of any data, use the default value of 0.23 of CO2 in kilograms released per kWh of electricity produced. This value is taken from How much CO2 does my home emit? – Energuide.

The CO2 calculator has the following outputs

Results

  • Total electricity cost for one simulation: This is the energy cost your simulation produces and is the cost value calculated above. Again, replace £ here by any currency you fancy.
  • CO2 emissions produced for one simulation: Since we know the CO2 produced per kWh of generated electricity, we can calculate the amount of CO2 released in kilograms. This is simply calculated as
CO_2\_released = \frac{1}{1000}power\_consumption*CO_2\_emissions\_per\_kWh\_generated
  • How many km you could drive with a compact-sized car to achieve the same level of CO2 emissions: Say you release 1 kg of CO2 for each simulation, how much is that actually? Or what about 100 kilograms? Do you have a feeling what these values mean? It is difficult to build an intuition for the amount of CO2 released without comparing it to something that we can relate to better. Therefore, this output computes how far you could drive with a compact size car (think any entry-level car of any car manufacturer) and gives you an equivalent distance in kilometres that you would be able to drive with your car, which would release the same level of CO2 into the atmosphere. I am assuming that a value of 120 grams/kilometre of CO2 is released, on average, which is a good starting point. If you are driving an electric car, this value may be 0, though only if the electricity generated is 100% and there was no further CO2 released, getting it from the source of electricity generation to your car. Thus, let us assume a normal internal combustion engine car, so we can calculate
distance = CO_2\_released / 0.12

Example

Let’s make these values real. Let’s use some data from a Large Eddy Simulation I ran a while back. I used a total of 128 cores and had 32 cores per node available. The thermal design point was 225 Watts, and I was running my simulations for a total of 672 hours (about a month). Using default values for electricity and CO2 released per kWh of electricity generated, go ahead and calculate how far you can drive by car to generate the same level of CO2. But before you do, just take a guess and see how close you are.

International Standard Atmosphere (ISA) Calculator

When dealing with flows in the atmosphere, typically for aeronautical applications, freestream quantities need to be calculated. The international standard atmosphere was established to allow for comparable calculations where all quantities are fixed based on a reference temperature. All other quantities can then be uniquely calculated for a given height in the atmosphere.

The International Standard Atmosphere (ISA) Calculator has the following inputs

Atmospheric condition input

  • Temperature Unit: Choose your favourite unit for specifying the temperature (choose from Celsius, Kelvin, Farenheit and Rankine).
  • Temperature at Mean Sea Level (MSL): Specify the actual temperature at Mean Sea Level (i.e. at a height of zero above ground). The standard atmosphere is set at 15 degrees Celsius and any deviation of it should be specified as ISA+-temperature. For example, if we calculate the atmospheric conditions at 40 degrees Celsius, then we would specify that as ISA+25 and for 5 degree Celsius at MSL we would have ISA-10.
  • Height Unit: Specify the units in which you want to set the height (currently only meters and feet are supported).
  • Height: Actual value for the height within the atmosphere for which thermodynamic quantities should be computed. Note that the calculation of the atmosphere is limited to a height of 84.8 km.

The International Standard Atmosphere (ISA) Calculator has the following inputs

Results

  • Atmosphere region: Provides a label for the atmospheric region we are in, e.g. Troposphere, Stratosphere, etc.
  • Height [m]: Height in meters, for reference only (in case unit above for height was specified in feet).
  • Temperature [K]: Temperature of the atmosphere. It is approximated by a so called lapse rate which dictates how the temperature will vary (linearly) throughout the atmosphere for different atmospheric regions. The lapse rate can be zero, meaning that temperature remains constant for a specific part of the atmosphere. It is given in units that specify how many Kelvins the temperature in increasing or decreasing per 1000 meter. The following lapse rates are used in the calculator:
    • Troposphere: -6.5 K / 1000 m (0 – 11 km height)
    • Tropopause: 0.0 K / 1000 m (11 – 20 km height)
    • Stratosphere: 1.0 K / 1000 m (20 – 32 km height)
    • Stratosphere: 2.8 K / 1000 m (32 – 47 km height)
    • Stratopause: 0.0 K / 1000 m (47 – 51 km height)
    • Mesosphere: -2.8 K / 1000 m (51 – 71 km height)
    • Mesosphere: -2.0 K / 1000 m (71 – 84.8 km height)
  • Pressure [Pa]: The atmospheric pressure. It is calculated using two different expressions, either for a constant or variable lapse rate.
    • Constant temperature lapse rate: \frac{p_0}{p}=\mathrm{exp}\left(-\frac{g}{RT}(h_0 -h)\right)
    • Variable temperature lapse rate: \frac{p_0}{p}=\left(\frac{T_0}{T}\right)^{-\frac{g}{LR}}
    • Here, both T_0 and p_0 are the reference temperature and pressure, respectively, taken at the starting height of each for each atmospheric layer, g is the gravitational acceleration, L is the lapse rate, R is the universal gas constant (287 J/(kg K) for air), h is the height in the atmosphere and .
  • Density [kg1 m-3]: The atmospheric density. With temperature and pressure available, it can be uniquely determined from the equation of state as \rho=\frac{p}{RT}
  • Speed of sound [m1s-1]: The atmospheric speed of sound. It is calculated as a=\sqrt{\gamma RT}, where \gamma=1.4 for air.
  • Dynamic Viscosity [Pa s]: The atmospheric dynamic viscosity. This can be approximated from Sutherland’s law as \mu=1.458\cdot 10^{-6}\frac{T^{1.5}}{T+110.4}.
  • Kinematic Viscosity [m2s-1]: The atmospheric kinematic viscosity. With the dynamic viscosity available, it can be simply be calculated using \nu=\frac{\mu}{\rho}