Coder Social home page Coder Social logo

pjazdzyk / ansys-fluent-udf Goto Github PK

View Code? Open in Web Editor NEW
7.0 1.0 2.0 39 KB

User Defined Functions for Ansys Fluent CFD simulations.

License: GNU General Public License v3.0

C 100.00%
ansys ansys-fluent cfd eurocode udf velocity-profiles fluent-udf wind-log-profile fire fire-simulations

ansys-fluent-udf's Introduction

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.

ansys-fluent-udf's People

Contributors

pjazdzyk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.