|
[Sponsors] |
March 14, 2023, 06:38 |
Step Function Velocity Inlet BC
|
#1 |
New Member
Eva Liu
Join Date: Nov 2022
Posts: 9
Rep Power: 4 |
I would like my inlet velocity BC to be oscillating with u(t)=0.022sin(10.965t) for half a period, then 0 for 2.9s, then back to u(t) for another half period, then back to 0 for 2.9s, repeating.
Is there a way to write a time-dependent CEL expression for this step function? Where depending of t the inlet velocity is either the sine function or 0? |
|
March 14, 2023, 06:43 |
|
#2 |
Senior Member
Gert-Jan
Join Date: Oct 2012
Location: Europe
Posts: 1,928
Rep Power: 28 |
you can limit the sine-function using a max-function:
vel=max(sine-function, 0[m/s] |
|
March 14, 2023, 06:51 |
|
#3 |
New Member
Eva Liu
Join Date: Nov 2022
Posts: 9
Rep Power: 4 |
Hi! Could you expand on what the max-function does? For my purposes how can I set the length of time I want to zero my inlet velocity for and the length of time I want the velocity to be the sine function? And have it be repeating?
Thanks! |
|
March 14, 2023, 08:04 |
|
#4 |
Senior Member
Gert-Jan
Join Date: Oct 2012
Location: Europe
Posts: 1,928
Rep Power: 28 |
How the flow fluctuates, is determined by your sine function. The max only takes the maximum of both expressions, i.e. your sine function and 0. You can add more functions to make it more sophisticated, that is up to you.
In my experience, it is best to first work it out in e.g. MS Excel. Then if it works there, it will work in CFX. Please remember that CFX-Pre, allows you to make a graph of your function. So you can check beforehand what you define and what will be used in the Solver. However, if your flow fluctuates a lot making it too complicated using expression, it might be better to create a simple table of flow versus time in Excel (save as .csv-file), import in Pre, and use this. CFX will interpolate on intermediate time values. |
|
Tags |
cel expression, inlet bc, oscillating flow, step functions, velocity profiles |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
pimpleDyMFoam computation randomly stops | babapeti | OpenFOAM Running, Solving & CFD | 5 | January 24, 2018 06:28 |
Multiphase flow - incorrect velocity on inlet | Mike_Tom | CFX | 6 | September 29, 2016 02:27 |
[blockMesh] error message with modeling a cube with a hold at the center | hsingtzu | OpenFOAM Meshing & Mesh Conversion | 2 | March 14, 2012 10:56 |
Droplet Evaporation | Christian | Main CFD Forum | 2 | February 27, 2007 07:27 |
Terrible Mistake In Fluid Dynamics History | Abhi | Main CFD Forum | 12 | July 8, 2002 10:11 |