.. _knowledge_base_post_processing: Postprocessing *************** .. _nondim_output: Nondimensional Outputs ======================= The following list shows some commonly used nondimensional variables in the output files: .. _tab_nondim_output: .. csv-table:: Reference values for nondimensional outputs in Flow360 :file: Tables/nondim_output.csv :widths: 10,10,60 :header-rows: 1 :delim: @ Besides the above nondimensional quantities, there are also many **coefficients** commonly used in the community of computational fluid dynamics, e.g. pressure coefficient (:math:`C_p`), skin friction coefficient (:math:`C_f`), lift coefficient (:math:`C_L`), drag coefficient (:math:`C_D`), etc. Flow360 also exports the above coefficients found in :ref:`volumeOutput `, :ref:`surfaceOutput `, :ref:`sliceOutput ` as well as the "Forces" tab of web interface. .. caution:: It should be noted that the reference velocity :math:`U_\text{ref}` used to calculate the :math:`C_p, C_f, C_D, C_L` can be set via :code:`freestream->Mach` or :code:`freestream->MachRef` by users. Its definition can be found in the :ref:`case configuration ` page. It is not the same as the reference velocity (:math:`C_\infty`) used for nondimensionalization in :numref:`tab_nondim_output`. The force coefficients and moment coefficients exported by Flow360 are listed in :numref:`tab_force_moment_coef`. These coefficients are shown in "Forces" tab of each case in Flow360 web portal. These coefficients can also be fetched by the :code:`flow360client.case.GetCaseTotalForces(caseId)` python API call. .. _tab_force_moment_coef: .. csv-table:: Force coefficients and moment coefficients exported by Flow360 :file: Tables/forceMomentCoefficients.csv :widths: 10,50 :header-rows: 1 :delim: @ .. note:: In the above table, all quantities in "Definition" column are dimensional. - :math:`U_\text{ref} = \text{"freestream->MachRef"}\times C_\infty`. - :math:`A_\text{ref} = \text{"geometry->refArea"}\times L_\text{gridUnit}^2`. - :math:`L_\text{ref} = \text{"geometry->momentLength"}\times L_\text{gridUnit}` and is an array. The entries :math:`\text{"freestream->MachRef"}`, :math:`\text{"geometry->refArea"}`, :math:`\text{"geometry->momentLength"}` correspond to the values used in the Flow360.json file. History Files ============= At the completion of a case the Flow360 solver will generate up to 9 LOG and CSV files containing run information and the history of important variables. These LOG and CSV files can be downloaded from :ref:`the WebUI ` or via the following python API calls: To download the LOG files, where :code:`caseId` is the alphanumeric case identifier: .. code-block:: python flow360client.case.DownloadSolverOut('caseId', fileName='flow360_case.user.log') To download the history CSV files please use this :ref:`python API command `. .. note:: If your case does not contain a :ref:`BET ` or :ref:`AD ` model, then "bet_forces.csv" and "actuatorDisk_output.csv" will not be available. Except for the data contained within "bet_forces.csv" and "actuatorDisk_output.csv", all the downloadable data mentioned above can be visualized on the WebUI under the **Convergence**, **MinMax** and **Forces** tabs as outlined :ref:`below `. .. _postprocess_tab_img: .. figure:: Figures/webUI_tabs.png :scale: 90% :align: center Tabs to visualize key case history variables. .. [TODO] update Total Force when bet_ad overhaul project is done. .. _total_forces_csv: Total Forces and Moments Coefficients ------------------------------------- The :code:`total_forces.csv` contains the history of the integrated Forces and Moments (F&M) on the following :ref:`boundary entities `. - :code:`NoSlipWall` - :code:`IsothermalWall` - :code:`WallFunction` The :code:`total_forces.csv` file does **NOT** include the F&M on the following entities: - :ref:`BETDisk `, see the :code:`bet_forces.csv` file , for :ref:`BET specific output `. - :ref:`actuatorDisk `, see the :code:`actuatorDisk_output.csv`, for :ref:`AD specific output `. - :ref:`porousMedia `. .. [TODO] update Total Force when bet_ad overhaul project is done. .. _surface_forces_csv: Surface Forces and Moments Coefficients ----------------------------------------- XXXX Add warning about CL and CD subcomponent drag optimization. CL and CD should be optimized as a whole XXXXX XXXX Add warning about CL and CD subcomponent drag optimization. CL and CD should be optimized as a whole XXXXX .. _ADoutput: Actuator Disk Output -------------------- The Actuator Disk (AD) output file, "actuatorDisk_output.csv", has the following headers: ``physical_step, pseudo_step, Disk0_Power, Disk0_Force, Disk0_Moment, Disk1_Power, Disk1_Force, Disk1_Moment ....DiskN_Power, DiskN_Force, DiskN_Moment`` for the N disks. The power columns contains the Cp power coefficient: .. math:: :label: defADPower C_p = \frac{\text{Power (Watts) (kg$\cdot$m$^2$/s$^3$)}} {\rho_{\infty} C_{\infty}^3 L_\text{gridUnit}^2} .. [TODO] update AD output section when bet_ad overhaul project is done. The Force and Moment columns simply report the constant integrated total force and moment as entered by the user. .. [TODO] update BET output section when bet_ad overhaul project is done. .. _betDiskLoadingNote: BET Loading Output ------------------ The Blade Element Theory (BET) output file, “bet_forces.csv”, contains the time history of the following quantities: 1. Integrated x-, y-, z-component of nondimensional forces and nondimensional moments acted on each disk, represented by "Disk[diskID]_Force_x,_y,_z" and "Disk[diskID]_Moment_x,_y,_z", respectively. The nondimensional force is defined as, .. math:: :label: defBETForce \text{Force}_\text{nondimensional} = \frac{\text{Force}_\text{physical} \ \text{(N)}}{\rho_\infty C_\infty^2 L_\text{gridUnit}^2} and nondimensional moment as, .. math:: :label: defBETMoment \text{Moment}_\text{nondimensional} = \frac{\text{Moment}_\text{physical} \ \text{(N$\cdot$m)}}{\rho_\infty C_\infty^2 L_\text{gridUnit}^3} where the moment center is the :code:`centerOfRotation` of each disk, defined in :ref:`BETDisks ` of Flow360.json. .. note:: The above Force and Moment values are forces and moments acting on the **solid**. Forces and moments acting on the **fluid** are the inverse of the above. .. attention:: The x-, y-, z-component of Disk[diskID]_Force and Disk[diskID]_Moment is reported in the global inertial reference frame. This reference frame is defined in the mesh file. .. _bet_section_ct_cq: 2. Sectional thrust coefficient :math:`C_t` and sectional torque coefficient :math:`C_q` on each blade at several radial locations, represented by "Disk[diskID]_Blade[bladeID]_R[radialID]" with suffix "_Radius" (nondimensional), "_ThrustCoeff" and "_TorqueCoeff". The number of radial locations is specified in :code:`nLoadingNodes`. .. note:: :math:`C_t` and :math:`C_q` are sectional loadings, whereas :math:`C_T` and :math:`C_Q` are integrated loads of the entire rotor. That is, :math:`C_t\bigl(r\bigr)=\frac{\text{d}C_T}{\text{d}(r/R)}` and :math:`C_q\bigl(r\bigr)=\frac{\text{d}C_Q}{\text{d}(r/R)}`. The definition of :math:`C_t` is, .. math:: :label: defBETCt C_t\bigl(r\bigr)=\frac{\text{Thrust per unit blade span (N/m)}}{\frac{1}{2}\rho_{\infty}\left((\Omega r)^2\right)\text{chord}_{\text{ref}}}\cdot\frac{r}{R} and :math:`C_q` is, .. math:: :label: defBETCq C_q\bigl(r\bigr)=\frac{\text{Torque per unit blade span (N)}}{\frac{1}{2}\rho_{\infty}\left((\Omega r)^2\right)\text{chord}_{\text{ref}} \cdot R}\cdot\frac{r}{R} where :math:`r` is the dimensional distance between the radial station and the axis of rotation. :math:`\text{chord}_\text{ref}` is the dimensional reference chord length. :math:`R` is the dimensional radius of the rotor disk. .. important:: All the quantities in the right hand side of :eq:`defBETForce`, :eq:`defBETMoment`, :eq:`defBETCt` and :eq:`defBETCq` are **dimensional**, which are different from the **nondimensional** values in :ref:`betDisksInputParameters` of Flow360.json. For example, at the first disk's first blade's first radial location :math:`r=\text{Disk0_Blade0_R0_Radius}\times L_\text{gridUnit}`. The conventions for nondimensional outputs can be found at :ref:`nondim_output`. .. warning:: For steady-state simulations with BET models, the resulting :math:`C_t` and :math:`C_q` are only saved on the first blade, named by "Blade0". They are written as all zeros for other blades, because all the blades have the same sectional loadings in steady BET Disk simulations. For unsteady BET Line simulations, each blade has its own :math:`C_t` and :math:`C_q` values. Here is an example of the header of a "bet_forces.csv" file from a simulation containing two BET disks (assume :code:`nLoadingNodes` = 20, :code:`numberOfBlades` = 3 for each disk):: physical_step, pseudo_step, Disk0_Force_x, Disk0_Force_y, Disk0_Force_z, Disk0_Moment_x, Disk0_Moment_y, Disk0_Moment_z, Disk0_Blade0_R0_Radius, Disk0_Blade0_R0_ThrustCoeff, Disk0_Blade0_R0_TorqueCoeff, Disk0_Blade0_R1_Radius, Disk0_Blade0_R1_ThrustCoeff, Disk0_Blade0_R1_TorqueCoeff, ... Disk0_Blade0_R19_Radius, Disk0_Blade0_R19_ThrustCoeff, Disk0_Blade0_R19_TorqueCoeff, Disk0_Blade1_R0_Radius, Disk0_Blade1_R0_ThrustCoeff, Disk0_Blade1_R0_TorqueCoeff, Disk0_Blade1_R1_Radius, Disk0_Blade1_R1_ThrustCoeff, Disk0_Blade1_R1_TorqueCoeff, ... Disk0_Blade1_R19_Radius, Disk0_Blade1_R19_ThrustCoeff, Disk0_Blade1_R19_TorqueCoeff, Disk0_Blade2_R0_Radius, Disk0_Blade2_R0_ThrustCoeff, Disk0_Blade2_R0_TorqueCoeff, Disk0_Blade2_R1_Radius, Disk0_Blade2_R1_ThrustCoeff, Disk0_Blade2_R1_TorqueCoeff, ... Disk0_Blade2_R19_Radius, Disk0_Blade2_R19_ThrustCoeff, Disk0_Blade2_R19_TorqueCoeff, Disk1_Force_x, Disk1_Force_y, Disk1_Force_z, Disk1_Moment_x, Disk1_Moment_y, Disk1_Moment_z, ... ... ... Disk1_Blade2_R19_Radius, Disk1_Blade2_R19_ThrustCoeff, Disk1_Blade2_R19_TorqueCoeff Aeroacoustic Output -------------------- The aeroacoustic output file has the name "total_acoustics_v3.csv" which contains the overall aeroacoustic results for all wall patches combined. If :code:`writePerSurfaceOutput` has been set to :code:`true` in :ref:`aeroacousticOutput` then "surface_NameOfPatch_acoustics_v3.csv" will also be available for each of the individual wall patches. Each CSV file contains the following headers: "time, physical_step, observer_0_pressure, observer_1_pressure, ... , observer_N_pressure, observer_0_thickness, ... , observer_N_thickness, observer_0_loading, ... , observer_N_loading", where N+1 is the total number of observers specified in the :code:`aeroacousticOutput` section of the case JSON file. The :code:`"_pressure"` columns provide the acoustic pressure signal at the observer locations and the :code:`"_thickness"` and :code:`"_loading"` columns correspond to the thickness and loading noise contributions to the acoustic pressure signal. The output file contains the non-dimensional acoustic pressure signal as a function of time, where time is the non-dimensional time specified in the first column. The second column is the physical step of the simulation at which the time is observed, assuming constant time step size. .. note:: The time of observation is not necessarily contained in the simulation time as it will take a finite amount of time for the acoustic signal to propagate from the solid surfaces to the observers' locations. As each observer can have a different distance from the solid surface, certain observers will have a proper acoustic signal before other observers at any given time. Consequently, the acoustic signal at each observer is padded with zeros at the beginning and the end of the time history, depending on the validity of the acoustic signal. Heat Transfer ------------- The file "surface_heat_transfer_v2.csv" contains surface integrals of the heat flux computed from nondimensional quantities. To find the dimensional heat transfer rate, multiply the nondimensional value by :math:`\rho_{\infty}C_{\infty}^3 L_\text{gridUnit}^2`. Visualization Files =================== Supported visualization output formats are: - ParaView (.pvtu) - Tecplot (.szplt) The export file type as well as the variables exported are selected in the Flow360.json case input file as per :ref:`these conventions`. Data exports are nondimensional. Example dimensional conversions are shown below: Velocity -------- Because the reference value of velocity is :math:`C_\infty` from :numref:`tab_nondim_output`, the dimensional velocity in x-direction can be obtained by multiplying the :code:`velocityX` with the freestream speed of sound. Assuming the freestream speed of sound is 340 m/s and :code:`velocityX` is 0.6 in the ParaView/Tecplot file, then the dimensional velocity in x-direction is :math:`340 \text{ m/s} \times 0.6 = 204 \text{ m/s}`. Pressure -------- The reference value of pressure is :math:`\rho_\infty C_\infty^2` from :numref:`tab_nondim_output`. Assuming the freestream speed of sound is 340 m/s, freestream density is 1.225 kg/m :sup:`3` and :code:`p` is 0.65 in the ParaView/Tecplot file, then the dimensional pressure is :math:`0.65 \times 1.225 \, \text{kg}/\text{m}^3 \times 340^2 \, \text{m}^2/\text{s}^2 = 92046.5 \, \text{Pa}`. Node Force Per Unit Area ------------------------ :code:`nodeForcesPerUnitArea` is the total (pressure + friction) force applied at a node divided by the surface area attributed to the given node. It is particularly useful to calculate sectional loading values. If integrated over the whole surface, :code:`nodeForcesPerUnitArea` would equal the total forces acting on the surface. The reference value to dimensionalize :code:`nodeForcesPerUnitArea` is the same as for pressure :math:`\rho_\infty C_\infty^2`. Skin Friction Coefficient ------------------------- :ref:`As defined`, :code:`CfVec` is the skin friction coefficient vector and :code:`Cf` is the magnitude of that vector. To calculate the viscous stress on the wall: .. math:: :label: fricCoeff \tau_\text{wall} \ \text{(N/m$^2$)} = \text{Cf} \cdot \frac{1}{2}\rho_\infty U_{ref}^2 The :code:`CfVec` vector is very useful to locate regions of boundary layer separation. Fully attached flow follows the surface along the streamwise direction, whereas separated flow induces local recirculation. A strategy to investigate separation is to visualize skin friction in the streamwise direction. For example, consider flow in the x-direction over a wing, regions of negative :code:`CfVecX` indicate boundary layer separation. If we set a visualization scale with 3 levels, say -1e-6, 0 and 1e-6 we will have all the negative values be one color and all the positive values be another, hence we can easily find the regions of separated flows on the surface. See the image below: .. _cfvecXrecirculation: .. figure:: Figures/surfaceRecirculation.png :scale: 70% :align: center The x-component of skin friction coefficient showing the attached (yellow) and separated (dark purple) flow regions on this wing at a high angle of attack. The separated flow regions on the surface can also be visualized by using surface streamlines. Because the velocities on the surface are, by definition of a :code:`NoSlipWall`, equal to 0, the key is to change the surface streamline integration parameters from :code:`velocity{X,Y,Z}` to :code:`CfVec{X,Y,Z}`. .. figure:: Figures/surfaceRecirculationVec.png :scale: 70% :align: center Surface streamlines showing recirculation regions. Pressure Coefficient -------------------- To calculate the dimensional pressure simply use: .. math:: :label: pressDimm p \ \text{(N/m$^2$)} = \text{Cp} \cdot \frac{1}{2}\rho_\infty U_\text{ref}^2 + p_\infty where :math:`p_\infty \ \text{(N/m$^2$)}` is the ambient pressure around the vehicle. As in the pressure at the farfield. .. _totalPressureCoefficientDefinition: Total Pressure Coefficient -------------------------- By definition total pressure is the sum of static pressure $p$, dynamic pressure $q$, and gravitational head. In most applications we can ignore the gravitational head. Total pressure can also be called stagnation pressure because at a stagnation point the velocity is 0, thus the dynamic pressure $q$ term becomes 0 and the total pressure becomes equal to the static pressure $p$ at that stagnation point. As shown in equations 26 and 29 in the appendix of :ref:`this paper`, the total pressure coefficient :math:`C_{pt}` can be calculated using the following formula: .. math:: :label: totalPressCoeff C_{pt} =\frac{\gamma\cdot p \cdot(1+\frac{\gamma-1}{2} \cdot \text{Mach}^2)^{\frac{\gamma}{\gamma-1}}-(1+\frac{\gamma-1}{2} \cdot \text{Mach}_\infty^2)^{\frac{\gamma}{\gamma-1}}}{(\frac{\gamma}{2} \cdot \text{Mach}_\infty^2)} where the heat capacity ratio :math:`\gamma= 1.4` for standard air conditions. The dimensional total pressure can be similarly calculated as with static pressure, .. math:: :label: totalpressDim p_t \ \text{(N/m$^2$)} = C_{pt} \cdot \frac{1}{2}\rho_\infty U_\text{ref}^2 + p_t\infty .. note: Make sure that you have chosen :code:`Mach` and :code:`primitiveVars` as :ref:`volume export` variables when setting up your case. Just like we used :code:`CfVecX` to visualize the surface separation regions :ref:`above `, we can use :math:`C_{pt}` to visualize regions of separation in the flow volume. .. figure:: Figures/CPT.png :scale: 50% :align: center Slice of total pressure coefficient showing separation region on a partially stalled wing. The :math:`C_{pt}` variable is also effective to visualize the boundary layer, if we look at the same slice as above but zoom in on the leading edge, we can see the boundary layer developing. .. figure:: Figures/CPT_ZOOMED.png :scale: 50% :align: center Slice of total pressure coefficient showing the growing boundary layer in blue. Q-Criterion ----------- The :code:`qcriterion` is a very convenient way to visualize vortices in your flowfield. By setting :code:`qcriterion` isosurfaces in your volume solution you can easily identify vortices and gain a better understanding of their behavior. In general, for airplane type simulations, we recommend setting an isosurface value to :math:`\frac{\text{Mach}^2}{\text{Wing Span}^2}`. For rotor dominated flows, we typically recommend :math:`\frac{\text{Tip Mach}^2}{\text{Rotor Diameter}^2}`. Depending on the amount of vorticity in your flow you will have to adapt that metric value to best visualize your vortices. A larger isosurface value will only show stronger vortices. Reducing the isosurface value will visualize weaker vortices, showing more flow features but at the risk of cluttering the visualization. .. figure:: Figures/qcriterion.png :scale: 50% :align: center :code:`qcriterion` isosurface showing strong tip vortex and vortices escaping from the separation region. You will notice that, for this test case, because the volume mesh is quite coarse the :code:`qcriterion` isosurface has a very jagged appearance and the vortex structures dissipate quickly. .. figure:: Figures/qcriterion_mesh.png :scale: 50% :align: center Slice showing the volume mesh. Notice how quickly the mesh coarsens as we move away from the wing and how that affects the :code:`qcriterion` values. If we refine the far field substantially by applying a refinement region we can obtain a much smoother :code:`qcriterion` isosurface showing improved resolution of the vortices escaping from the tip and from the separation bubble. .. figure:: Figures/qcriterion_finer.png :scale: 50% :align: center :code:`qcriterion` isosurface on a finer mesh showing strong tip vortex and vortices escaping from the separation region. You will notice that now, for this refined volume mesh, the :code:`qcriterion` isosurface has a much smoother appearance and the vortex structures propagate much further (i.e., are much less dissipative). .. figure:: Figures/qcriterion_mesh_finer.png :scale: 50% :align: center Slice showing the volume mesh. Finer volume mesh showing the effect on the :code:`qcriterion` dissipation. For more flow images using the :code:`qcriterion` to visualize vortices please see: - :ref:`BET Line flow visualization video ` - :ref:`Wind turbine case study ` - :ref:`Hover prediction workshop paper (figs 9 and 17) ` - :ref:`Rotor modeling techniques paper (figs 11, 12, 26 and 27)` - :ref:`XV 15 BET simulations paper (fig 19) ` - :ref:`Automatic propeller modeling tool Rotor5 paper (figs 4, 18 and 19) ` - :ref:`XV15 DES simulations paper (figs 10, 14 and 17) ` BET Visualization ----------------- An additional option :code:`betMetrics` in :ref:`volumeOutput ` is available to visualize the BET related quantities. This is demonstrated in the :ref:`BET tutorial `.