|
[Sponsors] |
December 4, 2004, 09:15 |
unsteady inlet velocity udf
|
#1 |
Guest
Posts: n/a
|
The udf i am using for my inlet is similar to that of the "unsteady flow in a tube" example from the user's guide. I am modeling a "T" intersection where there are two inlets with different velocity profiles. i have created two udf's and they both compile using the interpreted udf. the problem that i encounter is when i try to set up the bc's. it seems as though i am not able to use both udf's at the same time (one for inlet A and the other for inlet B). If I compile the udf for inlet A and set up the bc everything works fine but then if i try to compile the udf for inlet B I get, "Error: chip exec: function XXX not found". If i try to compile both of them and then set the bc's only the later of the two are in the pulldowns. Can anyone help me? Thank you.
jill |
|
December 4, 2004, 09:47 |
Re: unsteady inlet velocity udf
|
#2 |
Guest
Posts: n/a
|
Maybe I have misunderstood but I think you should compile your 2 UDFs in a single file. So put your code in 1 file and compile it. Then you can hook both of them.Luca
|
|
December 4, 2004, 09:55 |
Re: unsteady inlet velocity udf
|
#3 |
Guest
Posts: n/a
|
No you didn't misunderstand....your response makes a lot of sense and it works now. Thank you very much.
|
|
December 4, 2004, 09:56 |
Re: unsteady inlet velocity udf
|
#4 |
Guest
Posts: n/a
|
you're welcome. Luca
|
|
February 9, 2015, 07:22 |
|
#5 |
New Member
anonymous
Join Date: Jan 2015
Posts: 3
Rep Power: 11 |
Hi. I am not very good at programming. Like the case above was solved by combining the two program in one file. But I do not know how to combine it in one file. Here is my 2 program files,
#include "udf.h" #define T_HOT 306.0 #define T_COLD 300.0 #define KTC_HOT 0.66 /* High thermal conductivity when hot */ #define KTC_COLD 0.64 /* Low thermal conductivity when cold */ DEFINE_PROPERTY(fmwcnt_thermal_conductivity, c, ct) { real temp, ktc_turbulent; temp = C_T(c,ct); if (temp == T_HOT) ktc_turbulent = KTC_HOT; else if (temp == T_COLD) ktc_turbulent = KTC_COLD; else ktc_turbulent = KTC_COLD + (temp - T_COLD)* (KTC_HOT - KTC_COLD)/(T_HOT - T_COLD); return ktc_turbulent; } Here is the second program, #include "udf.h" #define T_HOT 306.0 #define T_COLD 300.0 #define MU_HOT 7.81e-4 /* Low viscosity when hot */ #define MU_COLD 8.81e-4 /* High viscosity when cold */ DEFINE_PROPERTY(fmwcnt_viscosity, c, ct) { real temp, mu_turbulent; temp = C_T(c,ct); if (temp == T_HOT) mu_turbulent = MU_HOT; else if (temp == T_COLD) mu_turbulent = MU_COLD; else mu_turbulent = MU_COLD + (temp - T_COLD)* (MU_HOT - MU_COLD)/(T_HOT - T_COLD); return mu_turbulent; } Thanks |
|
February 9, 2015, 09:13 |
|
#6 |
Senior Member
Cees Haringa
Join Date: May 2013
Location: Delft
Posts: 607
Rep Power: 0 |
Hi,
Basically combining it in one file just means - 1 set of headers and define functions - 2 functions put in the body. So for you that would give: Code:
#include "udf.h" #define T_HOT 306.0 #define T_COLD 300.0 #define KTC_HOT 0.66 /* High thermal conductivity when hot */ #define KTC_COLD 0.64 /* Low thermal conductivity when cold */ #define MU_HOT 7.81e-4 /* Low viscosity when hot */ #define MU_COLD 8.81e-4 /* High viscosity when cold */ DEFINE_PROPERTY(fmwcnt_thermal_conductivity, c, ct) { real temp, ktc_turbulent; temp = C_T(c,ct); if (temp == T_HOT) ktc_turbulent = KTC_HOT; else if (temp == T_COLD) ktc_turbulent = KTC_COLD; else ktc_turbulent = KTC_COLD + (temp - T_COLD)* (KTC_HOT - KTC_COLD)/(T_HOT - T_COLD); return ktc_turbulent; } DEFINE_PROPERTY(fmwcnt_viscosity, c, ct) { real temp, mu_turbulent; temp = C_T(c,ct); if (temp == T_HOT) mu_turbulent = MU_HOT; else if (temp == T_COLD) mu_turbulent = MU_COLD; else mu_turbulent = MU_COLD + (temp - T_COLD)* (MU_HOT - MU_COLD)/(T_HOT - T_COLD); return mu_turbulent; } |
|
February 9, 2015, 09:16 |
|
#7 |
Senior Member
Rick
Join Date: Oct 2010
Posts: 1,016
Rep Power: 27 |
Hi,
simply put them in one files, and do not duplicate headers files (.h) and global variables: Code:
#include "udf.h" #define T_HOT 306.0 #define T_COLD 300.0 #define KTC_HOT 0.66 /* High thermal conductivity when hot */ #define KTC_COLD 0.64 /* Low thermal conductivity when cold */ #define MU_HOT 7.81e-4 /* Low viscosity when hot */ #define MU_COLD 8.81e-4 /* High viscosity when cold */ DEFINE_PROPERTY(fmwcnt_thermal_conductivity, c, ct) { real temp, ktc_turbulent; temp = C_T(c,ct); if (temp == T_HOT) ktc_turbulent = KTC_HOT; else if (temp == T_COLD) ktc_turbulent = KTC_COLD; else ktc_turbulent = KTC_COLD + (temp - T_COLD)*(KTC_HOT - KTC_COLD)/(T_HOT - T_COLD); return ktc_turbulent; } DEFINE_PROPERTY(fmwcnt_viscosity, c, ct) { real temp, mu_turbulent; temp = C_T(c,ct); if (temp == T_HOT) mu_turbulent = MU_HOT; else if (temp == T_COLD) mu_turbulent = MU_COLD; else mu_turbulent = MU_COLD + (temp - T_COLD)*(MU_HOT - MU_COLD)/(T_HOT - T_COLD); return mu_turbulent; }
__________________
Google is your friend and the same for the search button! |
|
February 10, 2015, 03:47 |
|
#8 |
New Member
anonymous
Join Date: Jan 2015
Posts: 3
Rep Power: 11 |
Thanks CeesH and ghost82. The UDF can run by interpreted and it gives what I want. But I cant compiled due to the path error. Izzit compulsory to compiled it?
Thanks |
|
February 10, 2015, 07:04 |
|
#9 |
Senior Member
Rick
Join Date: Oct 2010
Posts: 1,016
Rep Power: 27 |
It is not mandatory to compile this udf. You can interpret it without problems.
__________________
Google is your friend and the same for the search button! |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
3D UDF Paraboilc Velocity Profile (Can't Maintain) | Sing | FLUENT | 12 | August 7, 2017 07:25 |
UDF for Inlet velocity | Mijin Kim | FLUENT | 0 | September 28, 2009 05:50 |
can i set the velocity and pressure at the inlet at the same time by UDF | minyang.cau | FLUENT | 0 | July 15, 2009 00:14 |
UDF Unsteady velocity profile | Rashad | FLUENT | 0 | February 27, 2008 15:57 |
USED UDF for inlet velocity in 3D | sara | FLUENT | 0 | October 11, 2007 19:04 |