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

Fluent do not use my velocity field(by UDF) to solve energy equation

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 21, 2019, 10:18
Default Fluent do not use my velocity field(by UDF) to solve energy equation
  #1
New Member
 
tang lei
Join Date: Jan 2019
Location: Shenzhen China
Posts: 15
Rep Power: 7
tangleiplus is on a distinguished road
Fluent do not use my velocity field(by UDF) to solve energy equation
Hello, everyone.
Rencently, I am dealing with a case described as followsI simplified the problem, in order to describe it clearly)
There is cylinder pipe, which have an inlet and outlet.
The bondery condition is :
Inlet: velocity-inlet,constant temperature
outletressure-outlet
wall:constant temperature
The thing is that, I got an analytic solution of the velocity field. so I frozen the momentum equation, and only solve the energy equation.
To do this, I have written a UDF file to set the value of velocity field of all the fluid cell zone.
Then, I begin to calculate the case.but the result is very strage. Fluent read my velocity field correctly (both CFD-POST and monitor plot can aprove this). But the temperature field is incorrect.
Then I did several more tests. The result is the same. And I find that. Fluent can always read my velocity field(by UDF), but when fluent solveing energy equation, it wont use my u,v,w. Fluent always use the initial value to solve the equation.
I compile UDF with the MACRO DEFINE_EXCUTE_AT_END. then I have tried other MOCROs,including DEFINE_ADJUST, DEFINE_PROFILE(cell zone fixed velocity u,v,w). The result is still the same, the software read my velocity correctly, but still use the initial velocity value to solve the energy equation.
BTW, I use interpreted UDF, does it matters?
OK this is a long story. If you have any idea about my problem please give me some advise.
An other thing is, I have to adjust the velocity field according to the result during the solving process, so I can not just simply set a fixed initial field using DEFINE_INIT.
Thanks.
tangleiplus is offline   Reply With Quote

Old   January 21, 2019, 11:48
Default
  #2
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,761
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
If Fluent always takes the initial value to solve the energy equation, then just use your UDF to set the initial value. What is the initial value? Just change it.



Also try using the fixed values option in cell zones.
LuckyTran is offline   Reply With Quote

Old   January 21, 2019, 12:00
Default
  #3
New Member
 
tang lei
Join Date: Jan 2019
Location: Shenzhen China
Posts: 15
Rep Power: 7
tangleiplus is on a distinguished road
Quote:
Originally Posted by LuckyTran View Post
If Fluent always takes the initial value to solve the energy equation, then just use your UDF to set the initial value. What is the initial value? Just change it.



Also try using the fixed values option in cell zones.
Thank you.But the thing is not that simple. The velocity field is changing during the solver running. but the DEFINE INIT can be juat loaded once when at the beginning.
tangleiplus is offline   Reply With Quote

Old   January 21, 2019, 12:55
Default
  #4
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,761
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
Oh I missed the part where you mentioned that the velocity changes every iteration/time-step.


Well you can still use patch fields to set the new initial velocity each time according to your profile. Or you can still also use fixed values.
LuckyTran is offline   Reply With Quote

Old   January 21, 2019, 19:51
Default
  #5
New Member
 
tang lei
Join Date: Jan 2019
Location: Shenzhen China
Posts: 15
Rep Power: 7
tangleiplus is on a distinguished road
Quote:
Originally Posted by LuckyTran View Post
Oh I missed the part where you mentioned that the velocity changes every iteration/time-step.


Well you can still use patch fields to set the new initial velocity each time according to your profile. Or you can still also use fixed values.
I have teied cell zone fix value. Nothing changed. the situation is the same but how to use patch to deal with it?
tangleiplus is offline   Reply With Quote

Old   January 21, 2019, 21:05
Default
  #6
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,761
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
Try again. You must've messed something up if even fixed values did not work.


Patch just allows you to overwrite a field. You still need to freeze and fix the fields.
LuckyTran is offline   Reply With Quote

Old   January 21, 2019, 22:28
Default
  #7
Senior Member
 
Join Date: Feb 2010
Posts: 164
Rep Power: 17
gearboy is on a distinguished road
Quote:
Originally Posted by tangleiplus View Post
Thank you.But the thing is not that simple. The velocity field is changing during the solver running. but the DEFINE INIT can be juat loaded once when at the beginning.
You can first define the initial velocity field using DEFINE_INIT, then Enter menu "solve->controls", push the button "Equations" and then uncheck the "Flow" equation. This will notify Fluent that you won't solve velocity field anymore. Fluent will always use the inital velocity value in later computation.
gearboy 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
ATTENTION! Reliability problems in CFX 5.7 Joseph CFX 14 April 20, 2010 16:45
How to solve a scalar equation with Fluent Tomik FLUENT 1 January 8, 2006 07:18
how solve a scalar equation with Fluent tomik FLUENT 0 January 5, 2006 07:38
UDF to switch on energy equation after X iteration mat w FLUENT 6 December 5, 2005 08:35
Why FVM for high-Re flows? Zhong Lei Main CFD Forum 23 May 14, 1999 14:22


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