CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > CFX

Help to create a CEL expression for Step function

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 11, 2011, 20:24
Default Help to create a CEL expression for Step function
  #1
New Member
 
A C
Join Date: Dec 2010
Posts: 9
Rep Power: 15
anirudster is on a distinguished road
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!
anirudster is offline   Reply With Quote

Old   January 12, 2011, 05:14
Default
  #2
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
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.
ghorrocks is offline   Reply With Quote

Old   January 14, 2011, 17:31
Default
  #3
New Member
 
A C
Join Date: Dec 2010
Posts: 9
Rep Power: 15
anirudster is on a distinguished road
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.
anirudster is offline   Reply With Quote

Old   January 15, 2011, 06:29
Default
  #4
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Try putting the logic statement in brackets. Just a guess.
ghorrocks is offline   Reply With Quote

Old   January 18, 2011, 17:22
Default
  #5
New Member
 
A C
Join Date: Dec 2010
Posts: 9
Rep Power: 15
anirudster is on a distinguished road
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.
anirudster is offline   Reply With Quote

Old   January 18, 2011, 17:31
Default
  #6
New Member
 
A C
Join Date: Dec 2010
Posts: 9
Rep Power: 15
anirudster is on a distinguished road
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
anirudster is offline   Reply With Quote

Old   January 18, 2011, 18:23
Default
  #7
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
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.
ghorrocks is offline   Reply With Quote

Old   January 18, 2011, 21:59
Default
  #8
New Member
 
A C
Join Date: Dec 2010
Posts: 9
Rep Power: 15
anirudster is on a distinguished road
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
anirudster is offline   Reply With Quote

Old   January 18, 2011, 22:23
Default
  #9
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Quote:
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?
No, that is wrong. The distinction is whether the mixing of the phases is small compared to the element size. If it is small then the mesh cannot capture it so you need a model to capture it - usually a lagrangian particle tracking or a eularian model. It is large compared to the element size then the mesh can capture it so it can be modelled directly using a free surface model.

Quote:
Free surface, I understood from you that it is a interface layer created b/w the two phases based on the width you mention.
No, a free surface is modelled with no thickness. But numerically it is smeared over a small number of elements so it has a thickness proportional to the element size.

Quote:
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?
Yes, this is correct. Look in the documentation for free surface interface conditions.

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.
ghorrocks is offline   Reply With Quote

Old   October 29, 2013, 18:15
Default step fuction
  #10
Member
 
may
Join Date: Jul 2013
Posts: 31
Rep Power: 12
mayj is on a distinguished road
Hi
How can I set a step function to calculate mixing in a mixing column, which contains water?
Any suggestion will be most appreciated.
mayj is offline   Reply With Quote

Old   October 29, 2013, 18:15
Default step fuction
  #11
Member
 
may
Join Date: Jul 2013
Posts: 31
Rep Power: 12
mayj is on a distinguished road
Hi
How can I set a step function to calculate mixing in a mixing column, which contains water?
Any suggestion will be most appreciated.
mayj is offline   Reply With Quote

Old   October 29, 2013, 20:59
Default
  #12
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
What metric which represents mixing do you wish to calculate?
mayj likes this.
ghorrocks is offline   Reply With Quote

Old   October 29, 2013, 23:16
Default step fuction
  #13
Member
 
may
Join Date: Jul 2013
Posts: 31
Rep Power: 12
mayj is on a distinguished road
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.
mayj is offline   Reply With Quote

Old   October 30, 2013, 04:53
Default
  #14
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
You will need to explain what you are doing and how you propose to measure the mixing. An image of the geometry would help.
mayj likes this.
ghorrocks is offline   Reply With Quote

Old   October 30, 2013, 05:53
Default Step function
  #15
Member
 
may
Join Date: Jul 2013
Posts: 31
Rep Power: 12
mayj is on a distinguished road

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.
mayj is offline   Reply With Quote

Old   October 30, 2013, 06:16
Default
  #16
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
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.
ghorrocks is offline   Reply With Quote

Old   October 30, 2013, 20:08
Default
  #17
Member
 
may
Join Date: Jul 2013
Posts: 31
Rep Power: 12
mayj is on a distinguished road
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.
mayj is offline   Reply With Quote

Old   October 31, 2013, 04:42
Default
  #18
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
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.
mayj likes this.
ghorrocks is offline   Reply With Quote

Old   November 1, 2013, 23:42
Default step function
  #19
Member
 
may
Join Date: Jul 2013
Posts: 31
Rep Power: 12
mayj is on a distinguished road
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?
mayj is offline   Reply With Quote

Old   November 2, 2013, 04:15
Default
  #20
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
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.
ghorrocks is offline   Reply With Quote

Reply

Tags
cylinder, step function


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenFOAM static build on Cray XT5 asaijo OpenFOAM Installation 9 April 6, 2011 12:21
CGNS lib and Fortran compiler manaliac Main CFD Forum 2 November 29, 2010 06:25
Problem with rhoSimpleFoam matteo_gautero OpenFOAM Running, Solving & CFD 0 February 28, 2008 06:51
Help to create a CEL Expression Juan Maria Campos CFX 2 December 3, 2007 07:52
Lift, Drag Vs time chart,calculations Jamesd69climber CFX 8 February 17, 2005 17:23


All times are GMT -4. The time now is 06:55.