CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

How does FLUENT process an UDF!!!!????

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 9, 2015, 06:03
Default
  #21
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
I don't know what you mean by "stopping".

In what aspect is your current UDF not giving you what you want? I can not see the difference between what you want and what you get.
pakk is offline   Reply With Quote

Old   March 9, 2015, 06:21
Default mass flux
  #22
Member
 
Baradwaj B S
Join Date: Jan 2015
Posts: 75
Rep Power: 11
Bharadwaj B S is on a distinguished road
Hello pakk,

PROBLEM :

The problem is on devolatilization( or evaporation) of solid wood sphere. There is a sphere inside a cylindrical flow domain, through which hot air will be allowed to flow. This hot air evaporates the mixture of gases from the surface of the sphere.

For this evaporation I am trying use an UDF. i.e, lets consider there is 1kg of water inside sphere. This gets evaporated to the flow domain continuously. for this I am using F_PROFILE (mass flow rate). After some seconds this 1kg of mass evaporates and the mass inside the sphere gets reduced. Once this mass becomes zero, there will not be any mass flow from the surface of the sphere.

Since I cannot give 1 kg of mass directly in fluent, I am trying to consider a variable named "mass", which is what is in UDF. This "mass" I am reducing by some value (0.05 in this case). So after all the decrement this "mass" becomes zero.

When this mass becomes zero, there should not be any mass flow rate from the surface of the sphere (F_PROFILE = 0.0.

This I am trying to replicate in UDF (reducing mass to decrementing "mass in UDF)

mass = mass - decrement.
if(mass >0 && mass<=1)
F_PROFILE(f,t,i) = -flwrt;
else
F_PROFILE(f,t,i) = 0.0;

Hope you got the details clear.

Thanks in advance,

Bharadwaj B S
Bharadwaj B S is offline   Reply With Quote

Old   March 9, 2015, 06:24
Default
  #23
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
I still can not see the difference between what you want and what you get. Mainly because you don't mention what you get. Why are you not happy with the UDF that you currently have?
pakk is offline   Reply With Quote

Old   March 9, 2015, 06:39
Default Clarification
  #24
Member
 
Baradwaj B S
Join Date: Jan 2015
Posts: 75
Rep Power: 11
Bharadwaj B S is on a distinguished road
Dear pakk,

The mass decrement calculations should end for 3 iterations (i.e when mass = 1.0 once, 2nd iteration mass = mass - decrement (1.0-0.5) and mass = 0.5 - 0.5 (which is zero and gives false). (In this case the mass present inside the sphere is positive, i.e, it can still evaporate).

For only first two values of "mass", F_PROFILE(f, t, i) should be equal to -flwrt; (i.e, 0.05).

For further iterations the calculations will result in "mass < 0". and F_PROFILE(f,t,i) should be equal to 0.0. (condition when all the mass present inside the sphere gets evaporated totally).

Now if you are clear, I think the conditions (mass <=1 && mass >0) are correct up to my knowledge. What would you suggest the condition should be for this problem?

Thanks in advance,
Bharadwaj B S
Bharadwaj B S is offline   Reply With Quote

Old   March 9, 2015, 06:49
Default
  #25
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
You are asking me to help you change something in your UDF, but I don't know why anything should be changed. I don't know how to ask this more clear...

You have a certain set of wishes, that you want the UDF to do. Let's call this set of wishes "A".
If you use your UDF, it does things. Let's call these things "B".

Is A equal to B? If so, be happy. If not, what is the difference?
pakk is offline   Reply With Quote

Old   March 9, 2015, 06:54
Default
  #26
Member
 
Baradwaj B S
Join Date: Jan 2015
Posts: 75
Rep Power: 11
Bharadwaj B S is on a distinguished road
Quote:
Originally Posted by pakk View Post
You are asking me to help you change something in your UDF, but I don't know why anything should be changed. I don't know how to ask this more clear...

You have a certain set of wishes, that you want the UDF to do. Let's call this set of wishes "A".
If you use your UDF, it does things. Let's call these things "B".

Is A equal to B? If so, be happy. If not, what is the difference?
Dear pakk,

I dont know what is wrong with UDF. The UDF logically seems to be OKAY. But this is not giving me the proper results in FLUENT.

I am new to C programming. I could not find the problem with the previous UDF, so posted here.

Thanks in advance,
Bharadwaj B S
Bharadwaj B S is offline   Reply With Quote

Old   March 9, 2015, 06:59
Default
  #27
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
Quote:
Originally Posted by Bharadwaj B S View Post
I dont know what is wrong with UDF. The UDF logically seems to be OKAY. But this is not giving me the proper results in FLUENT.
So you have tried it in Fluent, and you have observed the behavior of your UDF. But you want to keep that behavior secret from me? You can do that if you want, but in that case I can not help you, I'm afraid.

Or did you still not understand my question? I am asking you, already a few times: what does your UDF do? Every time, you answer what it SHOULD do, but that is not the question. If you can answer the question in your next post, I can help you, otherwise I give up.
pakk is offline   Reply With Quote

Old   March 9, 2015, 07:00
Default Results
  #28
Member
 
Baradwaj B S
Join Date: Jan 2015
Posts: 75
Rep Power: 11
Bharadwaj B S is on a distinguished road
Dear pakk,

The results I want,

When mass is greater than zero(mass>0.0) and less than or equal to one (mass <=1), the UDF should go inside the loop and provide some value to F_PROFILE(f,t,i).

When the above conditioon is wrong ( obvioously when mass <0 or negative), compiler should assign F_PROFILE(f,t,i) to 0.0.

First para gives me some mass flow rate. (if true)

Second para gives me no mass flow rate. (i.e if first para is wrong).

Thanks in advance,
Bharadwaj B S
Bharadwaj B S is offline   Reply With Quote

Old   March 9, 2015, 07:03
Default
  #29
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
And again you did not answer my question.

I did not ask you what you WANT, or what the code SHOULD do, because I already know that.
I asked you what you RECEIVED, what the code DID. I am sorry, but I am tired of asking the same simple question over and over, good luck with your problem.
pakk is offline   Reply With Quote

Old   March 9, 2015, 07:10
Default Sorry
  #30
Member
 
Baradwaj B S
Join Date: Jan 2015
Posts: 75
Rep Power: 11
Bharadwaj B S is on a distinguished road
Dear pakk,

This UDF is giving all iterations some mass flow rate. (even after mass has become less than 0.0).

I do not want FLUENT to give me mass flow rate after few iterations (i.e, 2 iterations in my case). But it is giving me that.

QUESTION
How to stop the mass flw rate after the calculations of mass has become 0.0.??

Thanks in advance,
Bharadwaj B S
Bharadwaj B S is offline   Reply With Quote

Old   March 9, 2015, 07:18
Default
  #31
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
This would have answered my question. Good luck with finding the solution.
pakk is offline   Reply With Quote

Old   March 9, 2015, 07:32
Default Extremely sorry
  #32
Member
 
Baradwaj B S
Join Date: Jan 2015
Posts: 75
Rep Power: 11
Bharadwaj B S is on a distinguished road
Dear pakk,

I did not understand the question completely, my mind was stuck only explaining you what I want, instead I should have told you what is happening.
It was completely a misunderstanding and nothing was intentional. Please help me on this programming, I am very much new to the C programming. I have learnt very less in this regard, throughout my graduation.

Thanks in advance,
Bharadwaj B S
Bharadwaj B S is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
looking for a smart interface matlab fluent chary FLUENT 24 June 18, 2021 10:07
solving a conduction problem in FLUENT using UDF Avin2407 Fluent UDF and Scheme Programming 1 March 13, 2015 03:02
Consulting for some issues of FLUENT UDF and UDS wjl163 Fluent UDF and Scheme Programming 2 November 12, 2012 04:24
fluent UDF external library lapack problem Rick FLUENT 0 May 7, 2008 11:16
UDF of Zimont model in fluent Z Main CFD Forum 0 February 17, 2005 04:07


All times are GMT -4. The time now is 03:26.