|
[Sponsors] |
August 14, 2013, 10:30 |
How to set more than one UDF?
|
#1 |
New Member
Alex Lozovskiy
Join Date: Aug 2013
Posts: 11
Rep Power: 13 |
Is there a way to define UDFs for more than one boundary condition?
I prepare several files in a form Code:
/********************************************************************** unsteady_pressure.c UDF for specifying a transient pressure profile boundary condition ***********************************************************************/ #include "udf.h" DEFINE_PROFILE(unsteady_pres, thread, position) { face_t f; real t = CURRENT_TIME; begin_f_loop(f, thread) { double a = 101000*t; if (a>101000) a = 101000; F_PROFILE(f, thread, position) = a; } end_f_loop(f, thread) } So I assume I need to put all my different functions intended for different boundaries in just one file. How should I do that? Are there any examples? Thanks. |
|
August 15, 2013, 04:15 |
|
#2 |
New Member
alireza
Join Date: May 2013
Location: shiraz
Posts: 11
Rep Power: 13 |
you can use your udf files in a file like this
it was tested. ------------------------------- #include "udf.h" DEFINE_PROFILE(inlet_x_velocity, thread, position) { real x[ND_ND]; /* this will hold the position vector */ real y; face_t f; begin_f_loop(f,thread) { F_CENTROID(x,f,thread); y = x[1]; F_PROFILE(f,thread,position)= 20.- y*y/(.0745*.0745)*20.; } end_f_loop(f,thread) } DEFINE_PROFILE(unsteady_velocity, thread, position) { face_t f; begin_f_loop(f, thread) { real t = RP_Get_Real("flow-time"); F_PROFILE(f,thread,position)= 2000.+ 100*t; } end_f_loop(f,thread) } ----------------------------------------------- |
|
August 15, 2013, 04:42 |
|
#3 |
New Member
Alex Lozovskiy
Join Date: Aug 2013
Posts: 11
Rep Power: 13 |
I already find out the reason. I should have put all three boundary conditions in just one file, with three different functions DEFINE_PROFILE. Befoe I tried to create a separate file for each, which was a mistake.
Thanks for your time. |
|
Tags |
udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[ICEM] ICEM Scripting Issues | tylerplowright | ANSYS Meshing & Geometry | 33 | September 27, 2021 17:35 |
Instalation on ubuntu 710 | basilwatson | OpenFOAM Installation | 17 | March 16, 2012 21:16 |
How to set a udf like this? | aleisia | Fluent UDF and Scheme Programming | 0 | March 29, 2011 22:50 |
Installation problems | indy | OpenFOAM Installation | 7 | April 3, 2009 10:40 |
OpenFOAM on MinGW crosscompiler hosted on Linux | allenzhao | OpenFOAM Installation | 127 | January 30, 2009 20:08 |