|
[Sponsors] |
October 12, 2016, 04:33 |
udf
|
#1 |
Member
mahya
Join Date: Jul 2016
Posts: 45
Rep Power: 10 |
who can write a udf for this equation
zeta=-0.2T-78.2 |
|
October 12, 2016, 04:57 |
|
#2 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
I can do that!
Code:
#include "udf.h" DEFINE_ON_DEMAND(udf_for_this_equation) { Message("zeta=-0.2T-78.2\n"); } |
|
October 12, 2016, 05:13 |
|
#3 |
Member
mahya
Join Date: Jul 2016
Posts: 45
Rep Power: 10 |
||
October 12, 2016, 05:24 |
|
#4 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Of course you can use it for anything you want.
I can not imagine that it is useful for you, because I had no idea what you needed because your question is too vague. You never said what the UDF should do, only that it should be for the equation "zeta=-0.2T-78.2", so what my UDF does is print this equation. If you want the UDF to do something else, be more specific. |
|
October 12, 2016, 05:32 |
|
#5 | |
Member
mahya
Join Date: Jul 2016
Posts: 45
Rep Power: 10 |
Quote:
i attach my udf in this udf i should add (zeta_p) with above equation because this udf should use (zeta_P) for the other part |
||
October 12, 2016, 05:35 |
|
#6 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
So, what is the difficult part for you?
The minus sign? The constants? The multiplication? The "T"? Where are you stuck? |
|
October 12, 2016, 05:41 |
|
#7 | |
Member
mahya
Join Date: Jul 2016
Posts: 45
Rep Power: 10 |
Quote:
and when i add this equation to my udf . i see this error 'zeta_p' : undeclared identifier 'T' : undeclared identifier i dont know what should i write in my code to declare it you know , i dont have the amount of(T) my codes should catch (T) from fluent i dont know how should i write it |
||
October 12, 2016, 06:03 |
|
#8 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
I understand that it is difficult to tell the computer what you want, if you don't speak the language of the computer.
But I am a human. Use human words for me. Talk to me like you would talk to your neighbor. You write "my codes should catch (T) from fluent". You make me guess what "T" is. Why? I guess you need temperature, but why don't you just say "temperature"? About the undeclared identifier: If you use "zeta_p" in your code, the program needs to know what to expect. Is zeta_p a number? Text? A complicated data structure? The program needs to know that so it knows how much memory to reserve for it. Basically you need to tell to the computer: "zeta_p is a number." But in the c-code, that is not enough, because there are many kinds of numbers. Small numbers, big numbers, whole numbers, numbers with fractional parts... The kind of number that you need is a floating point number, which basically means that there can be digits behind the point. So you want to tell the computer: "zeta_p is a floating point number." And the way to say that in c-code: "float zeta_p;" The c-language that Fluent uses, wants to know what all variables are before you do anything else. That is why in your code, the function starts with the "real ..." declarations. You should put your declaration for zeta_p in between/directly above/directly below these declarations. You see, if you give some context, it is much easier for other persons to give a useful answer! |
|
October 12, 2016, 06:11 |
|
#9 | |
Member
mahya
Join Date: Jul 2016
Posts: 45
Rep Power: 10 |
Quote:
Because i know what i want I think the other person know what i mean You say write ,i should explain more |
||
October 12, 2016, 06:23 |
|
#10 | |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Quote:
Real story: one group was told that the 'mu' of their design was too high. In their world, 'mu' meant dynamic viscosity, so they spent a few weeks to find out if they could use another gas with lower viscosity. After these weeks, they showed their result, and then they found out that for the one who asked the question, 'mu' meant electromagnetic permeability. |
||
October 12, 2016, 06:23 |
|
#11 |
Member
mahya
Join Date: Jul 2016
Posts: 45
Rep Power: 10 |
first :Code should be written so that the temperature of the cells take in FLUENT.
second:The temperature must be entered zeta potential equation. And the zeta potential can calculate the electric field and other things I want i want to know which coded should be written for task 1 and 2? |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF Compilation Error - Loading Library - COMMON Problem! Help! | robtheslob | Fluent UDF and Scheme Programming | 8 | July 24, 2015 01:53 |
Parallelize UDF? Which kind of UDF? | Lilly | FLUENT | 5 | March 25, 2014 03:05 |
Help! Delete the UDM codes in the UDF | Messi | Fluent UDF and Scheme Programming | 2 | January 28, 2014 10:01 |
UDF parallel error: chip-exec: function not found????? | shankara.2 | Fluent UDF and Scheme Programming | 1 | January 16, 2012 23:14 |
UDF, UDF, UDF, UDF | Luc SEMINEL | Main CFD Forum | 0 | November 25, 2002 05:01 |