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

Simple UDF Example

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 19, 2023, 22:05
Smile Simple UDF Example
  #1
Senior Member
 
Brett
Join Date: May 2013
Posts: 216
Rep Power: 14
Bdew8556 is on a distinguished road
Hey guys,

Standard post here, UDF help. No idea where to start.

I'm using Fluent

I've got a model where I'm calculating the velocity through a slice in the domain, that's a report def called "slice velocity"

The outlet to my model is a mass flow rate outlet.

What I would like to do is adjust the mass flow rate outlet after every iteration to target a specific slice velocity.

Any ideas??
Bdew8556 is offline   Reply With Quote

Old   December 21, 2023, 02:24
Default
  #2
Member
 
thedal's Avatar
 
Thamilmani M
Join Date: Sep 2017
Location: IIT Bombay, Mumbai
Posts: 52
Rep Power: 9
thedal is on a distinguished road
If I understood correctly, you are changing your outlet boundary condition specifications after every iteration based on a value?

Try creating DEFINE_PROFILE() may be, and change the boundary condition (massflow rate in your case) and calculate the value based on the slice velocity?
__________________
Always
Thedal
thedal is offline   Reply With Quote

Old   December 21, 2023, 08:19
Default
  #3
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
that is not that trivial task
depends on the difference in geometry of slice and outlet approaches could be different

in case you need average value from slice -> its relatively easier
I don't member exactly, but you may try to make and interior instead of slice, than you would be able to get data from that interior inside UDF

to make an interior you need to split your mash in advance -> you would have 2 zones with same material and a boundary between them with type interior

other option is to write profile of report def called "slice velocity" and attach it to the outlet
you would need TUI script to do that (and it would work smoothly only in case your slice has the same geometry with outlet)
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   December 30, 2023, 23:38
Default
  #4
Senior Member
 
Brett
Join Date: May 2013
Posts: 216
Rep Power: 14
Bdew8556 is on a distinguished road
Thanks guys,

yep looking to change every iteration.

I'm super new to UDFs so I'm completely in the dark, any examples?

I suppose I'm trying to "target" a velocity through the "slice" which is through an internal part of the domain, in this case the area around cooling fins in an electric motor. There is an outlet downstream that I'm setting as mass flow rate.

Any help much loved.
Bdew8556 is offline   Reply With Quote

Reply

Tags
c code, fluent, programmable, 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
Simple UDF for piston movement NicolasCheshire Fluent UDF and Scheme Programming 1 October 7, 2016 11:36
Simple parabolic velocity UDF with symmetry - what am I not understanding!?! NPGrad FLUENT 1 September 30, 2016 12:42
Error in Simple UDF! Abhya Fluent UDF and Scheme Programming 1 March 14, 2013 09:36
FLUENT UDF Simple error. startup0820 Fluent UDF and Scheme Programming 0 August 14, 2012 04:54
simple rigid body motion UDF Dan FLUENT 0 January 11, 2006 06:48


All times are GMT -4. The time now is 14:07.