Skip to content

Latest commit

 

History

History
69 lines (59 loc) · 4.42 KB

README.md

File metadata and controls

69 lines (59 loc) · 4.42 KB

ANSYS FLUENT: USER DEFINED FUNCTIONS (UDF)

VERSION: 1.0.0
DATE: 2022.04.10
LAST UPDATE: 2022.06.17
AUTHOR: Piotr Jażdżyk
LINKEDIN: https://pl.linkedin.com/in/pjazdzyk/en


LOGHARITHMIC WIND PROFILE

FILENAME: EurocodeWindProfile.c
STANDARD: EUROCODE EN 1991-1-4
Interpreted type UDF for Ansys Fluent wind simulations. This UDF implements a vertical velocity profile as the function of height, terrain type, terrain roughness, and reference velocity at a height of 10m. This class follows the strict methodology of the "Eurocode EN 1991-1-4 (2005) Eurocode 1: Actions on structures - Part 1-4: General actions - Wind actions". Function profiles of vx and vy must be hooked into the correct BC in Fluent. To quickly investigate if the velocity profile is correct - just invoke printAll() method. UDF supports user-defined wind direction including also the angle of rotation for the site.

Please note that turbulence parameter profiles are calculated according to Eurocode (turbulent kinetic energy k and turbulence intensity ratio) might be problematic for convergence, and further investigation must be done to properly determine ke and tu profiles.

UDF is may be used as velocity inlet BC for any most large scale aerodynamic wind studies for building industry, for an example:

  • static pressure analysis on building facades
  • wind comfort studies (Lawson criteria)
  • pollution spread in the environment

USER GUIDE:

  1. Determine appropriate reference velocity at height of 10m suitable for your case (for structural analysis use values provided in Eurocode)
  2. Determine your wind direction
  3. Determine your terrain class based on table 4.1 in Eurocode
  4. Adjust fields in UDF file accordingly:
#define WIND_DIR 270.0	<- wind direction in m/s at height of 10m                                                         
#define z0 0.003	<- z0 value based on terrain category from table 4.1 in m                 
#define zMin 1.000	<- zMin value based on terrain category from table 4.1 in m                                      
#define zoneH 400.0	<- your domain height in m                             
#define vB0 22.0	<- velocity at reference height of 10m in m/s                                                       
  1. Under velocity inlet BC, select velocity specified in cartesian coordinate system: vx, by, vz.
  2. Hook x_vel_profile as vx, and y_vel_profile as vy in each velicity inlet BC.
  3. Leave at least one BC as pressure outlet.
  4. Use printAll() method, to check calculated values.

FIRE CURVE

FILENAME: FireCurve.c
Interpreted type UDF for Ansys Fluent SHEVS simulations. This UDF implements a source of heat and soot generation for a volumetric source defined within a computational domain. This macro defines a time-dependent increase of smoke and heat generation based on t^2 function and fire growth coefficient. Source emissions are increased up to the defined HRR_MAX value, from where heat release is constant in time.

USER GUIDE:

  1. Based on your case, determine the maximum heat release rate expected in a given fire simulation scenario (consult local authority to make sure that you follow your local legal requirements. Do not expect that this default value is universal and valid for your case).
  2. Based on the burning material, provide its heat of combustion property and soot yield factor.
  3. Check in SC of in Fluent the volume of your source and adjust the SRC_VOL.
  4. Hook the function in Fluent and set apropriate sources for heat and mass generation.
  5. Use print_test_curve() method before simulation to verify results generated by this UDF.
#define HRR_MAX 2500.0    <- provide your max HRR in kW
#define GROWTH_COEF 0.045 <- adjust fire growth coefficient if required, in kW/s^2
#define SRC_VOL 10.5      <- source geometry volume in m3
#define SOOT_Y 0.12       <- soot yield in kg.soot/kg.fuel
#define HC 25.0           <- burning material heat of combustion in MJ/kg                                                    

Please dont forget to contact me if you spot any parsing errors or convergence issues. Thanks.

LICENSE

Free for academic and educational use, if proper reference source is included with author name. For any other use, contact me first to receive approval.