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

Passing values to reference values from UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 27, 2018, 14:24
Post Passing values to reference values from UDF
  #1
New Member
 
Mohamed Saied Sayed
Join Date: Dec 2018
Posts: 5
Rep Power: 7
mohamed_abdelgawad is on a distinguished road
Hello everyone
I am simulating a re-entry vehicle at hypersonic speed and high altitude (80 KM). I use a UDF to calculate the pressure profile and using ideal gas. I use transient solver.

So the question I would like to ask you is:
How to pass the calculated pressure value from the UDF to apply at the REFERENCE VALUES at each time step?

Thanks
mohamed_abdelgawad is offline   Reply With Quote

Old   December 28, 2018, 10:37
Default
  #2
New Member
 
Join Date: Jun 2018
Posts: 8
Rep Power: 7
RCamp is on a distinguished road
Do you want the reference values to be used in your next calculation of your UDF or do you mean the reference values Ansys uses for post processing?
RCamp is offline   Reply With Quote

Old   December 28, 2018, 11:12
Default
  #3
New Member
 
Mohamed Saied Sayed
Join Date: Dec 2018
Posts: 5
Rep Power: 7
mohamed_abdelgawad is on a distinguished road
I want the calculated pressure value from the udf to be set to the reference value for the next post processing
mohamed_abdelgawad is offline   Reply With Quote

Old   December 28, 2018, 11:14
Default
  #4
New Member
 
Mohamed Saied Sayed
Join Date: Dec 2018
Posts: 5
Rep Power: 7
mohamed_abdelgawad is on a distinguished road
Simply we can say that the reference values doesn’t update according to the calculated values from the UDF and i want to ubdate it every time step
mohamed_abdelgawad is offline   Reply With Quote

Old   December 28, 2018, 12:18
Default
  #5
New Member
 
Join Date: Jun 2018
Posts: 8
Rep Power: 7
RCamp is on a distinguished road
Okay and which DEFINE Marco are you using ?
RCamp is offline   Reply With Quote

Old   December 28, 2018, 12:26
Default
  #6
New Member
 
Mohamed Saied Sayed
Join Date: Dec 2018
Posts: 5
Rep Power: 7
mohamed_abdelgawad is on a distinguished road
DEFINE_PROFILE(pr_mag, thread, position)
mohamed_abdelgawad is offline   Reply With Quote

Old   December 30, 2018, 19:43
Default
  #7
New Member
 
Join Date: Jun 2018
Posts: 8
Rep Power: 7
RCamp is on a distinguished road
I am not sure if there’s a very direct way to do this. You might want to look into DEFINE_EXECUTE_AT_END.
RCamp is offline   Reply With Quote

Old   December 30, 2018, 21:24
Default
  #8
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
As RCamp mention you should use DEFINE_EXECUTE_AT_END macro, if you want to make calculation after timestep. DEFINE_PROFILE is macro to set boundary condition.

about your first question:
What is your exact question, are you just lazy to set reference values manually, if yes, it means you don't really need to update it on each timestep. In that case you may create scheme file, which will read some value from your UDF and apply it to reference value:
1. using TUI command you may apply reference value. Type in fluent console
" report reference-values pressure *SOME VALUE* "
2. workflow:
- create variable in scheme
- calculate pressure in UDF
- set scheme variable value
- execute scheme file, which will run TUI command, using scheme variable value with reference pressure

best regards
AlexanderZ is offline   Reply With Quote

Old   December 31, 2018, 08:09
Default
  #9
New Member
 
Mohamed Saied Sayed
Join Date: Dec 2018
Posts: 5
Rep Power: 7
mohamed_abdelgawad is on a distinguished road
Hello Alexander
Thanks for your help but my reference variables change every time step according to the calculated values from the UDF so if you have a code that can do that i will be so thankful
mohamed_abdelgawad is offline   Reply With Quote

Reply

Tags
reference -values, udf


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
Domain Reference Pressure and mass flow inlet boundary AdidaKK CFX 75 August 20, 2018 05:37
Simulation of a single bubble with a VOF-method Suzzn CFX 21 January 29, 2018 00:58
Periodic (rotational)flow: a bit of confusion concerning reference values Mr.Goodcat FLUENT 0 March 22, 2016 07:31
compile error about FJMPI chiven OpenFOAM Installation 11 March 31, 2010 06:27
G95 + CGNS Bruno Main CFD Forum 1 January 30, 2007 00:34


All times are GMT -4. The time now is 08:55.