CFD Online Discussion Forums

CFD Online Discussion Forums (
-   CFX (
-   -   Transient with time-varying boundary conditions (

Jordi July 31, 2012 03:26

Transient with time-varying boundary conditions
I want to model the behaviour of an accelerating body in air. So I'd like to set up my upstream face as an input with a time-dependent speed. But apparently I can only set constants in boundary values, even if the analysis type is set as transient.
I have been suggested running a series of stationary analysis, but what I want to see is just the dynamics of the flow.
I'd be happy with just a linear speed with time, something like going from 10 m/s to 100 m/s in 30 seconds. Is it possible to do such analysis?

monkey1 July 31, 2012 03:52

To set varying boundary conditions you must define a "user function" in CFX Pre. There you can provide a set of tabulated values. If you want a linear profile it would be a "table" saying at 0s the speed is 10 m/s and at 30s it is 100 m/s. The user function always interpolates between the given values. If you then name the function for example speedfunc, you can then go to your BC and select "enter expression" where you provided a single value yet. There you would then write speedfunc(t). The paranthesis are necessary as the table works with a parameter in this case the time.

Using the user function allows you also to define a "speed profile" over the time. In my case I always provide the experimentally measured time dependent wind speed for my simulations. Meaning one value per second. If you have a file with speed values that are too much to input them manually you can also read a file. Right click into the interpolation data field and select "import data".
Format of the file should be tab separated columns.

Jordi July 31, 2012 04:04

Fantastic, man, that's what I was looking for. In addition I can have non-linear and maybe f(x,t) values. Wow, a new world has opened to my eyes! Danke schoen.

monkey1 July 31, 2012 04:20

I am glad it helped;)

You can definitly define any kind of data pairs. Linear, non linear etc. The only thing to take care of is when defining a step function. Smth, I use for switching mass sources on and off. For example I want to have mass released only from 10s to 20s in a 30s simulation. Then I define a user Function with the following values:
0s - 0
9.999s - 0
10s - 1
20s - 1
20.0001s -0
30s - 0
The 9.999s and 20.0001s are necessary because if I would let them away he would make an interpolation between 0s and 10s with values increasing from 0 to 1 and a conitnuous decrease between 20 and 30s.

Btw. if you check extend min and extend max it will use the first and last value defined for all values outside the range defined in the table.

ghorrocks July 31, 2012 06:42

Don't forget about CEL expressions. You can simply enter a CEL expression as the boundary condition value (including as a function of time). Setting up CEL expressions is covered in the CFX tutorials.

Jordi August 3, 2012 04:51

thank you all

cscfx February 19, 2014 05:09

HELLO! i want know how to write the profile of time dependent boundary,can you give a simple format? thanks a lot

ghorrocks February 19, 2014 06:36

It is easy to make CEL expressions a function of time. Have a look at the tutorials for how to do that.

But exactly what profile do you want to use?

CFX_CFD June 16, 2015 11:28

1 Attachment(s)

Originally Posted by ghorrocks (Post 475665)
It is easy to make CEL expressions a function of time.

I would like to elaborate tutorial chapter 19 (AC simulation) where the temperature at the inlet also varies when a certain value of the thermometer is reached.
I was wondering if it is possible to use a "current timestep" in a transient simulation without it updating every new timestep and this in an automated way.

To give an example:
use t=i where t is the time you want to use and i the time in interval [0 < i < current time]. If so, how can I do this with CEL functions or do I need User Fortran Routines?

In attachment, you may find a figure of what I mean. The red arrows indicate the time I would like to use until the cooling starts again.

Thanks in advance.


ghorrocks June 16, 2015 19:12

I do not understand what you mean. You can easily make the temperature of the inlet a function of anything, including a function of a temperature of a region in the simulation.

CFX_CFD June 18, 2015 04:51

Well, I would like to simulate the following situation (also see previous picture):
We cool with a temperature Tcool = 0C (a constant value).

When the thermostat reaches a lower limit (in the figure this value is 0.6C), we turn the cooling off and start heating with
Theat = 1.5C -1.5*exp(-(t-timeconstant)/3600) => i.e. a changing value in time.

When the thermostat reaches an upper limit (in the figure this value is 1.25C) we start cooling again until the lower limit is reached again. Then, we update the value for timeconstant and start the heating cycle. And this for multiple cooling-heating cycles.

So in order to automate the cooling-and-reheating cycles, I want to obtain a value for timeconstant and keep this value the same during my heating cycle and update it every time right after the cooling cycle.

ghorrocks June 18, 2015 05:27

You can implement just about anything in CEL...... as long as it does not require memory of what has happened at previous time steps :( . This will mean your heating cycle will be tricky to implement (as you have to remember when you started the heating cycle) and your cooling cycle will be a challenge (you have to know whether you are on a cooling cycle or not to know whether the cooler is on).

So the best way to implement your condition directly is using a user fortran routine. That way you can define your own variables which persist over time steps. Have a look in the CFX manuals for examples on user fortran.

CFX_CFD June 18, 2015 05:54

Too bad it's not possible with CEL functions. I will take a look at the manuals and try to solve it with a User Fortran Routine.
Thanks for your feedback!

Adarsh nair November 8, 2016 05:30

varying heat flux for rotating disc
hi im new to cfx ,im doing a ht analysis of disc brake,my input is constant heat flux for 3seconds on the disc surface and after 3 s convection to surronding air ,plz help me cfx cel for my input of heat flux

ghorrocks November 8, 2016 05:41

Use a 1D interpolation function, or CEL using "if" statements

urosgrivc November 8, 2016 08:26

(as long as it does not require memory of what has happened at previous time steps )

dear mr. Glenn is this true?

Isnt there some way to do it with TRANS_LOOP comand if I remember corectly.

ghorrocks November 8, 2016 18:00

Yes, there is an unsupported work-around using TRANS_LOOP. Search the forum to find discussion of it.

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