Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Trouble solving basic Fluid Problems that are *Time Dependent*

Please login with a confirmed email address before reporting spam

Hi,

I'm having trouble solving just the most basic 2D fluid flow problems using time dependent studies. For example I want to look at flow through a simple pipe, and see what the flow is at 1 second, 2 seconds, 3 seconds, etc etc. Though the problem is they solve!

I tried to use a ramp function since I heard jumping from 0 velocity BC to whatever you use doesn't work well, but that proved to not work.

I have imported a function to define a velocity over a period of 1 second. If I solve it Steady State such as "Velocity_Int(0.90)" taking the velocity at 0.90 on my function it works perfectly.

Why can't I simply use "Velocity_Int(s)" for time depedenent? Shouldn't the seconds increment as the program runs, putting it into the function and spitting out the velocity?

*This is more complex, I even just tried setting Uo = 0.5 m/s and it still won't solve time dependent!"

Thanks!!


6 Replies Last Post Aug 1, 2012, 8:32 p.m. EDT

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Aug 1, 2012, 5:48 p.m. EDT
There are some simple mistakes in the definition of the model:

# The arguments of your interpolation function should be s and m/s, without the brackets.
# The velocity assigned as the inlet BC should be Velocity_Int(t). In Comsol, t denotes the time (in seconds), not s.

By the way, you are not using the ramp function you defined. You can use it in your inlet BC as something like: rm1(t[1/s])*Velocity_Int(t). But, to reach to the full velocity interpolation function, the cutoff of the ramp function should be 1.

You also should set the times to solve in the time-dependent solver. Current range (range(0,.5,1)) means that the problem will be solved starting from 0, ending at 1 second with a 0.5 second step.

Finally, make sure that you set the tolerances in solver settings and the time stepping (to strict or intermediate) as well.

Regards,
--
Tolga
There are some simple mistakes in the definition of the model: # The arguments of your interpolation function should be s and m/s, without the brackets. # The velocity assigned as the inlet BC should be Velocity_Int(t). In Comsol, t denotes the time (in seconds), not s. By the way, you are not using the ramp function you defined. You can use it in your inlet BC as something like: rm1(t[1/s])*Velocity_Int(t). But, to reach to the full velocity interpolation function, the cutoff of the ramp function should be 1. You also should set the times to solve in the time-dependent solver. Current range (range(0,.5,1)) means that the problem will be solved starting from 0, ending at 1 second with a 0.5 second step. Finally, make sure that you set the tolerances in solver settings and the time stepping (to strict or intermediate) as well. Regards, -- Tolga

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Aug 1, 2012, 6:31 p.m. EDT
Thanks for the help,

- What do the strict setting in the solver do?

- I'm confused at how the ramp functions works. How would I combine that with Mod() to have my velocity profile repeat after ever second.

For example how can I "ramp" up to a value if it is changing over 100 times per second, and then I'd like to repeat that every second over and over.

Thanks
Thanks for the help, - What do the strict setting in the solver do? - I'm confused at how the ramp functions works. How would I combine that with Mod() to have my velocity profile repeat after ever second. For example how can I "ramp" up to a value if it is changing over 100 times per second, and then I'd like to repeat that every second over and over. Thanks

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Aug 1, 2012, 7:07 p.m. EDT

Thanks for the help,

- What do the strict setting in the solver do?

- I'm confused at how the ramp functions works. How would I combine that with Mod() to have my velocity profile repeat after ever second.

For example how can I "ramp" up to a value if it is changing over 100 times per second, and then I'd like to repeat that every second over and over.

Thanks


The strict setting calculates strictly at the time steps that you defined. Intermediate does the same but it also solves at the intermediate times between two defined time steps.

The ramp function can be used to smooth the transition in a particular BC. Let's say, you have an inlet BC with a constant velocity of 10m/s. Instead of assigning this velocity value, if you multiply it with a ramp function (i.e. rm1(t)), which is defined over a small time and changes from 0 to 1, the velocity will transitionally reach to 10m/s beginning from 0, in the time period which ramp function is defined.



--
Tolga
[QUOTE] Thanks for the help, - What do the strict setting in the solver do? - I'm confused at how the ramp functions works. How would I combine that with Mod() to have my velocity profile repeat after ever second. For example how can I "ramp" up to a value if it is changing over 100 times per second, and then I'd like to repeat that every second over and over. Thanks [/QUOTE] The strict setting calculates strictly at the time steps that you defined. Intermediate does the same but it also solves at the intermediate times between two defined time steps. The ramp function can be used to smooth the transition in a particular BC. Let's say, you have an inlet BC with a constant velocity of 10m/s. Instead of assigning this velocity value, if you multiply it with a ramp function (i.e. rm1(t)), which is defined over a small time and changes from 0 to 1, the velocity will transitionally reach to 10m/s beginning from 0, in the time period which ramp function is defined. -- Tolga

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Aug 1, 2012, 7:16 p.m. EDT
I understand with a constant velocity...

But what if my Velocity will change over time? I "ramp" up to 10m/s, but then 0.1 seconds later it's now 5 m/s, then changes again etc etc.

So would I want my "cutoff" to be below any of my values?

I'm starting to think it just initially ramps at the start of the simulation, after which it won't effect the values anymore?

Thanks again, the documentation isn't super clear for a newbie.
I understand with a constant velocity... But what if my Velocity will change over time? I "ramp" up to 10m/s, but then 0.1 seconds later it's now 5 m/s, then changes again etc etc. So would I want my "cutoff" to be below any of my values? I'm starting to think it just initially ramps at the start of the simulation, after which it won't effect the values anymore? Thanks again, the documentation isn't super clear for a newbie.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Aug 1, 2012, 8:26 p.m. EDT
I believe you can use the ramp for the first value of your interpolation function. Because the interpolation function is a continuous function and interpolates between your data points using linear, piecewise cubic, cubic spline interpolation.

Or maybe you can even start your interpolation function with 0, instead of using a ramp function.

--
Tolga
I believe you can use the ramp for the first value of your interpolation function. Because the interpolation function is a continuous function and interpolates between your data points using linear, piecewise cubic, cubic spline interpolation. Or maybe you can even start your interpolation function with 0, instead of using a ramp function. -- Tolga

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Aug 1, 2012, 8:32 p.m. EDT

I understand with a constant velocity...

But what if my Velocity will change over time? I "ramp" up to 10m/s, but then 0.1 seconds later it's now 5 m/s, then changes again etc etc.

So would I want my "cutoff" to be below any of my values?

I'm starting to think it just initially ramps at the start of the simulation, after which it won't effect the values anymore?

Thanks again, the documentation isn't super clear for a newbie.


By the way, a typical ramp function starts from 0 and reaches the cutoff (i.e., 1). The duration of the transition depends on the slope. If the slope is 1 and assume that you will use the ramp as a function of time, i.e. rm1(t); then the ramp will reach the cutoff at 1 second and stay 1 until then. Thus, you have to modify it with respect to your model, your time steps, etc.

--
Tolga
[QUOTE] I understand with a constant velocity... But what if my Velocity will change over time? I "ramp" up to 10m/s, but then 0.1 seconds later it's now 5 m/s, then changes again etc etc. So would I want my "cutoff" to be below any of my values? I'm starting to think it just initially ramps at the start of the simulation, after which it won't effect the values anymore? Thanks again, the documentation isn't super clear for a newbie. [/QUOTE] By the way, a typical ramp function starts from 0 and reaches the cutoff (i.e., 1). The duration of the transition depends on the slope. If the slope is 1 and assume that you will use the ramp as a function of time, i.e. rm1(t); then the ramp will reach the cutoff at 1 second and stay 1 until then. Thus, you have to modify it with respect to your model, your time steps, etc. -- Tolga

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.