CFX Expression Language–Part 4: Applying Ramped and Stepped Boundary Conditions Using CEL

Categories:

In three previous entries we introduced CFX Expression Language, CEL:

In this fourth installment we will demonstrate the use of CEL to apply ramped or stepped boundary conditions. In certain circumstances we might want to ramp a load rather than apply it all at once. For example, convergence difficulties can sometimes arise when a fast rotation rate is applied initially in rotating machinery simulations. Starting off with a smaller value of load and ramping it to the final value can aid in convergence in these circumstances.

Note that the rate of load application can be manually changed during the solution in the solver manager, but why not take advantage of CEL and do it automatically? As we will see, this is fairly easy to do.

The ability to ramp a load makes use of a built-in CEL variable labeled “aiturn”, which is the accumulated value of the iteration number. If we assign an expression for the number of iterations we want, we can then create a combined expression for the ramped load:

image

In the above list of expressions, Flow999 is our desired full amount of flow at the end of ramping. Iter is defined to have a value of 100. Both of those are names that we picked. We then defined expression flowapplied, which is the value of Flow999 times the built-in expression aitern (the current solver iteration number) divided by the total number of iterations desired for the ramping, Iter. Once aitern = 100, then the value of flowapplied will equal Flo999 or 9.99 ft/sec in this case.

Here is a plot of the expression flowapplied for values of aitern between 0 and 100. The plot is in m/s but the peak works out to be 9.99 ft/sec.

image

As we have seen in prior entries in this series, we plug in the expression name for the input in the appropriate field. In this case, the name of the expression flowapplied is entered in the Normal Speed field in the Inlet boundary details.

After solution, we can verify that at the end of the solution the applied inlet velocity had reached the full value of 9.99 ft/sec. in CFD Post:

image

The next step might be rerun the solution while maintaining a constant value of the applied load for an extended period of time. This can be accomplished by modifying the expression which defines the load so that it has some additional values:

image

In the above expression we have added a step() function, which can either be typed in or added by right clicking, Functions > CEL > step. This causes the ramped load to peak at the value of Flow999 when aitern reaches the previously defined value of Iter at 100, then drop to zero after that. This happens because if Iter-aitern is greater than one, step=1, but if Iter-aitern is less than one, step=0. Here is the resulting plot in CFX Pre:

image

That’s not quite what we want, but if we tweak the expression a bit more, we can get it to ramp to the full value then remain constant.

image

Now we have another term involving the step() function, but with the expression names inside the step function reversed. This means that once aitern exceeds the value of Iter, the first term becomes zero and the second term takes over with a constant value of the load equal to Flow999, as shown here:

image

By using similar expressions involving time, we can create a load history that turns off and on at desired time points.

Hopefully by now you’re starting to see the value of CEL. We are just scratching the surface here, but once you start using it you will find that CEL has a lot of potential powerful uses. In the next installment we’ll cover some additional capabilities available in CEL.

Categories

Get Your Ansys Products & Support from the Engineers who Contribute to this Blog.

Technical Expertise to Enable your Additive Manufacturing Success.

PADT’s Pulse Newsletter

Keep up to date on what is going on at PADT by subscribing to our newsletter.


By submitting this form, you are consenting to receive marketing emails from: . You can revoke your consent to receive emails at any time by using the SafeUnsubscribe® link, found at the bottom of every email. Emails are serviced by Constant Contact

Share this post:

Upcoming Events

03/27/2024

2024 Arizona Space Summit

03/28/2024

SAF Blue Carpet Event

03/28/2024

2024 Arizona Space Summit

04/03/2024

Low Frequency Updates in Ansys 2024 R1 - Webinar

04/03/2024

Venture Madness Conference Reception + Expo

04/03/2024

Stratasys F3300: Game Changing Throughput - Webinar

04/08/2024

39th Space Symposium

04/09/2024

39th Space Symposium

04/10/2024

Discovery Updates in Ansys 2024 R1 - Webinar

04/10/2024

39th Space Symposium

04/11/2024

39th Space Symposium

04/22/2024

Experience Stratasys Truck Tour: Houston, TX

04/24/2024

Structures Updates in Ansys 2024 R1 (2)

04/24/2024

Experience Stratasys Truck Tour: Houston, TX

05/07/2024

Experience Stratasys Truck Tour: Albuquerque, NM

05/08/2024

Fluent Materials Processing Updates in Ansys 2024 R1 - Webinar

05/09/2024

Experience Stratasys Truck Tour: Los Alamos, NM

05/14/2024

Simulation World 2024

05/15/2024

Simulation World 2024

05/16/2024

Simulation World 2024

05/22/2024

Optics Updates in Ansys 2024 R1 - Webinar

06/12/2024

Connect Updates in Ansys 2024 R1 - Webinar

06/26/2024

Structures Updates in Ansys 2024 R1 (3) - Webinar

06/27/2024

E-Mobility and Clean Energy Summit

07/10/2024

Fluids Updates in Ansys 2024 R1 - Webinar

08/05/2024

2024 CEO Leadership Retreat

10/23/2024

PADT30 | Nerdtoberfest 2024

Search in PADT site

Contact Us

Most of our customers receive their support over the phone or via email. Customers who are close by can also set up a face-to-face appointment with one of our engineers.

For most locations, simply contact us: