|
[Sponsors] |
Help to create a CEL expression for Step function |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 11, 2011, 21:24 |
Help to create a CEL expression for Step function
|
#1 |
New Member
A C
Join Date: Dec 2010
Posts: 9
Rep Power: 16 |
I have understood the use of step function for a 1-D rectangular profile as in CFX help:
h = 2[m] IniVOFAir = step[((z - h)/1 [m])] IniVOFWater = 1 - IniVOFAir But, now I want to this for a cylinder. I mean, a volume fraction of cylindrical air profile in a big volume fraction fraction of cylindrical water profile. So, a cylindrical region of air (on top) in a cylindrical region of water. How can I write the expression for VOFAir and VOFWater in this case? Thank you! |
|
January 12, 2011, 06:14 |
|
#2 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,870
Rep Power: 144 |
radius = sqr((x-X_Centre)^2+(y-Y_Centre)^2+(z-Z_Centre)^2)
InitialVOF=step((radius-Cylinder_radius)/1[m]) I have used a sphere centred on X_Centre,Y_Centre,Z_Centre of radius Cylinder_radius. |
|
January 14, 2011, 18:31 |
|
#3 |
New Member
A C
Join Date: Dec 2010
Posts: 9
Rep Power: 16 |
Thank you so much!
Because my case is cylinder, I am using If Statement: IniVOFAir= if(sqrt(x^2+y^2)<=0.01[m] && z<=0.01[m],1,0) IniVOFWat= 1-IniVOFAir In this case, the radial part works fine but the height part (z) isn't getting satisfied. The height for VOFAir should be restricted to 0.01m and beyond 0.01m, it should just be water but using the expression above I am finding the height getting extended till the domain end, which it shouldn't do. God knows, what mistake I am making. I got to know about using if statement recently, so may be I am stating the expression wrongly. If you find anything wrong, please tell me. |
|
January 15, 2011, 07:29 |
|
#4 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,870
Rep Power: 144 |
Try putting the logic statement in brackets. Just a guess.
|
|
January 18, 2011, 18:22 |
|
#5 |
New Member
A C
Join Date: Dec 2010
Posts: 9
Rep Power: 16 |
You will laugh at it, the formulation is correct; I was actually making a silly mistake, so it was a mistake from my side. Thank you for your advice and help.
|
|
January 18, 2011, 18:31 |
|
#6 |
New Member
A C
Join Date: Dec 2010
Posts: 9
Rep Power: 16 |
Can I ask you one thing more?
I am modeling a two phase problem, like solid Al in liquid Ti using multiphase feature in CFX. In this case, I have chosen to go with heterogeneous model and not homogeneous model. I have unable to understand the free surface model feature in that, there are two options under it: standard and none. I tried from help to understand but didn't get a very clear idea. If you have some info on this. Can you explain me these three things? 1. When to use heterogeneous model? - my understanding says, when we have two phases involved like: solid Al having its own physical and chemical properties which is different from that of Ti, use heterogeneous model. In the problem, I want to see the mass transfer and heat transfer happening between the two (solid Al and liquid Ti). Hence using which model would be better? Heterogeneous or homogeneous? 2. When to use homogeneous model? 3. What is free flow model? - my understanding is, free flow feature comes into play when we want to model the splashes etc at the top surface and hence keeping the surface free to move. Is this thinking of mine right? Many thanks! Ani |
|
January 18, 2011, 19:23 |
|
#7 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,870
Rep Power: 144 |
Use the heterogenous model when the different phases share the same variable field (usually velocity, but it can be other variables). In other words, at any point in the domain does a single velocity describe the flow velocity (ie homogenous), or is one phase going one way and another phase going another direction (ie inhomogeneous)?
The free surface model is used when you wish to explicitly model the interface between two phases. This means the smallest region of a phase which can be modelled is a few element volumes in size. If the phase is in smaller blobs than that (ie smaller than the element volume) then you cannot use free surface approaches and should consider particle tracking or eularian approaches. |
|
January 18, 2011, 22:59 |
|
#8 |
New Member
A C
Join Date: Dec 2010
Posts: 9
Rep Power: 16 |
I seriously appreciate you greatly as a person, as a mentor and as a guide. Thank you so much for answering my doubts.
"Use the heterogenous model when the different phases share the same variable field (usually velocity, but it can be other variables). In other words, at any point in the domain does a single velocity describe the flow velocity (ie homogenous), or is one phase going one way and another phase going another direction (ie inhomogeneous)? The free surface model is used when you wish to explicitly model the interface between two phases. This means the smallest region of a phase which can be modelled is a few element volumes in size. If the phase is in smaller blobs than that (ie smaller than the element volume) then you cannot use free surface approaches and should consider particle tracking or eularian approaches. " So, you mean to say: if we have two phases and both phases have their individual properties and don't share any variable among themselves then its heterogeneous. But if they share one of the parameter/variable among themselves, sometimes velocity then it is called Homogeneous. Am I right? Can you please give me an example to get a concrete understanding? Free surface, I understood from you that it is a interface layer created b/w the two phases based on the width you mention. Hence, this layer is kind of a resistance provided between the two layer to obstruct the heat and mass flow b/w the phases. Am I right? When do we use it and how do we define the properties of this interface? Thank you for all the knowledge & experience, you are sharing with me. If you don't mind, can I know who are you and what do you do? Your name is Glenn and you are from Sydney. I would love to know your background and the field/company you belong to or work with. Regards Ani |
|
January 18, 2011, 23:23 |
|
#9 | |||
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,870
Rep Power: 144 |
Quote:
Quote:
Quote:
My name is Glenn Horrocks and I am an engineer in Sydney, Australia. I work for Silverbrook research developing printhead integrated circuits for ink jet printers. I have previously done work in the forging and automotive industries (IC engines). I have used CFX since about 1996 when it was CFX3. |
||||
October 29, 2013, 19:15 |
step fuction
|
#10 |
Member
may
Join Date: Jul 2013
Posts: 31
Rep Power: 13 |
Hi
How can I set a step function to calculate mixing in a mixing column, which contains water? Any suggestion will be most appreciated. |
|
October 29, 2013, 19:15 |
step fuction
|
#11 |
Member
may
Join Date: Jul 2013
Posts: 31
Rep Power: 13 |
Hi
How can I set a step function to calculate mixing in a mixing column, which contains water? Any suggestion will be most appreciated. |
|
October 29, 2013, 21:59 |
|
#12 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,870
Rep Power: 144 |
What metric which represents mixing do you wish to calculate?
|
|
October 30, 2013, 00:16 |
step fuction
|
#13 |
Member
may
Join Date: Jul 2013
Posts: 31
Rep Power: 13 |
Hi
I'm using a mixing reactor contains water witch is oscillating throughout the column. I'm trying to write an expression for an additional variable (named dye) to quantify this mixing. This mixing can be initially two different colour (ie: blue and red) and turn to green when full mixing is achieved. |
|
October 30, 2013, 05:53 |
|
#14 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,870
Rep Power: 144 |
You will need to explain what you are doing and how you propose to measure the mixing. An image of the geometry would help.
|
|
October 30, 2013, 06:53 |
Step function
|
#15 |
Member
may
Join Date: Jul 2013
Posts: 31
Rep Power: 13 |
There are different methods of calculating mixing in the column. One way is to calculate velocity ratio (the ratio of axial velocity to radial velocity). In this case the optimal mixing is around 2.5 (ie: axial velocity is 2.5 times greater than radial velocity). Another way is to use additional variable as concentration and calculate the full mixing in the column. To achieve this an expression(s) needed to evaluate the amount of mixing from totally unmixed to a fully mixed state. How we evaluate the amount of mixing here? I thought if I write an expression using "step" function or "if" function then I can use two different colour initially and a result colour due to full mixing. Not sure how to do that. |
|
October 30, 2013, 07:16 |
|
#16 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,870
Rep Power: 144 |
Yes, you could use an additional variable which is initialised as 0 on one side and 1 on the other and as the stuff mixes the additional variable will diffuse and convect around.
This is easy to do. It is just an initial condition on the additional variable, then some elementary post processing. |
|
October 30, 2013, 21:08 |
|
#17 |
Member
may
Join Date: Jul 2013
Posts: 31
Rep Power: 13 |
Thanks for your response. Not sure how to set two different values for one additional variable. I set inlet to “1” and initial condition to zero. I’m also not sure what’s the unit for this additional value.
|
|
October 31, 2013, 05:42 |
|
#18 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,870
Rep Power: 144 |
Set the initial condition for the AV to something like if(x<1[m],0,1) and that will put the division at x=1m.
There are several approaches for AVs and they have different units depending on the approach you use. Read the documentaiton and see the tutorials for more details. |
|
November 2, 2013, 00:42 |
step function
|
#19 |
Member
may
Join Date: Jul 2013
Posts: 31
Rep Power: 13 |
Hi Glenn
Thanks for the tip. I will set this and test it out. Another question is; if this works, how can I quantify and analyse mixing? |
|
November 2, 2013, 05:15 |
|
#20 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,870
Rep Power: 144 |
There are many ways to analyse mixing. Best go to the library and do some research to find how other people in a similar area do it.
|
|
Tags |
cylinder, step function |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
OpenFOAM static build on Cray XT5 | asaijo | OpenFOAM Installation | 9 | April 6, 2011 13:21 |
CGNS lib and Fortran compiler | manaliac | Main CFD Forum | 2 | November 29, 2010 07:25 |
Problem with rhoSimpleFoam | matteo_gautero | OpenFOAM Running, Solving & CFD | 0 | February 28, 2008 07:51 |
Help to create a CEL Expression | Juan Maria Campos | CFX | 2 | December 3, 2007 08:52 |
Lift, Drag Vs time chart,calculations | Jamesd69climber | CFX | 8 | February 17, 2005 18:23 |