CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > CFX

How to perform a simulation with User Function

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree9Likes
  • 2 Post By ghorrocks
  • 1 Post By Opaque
  • 1 Post By feliperoque
  • 1 Post By ghorrocks
  • 2 Post By ghorrocks
  • 1 Post By Yanlu
  • 1 Post By feliperoque

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 27, 2024, 15:06
Default How to perform a simulation with User Function
  #1
New Member
 
Felipe Roque
Join Date: Feb 2024
Posts: 5
Rep Power: 2
feliperoque is on a distinguished road
Hi Folks!


There are some data i would like to use as input in my CFX simulation. My problem relies in a retangular resevoir and one small quadratic area in one of his face which is a boundary condition applied as heat flux.


The data i have it's from a simulation my collegue perfom, which there are two columns time (s) and heat flux (W/mē).

I usually use a fixed value as input of heat flux, but since i'm trying to perfom a more accurate transient analysis on my simulation i would like to use this data that i have.

The normal procedure i use is:

create a BC for heat flux>"boundary details"> "Options"> select "heat flux"> "Heat flux in "i added the fixed value i have, for example -400 W/mē".

What i would like:

create a BC for heat flux > "boundary details> "Options"> select "heat flux"> "Heat flux in "insert the data i have">.

While i was searching i found that i need to create a "User Function" but when i create appears some boxes that i don't know what i should filled with. Like where "Argument Units", "Result Units"...and where i added the file containing my data i like to use?
Attached Images
File Type: png 1.png (49.2 KB, 6 views)
File Type: png 2.png (26.8 KB, 8 views)
Attached Files
File Type: txt Fluxo.txt (22.3 KB, 2 views)
feliperoque is offline   Reply With Quote

Old   February 27, 2024, 16:34
Default
  #2
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,830
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
You are using the correct function, you just need to specify the units correctly.

The argument unit is "t" as argument for looking up the function is time.
The result unit is "W/m2"

You can input this function in several ways, the way I do it is to set up the basic function and then edit the CCL of the function to copy/paste all the data points in.

When you have this set up then you can just define your heat flux boundary to have the heat flux defined by the user function.
Opaque and feliperoque like this.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks is offline   Reply With Quote

Old   February 27, 2024, 17:39
Default
  #3
New Member
 
Felipe Roque
Join Date: Feb 2024
Posts: 5
Rep Power: 2
feliperoque is on a distinguished road
When i set the "Result Units" to "W/m2" CFX return an error (see the img attch). I need to put the "W/m2" to "Wm^-2"?
Attached Images
File Type: jpg 3.jpg (54.5 KB, 9 views)
feliperoque is offline   Reply With Quote

Old   February 27, 2024, 17:42
Default
  #4
Senior Member
 
Join Date: Jun 2009
Posts: 1,860
Rep Power: 33
Opaque will become famous soon enough
Quote:
Originally Posted by feliperoque View Post
When i set the "Result Units" to "W/m2" CFX return an error (see the img attch). I need to put the "W/m2" to "Wm^-2"?
Use Argument Units = s

for time.
feliperoque likes this.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
Opaque is offline   Reply With Quote

Old   February 27, 2024, 17:53
Default
  #5
New Member
 
Felipe Roque
Join Date: Feb 2024
Posts: 5
Rep Power: 2
feliperoque is on a distinguished road
Okay, thx. I change the Argument Unit to "s" and Result Unit to "W m^-2" and works!
Opaque likes this.
feliperoque is offline   Reply With Quote

Old   February 27, 2024, 18:49
Default
  #6
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,830
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Sorry, yes: the variable is "t" but the unit is "s". Thanks for correcting that.
feliperoque likes this.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks is offline   Reply With Quote

Old   February 28, 2024, 10:22
Default
  #7
New Member
 
Felipe Roque
Join Date: Feb 2024
Posts: 5
Rep Power: 2
feliperoque is on a distinguished road
after the setup of "User Function" what should i do on "Solver Control" configuration? I ask this because the data mentioned have 5400s of simulation so i need to config this amount of time? i did some runnings but seams like the simulation don't stop when the limit of data are reached...i wounder why?
Attached Images
File Type: png 666.png (40.9 KB, 6 views)
File Type: png 55.png (25.2 KB, 5 views)
feliperoque is offline   Reply With Quote

Old   February 28, 2024, 16:58
Default
  #8
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,830
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
You have set the simulation to run for 5400s of total time at 0.5s timesteps, so it should do those time steps and stop at 5400s (unless it stops with an error before this). Your user function has no effect on total simulation time - when your user function runs out it will do what you set the user function to do when it goes out of range (that is the "Extend min" and "Extend Max options") - this only sets what the user function returns, it will not stop the simulation.
Opaque and feliperoque like this.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks is offline   Reply With Quote

Old   February 29, 2024, 05:48
Default
  #9
Member
 
Evelyn
Join Date: Mar 2021
Posts: 32
Rep Power: 5
Yanlu is on a distinguished road
Quote:
Originally Posted by feliperoque View Post
Hi Folks!


There are some data i would like to use as input in my CFX simulation. My problem relies in a retangular resevoir and one small quadratic area in one of his face which is a boundary condition applied as heat flux.


The data i have it's from a simulation my collegue perfom, which there are two columns time (s) and heat flux (W/mē).

I usually use a fixed value as input of heat flux, but since i'm trying to perfom a more accurate transient analysis on my simulation i would like to use this data that i have.

The normal procedure i use is:

create a BC for heat flux>"boundary details"> "Options"> select "heat flux"> "Heat flux in "i added the fixed value i have, for example -400 W/mē".

What i would like:

create a BC for heat flux > "boundary details> "Options"> select "heat flux"> "Heat flux in "insert the data i have">.

While i was searching i found that i need to create a "User Function" but when i create appears some boxes that i don't know what i should filled with. Like where "Argument Units", "Result Units"...and where i added the file containing my data i like to use?
https://blog.csdn.net/YanLu99/article/details/112685987
feliperoque likes this.
__________________
biofluid mechanics;Hemodynamics
Yanlu is offline   Reply With Quote

Old   March 1, 2024, 07:13
Default
  #10
New Member
 
Felipe Roque
Join Date: Feb 2024
Posts: 5
Rep Power: 2
feliperoque is on a distinguished road
thank you very much!
Yanlu likes this.
feliperoque is offline   Reply With Quote

Reply

Tags
ansys, cfx, data input, doubt, user function

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
[mesh manipulation] RefineMesh Error and Foam warning jiahui_93 OpenFOAM Meshing & Mesh Conversion 4 March 3, 2018 11:32
[mesh manipulation] refineMesh Error mohsen.boojari OpenFOAM Meshing & Mesh Conversion 3 March 1, 2018 22:07
Version 15 on Mac OS X gschaider OpenFOAM Installation 113 December 2, 2009 10:23
Compilation errors in ThirdPartymallochoard feng_w OpenFOAM Installation 1 January 25, 2009 06:59
Problem with compile the setParabolicInlet ivanyao OpenFOAM Running, Solving & CFD 6 September 5, 2008 20:50


All times are GMT -4. The time now is 02:44.