CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   How to perform a simulation with User Function (https://www.cfd-online.com/Forums/cfx/254727-how-perform-simulation-user-function.html)

feliperoque February 27, 2024 15:06

How to perform a simulation with User Function
 
3 Attachment(s)
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?

ghorrocks February 27, 2024 16:34

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.

feliperoque February 27, 2024 17:39

1 Attachment(s)
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"?

Opaque February 27, 2024 17:42

Quote:

Originally Posted by feliperoque (Post 865422)
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 February 27, 2024 17:53

Okay, thx. I change the Argument Unit to "s" and Result Unit to "W m^-2" and works!

ghorrocks February 27, 2024 18:49

Sorry, yes: the variable is "t" but the unit is "s". Thanks for correcting that.

feliperoque February 28, 2024 10:22

2 Attachment(s)
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?

ghorrocks February 28, 2024 16:58

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.

Yanlu February 29, 2024 05:48

Quote:

Originally Posted by feliperoque (Post 865416)
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 March 1, 2024 07:13

thank you very much!


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