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.

How to define "step velocity"?

Please login with a confirmed email address before reporting spam

Hello to all,

Could you please help me to how can I define "step velocity" as in for first 0.5 sec velocity is zero then for next 2 second it is 1 m/s and again zero for next 0.5 sec.?


4 Replies Last Post Sep 10, 2018, 1:43 p.m. EDT
Mickaël Barsive COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 6 years ago Sep 10, 2018, 5:21 a.m. EDT

Hello,

You can use a rectangle function in "Definitions">"Functions">"Rectangle".

In your case, set "lower limit" at 0.5, "upper limit" at 2.5 then you can plot the graphic to check your function. The next step is to use the function in the physics interface: in your "Inlet" node, you can use the following syntax: rect1(t[1/s]) rect1 is the function name by default and [1/s] is used for homogeneous units.

I hope this helps !

Mickaël

Hello, You can use a rectangle function in "Definitions">"Functions">"Rectangle". In your case, set "lower limit" at 0.5, "upper limit" at 2.5 then you can plot the graphic to check your function. The next step is to use the function in the physics interface: in your "Inlet" node, you can use the following syntax: rect1(t[1/s]) rect1 is the function name by default and [1/s] is used for homogeneous units. I hope this helps ! Mickaël

Please login with a confirmed email address before reporting spam

Posted: 6 years ago Sep 10, 2018, 11:12 a.m. EDT

Hello,

You can use a rectangle function in "Definitions">"Functions">"Rectangle".

In your case, set "lower limit" at 0.5, "upper limit" at 2.5 then you can plot the graphic to check your function. The next step is to use the function in the physics interface: in your "Inlet" node, you can use the following syntax: rect1(t[1/s]) rect1 is the function name by default and [1/s] is used for homogeneous units.

I hope this helps !

Mickaël

Thank you very much for your help.

>Hello, > >You can use a rectangle function in "Definitions">"Functions">"Rectangle". > >In your case, set "lower limit" at 0.5, "upper limit" at 2.5 >then you can plot the graphic to check your function. The next step is to use the function in the physics interface: in your "Inlet" node, you can use the following syntax: rect1(t[1/s]) >rect1 is the function name by default and [1/s] is used for homogeneous units. > >I hope this helps ! > >Mickaël Thank you very much for your help.

Edgar J. Kaiser Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 6 years ago Sep 10, 2018, 11:39 a.m. EDT

Hi,

rectangular velocity steps will probably stop a time dependent solver as a velocity step implies infinite acceleration and thus is unphysical. You may need to smooth the steps. This can be done with e.g. ramp functions. Take care that the time stepping properly resolves the ramp.

Cheers Edgar

-------------------
Edgar J. Kaiser
emPhys Physical Technology
www.emphys.com
Hi, rectangular velocity steps will probably stop a time dependent solver as a velocity step implies infinite acceleration and thus is unphysical. You may need to smooth the steps. This can be done with e.g. ramp functions. Take care that the time stepping properly resolves the ramp. Cheers Edgar

Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 6 years ago Sep 10, 2018, 1:43 p.m. EDT

Hi Edgar,

The Rectangle function includes (adjustable) smoothing - See GUI.

Jeff

-------------------
Jeff Hiller
Hi Edgar, The Rectangle function includes (adjustable) smoothing - See GUI. Jeff

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.