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 use a step function in a time-dependent study?

Rogelio Garcia Fernandez Certified Consultant

Please login with a confirmed email address before reporting spam

Hello everyone! Thank you so much for your precious time.

I have a time-dependent study that runs for 400 seconds. I am simulating flow through a pipe, and I want to change the flow at 100 seconds. For example, the inlet flow is A from 0 seconds to 100 seconds. Then, the inlet flow changes to B at 100 seconds, and stays like this until the end of the simulation.

Could someone explain the meaning of the step function's inputs (location, from, to)?

Thank you!


1 Reply Last Post 24.03.2020, 07:44 GMT-4
Magnus Ringh COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 4 years ago 24.03.2020, 07:44 GMT-4

Hi,

The step function should then be set up with Location set to 100 (the switch time), From set to A, and To set to B. When you use the step function in the simulation, call it like step1(t[1/s]) (if the step function name is step1). Use the Plot button at the top of the settings for the Step function node to plot the step function and check that it behaves as intended. Also, see the cylinder_flow model in the COMSOL Multiphysics Application Library for an example that uses a step function in an inlet condition.

Best regards,

Magnus Ringh, COMSOL

Hi, The step function should then be set up with **Location** set to 100 (the switch time), **From** set to A, and **To** set to B. When you use the step function in the simulation, call it like `step1(t[1/s])` (if the step function name is `step1`). Use the **Plot** button at the top of the settings for the Step function node to plot the step function and check that it behaves as intended. Also, see the `cylinder_flow` model in the COMSOL Multiphysics Application Library for an example that uses a step function in an inlet condition. Best regards, Magnus Ringh, COMSOL

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.