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

Help with creating a simple CEL expression

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree2Likes
  • 1 Post By monkey1
  • 1 Post By ghorrocks

Reply
 
LinkBack Thread Tools Display Modes
Old   February 16, 2012, 13:03
Default Help with creating a simple CEL expression
  #1
New Member
 
Join Date: Feb 2012
Posts: 13
Rep Power: 5
MJ55 is on a distinguished road
Hi there,

I need to help creating an expression for a CFX Pre case I am modelling.

I want to create a variable bouyancy force along a specified axis of a geometry.

To explain better a picture of the geometry is included below


Uploaded with ImageShack.us

You can see my rectangular geometry, I want to have a steadily increasing buoyancy force along the z axis of the geometry.

The length of the geometry is 0.5 metres.
The function I would like to input is

y = 200*x

Where y is the buoyancy force and x is the distance along the z axis of the geometry.

My problem is that I have no idea how to input the body's z axis distance as a variable.
MJ55 is offline   Reply With Quote

Old   February 16, 2012, 18:14
Default
  #2
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 10,823
Rep Power: 85
ghorrocks has a spectacular aura aboutghorrocks has a spectacular aura aboutghorrocks has a spectacular aura about
Before you do anything you should fix your mesh. The mesher (presumably ICEM) has not picked up the corners and has not aligned the mesh properly. You need to remesh as that geometry will never converge.

But to answer your question: Have you tried entering this as the gravity? I am not sure if it will allow you to define gravity as a function of x/y/z but if it does it is an easy solution.
ghorrocks is offline   Reply With Quote

Old   February 16, 2012, 19:40
Default
  #3
New Member
 
Join Date: Feb 2012
Posts: 13
Rep Power: 5
MJ55 is on a distinguished road
Actually I've solved this model many times before and I always get good convergence. My mesh looked fine in ICEM so I'm really not sure why it came out like this.

How would I go about entering it as the gravity?
MJ55 is offline   Reply With Quote

Old   February 17, 2012, 05:23
Default
  #4
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 10,823
Rep Power: 85
ghorrocks has a spectacular aura aboutghorrocks has a spectacular aura aboutghorrocks has a spectacular aura about
Well, rather than setting the gravity to be -g, set it to 200*x or whatever your function is.
ghorrocks is offline   Reply With Quote

Old   February 17, 2012, 05:35
Default
  #5
Senior Member
 
Join Date: Jul 2011
Location: Berlin, Germany
Posts: 120
Rep Power: 6
monkey1 is on a distinguished road
Hi!
First I would agree with glenn, that your mesh looks weird. Especially when you look at the arrows CFX-Pre has drawn for your in- and outlet you can see, that they are not all perpendicular to the surface as I suppose they should be.

Nevertheless: You want to have something like: gravity[m/s^2]=200*z-coordinate right?
Then you should create an expression zgravity (or how ever you want to name it) in CFX-Pre wich contains:
200[s^-2]*z

As z is the Z-Coordinate in CFX an has the unit [m] and CFX wants m/s^2 as unit for the gravity you have to set the 200 as [1/s^2] so that the return value of the expression will be of the unit [m/s^2].

After doing that I would specify this expression "zgravity" in the "Gravity Y Dirn." in the bouyancy model in the basic settings of the domain definition tab. Looking at your coordinate system I suppose you want the gravity to drag towards the negative y-direction (to the bottom) right? if this is so, then you have to take the expression value by -1.

Hope I managed to express more or less clearly how I would proceed.
amin_gls likes this.
monkey1 is offline   Reply With Quote

Old   February 17, 2012, 08:44
Default
  #6
New Member
 
Join Date: Feb 2012
Posts: 13
Rep Power: 5
MJ55 is on a distinguished road
ghorrocks: I've tried setting the function as the gravity, that didn't work as it gave me the same error.

monkey1: The expressions I have been created have been more or less similar to what you have suggested. Regardless, after having tried your method I still get the same error:

Parameter 'Gravity Y Component' in object '/FLOW:Flow Analysis 1/DOMAIN: Default Domain/DOMAIN MODELS/BUOYANCY MODEL' has been assigned an expression that references the following unavailable variables: z

So CFX still hasn't picked up that z represents the distance across the body. This is what I want to solve.

I'm starting to think it may be easier to create a transient problem and model this expression with time as the variable?
MJ55 is offline   Reply With Quote

Old   February 17, 2012, 09:29
Default
  #7
Senior Member
 
Join Date: Jul 2011
Location: Berlin, Germany
Posts: 120
Rep Power: 6
monkey1 is on a distinguished road
I suppose you get the error either directly in CFX Pre or from the solver before it starts to solve right?
It Just crossed my Mind that the Variable Z might only be available during the solver run but that CFX needs the bouyancy Values while setting up the run...
Unfortunately I got no clue actually how to work around this problem
monkey1 is offline   Reply With Quote

Old   February 17, 2012, 09:41
Default
  #8
Senior Member
 
Join Date: Jul 2011
Location: Berlin, Germany
Posts: 120
Rep Power: 6
monkey1 is on a distinguished road
Just checked it on one of my files, the error is displayed directly in Pre.
Did try although pre gives the error to write out the .def file and start the run?
I realised that only because Pre is complaining does not necessarily mean the solver won't start...I had some problems (definitely not similar to yours but nevertheless) also with error messages from pre, called the support and they just told me "yeah we know...it came with the new version...but don't worry just write out your def file and all will work fine"

Maybe you give it just a try?

N.B. The transient idea you had first sounded good but I suspect that pre will also complain, that t is a varaibale that is not available at the moment your editing your Pre case...so same problem just with another name...maybe...
monkey1 is offline   Reply With Quote

Old   February 17, 2012, 12:22
Default
  #9
New Member
 
Join Date: Feb 2012
Posts: 13
Rep Power: 5
MJ55 is on a distinguished road
Interesting, CFX Pre did still write the def file.

However the solver still gave me the error message saying the z variable was not recognised.
MJ55 is offline   Reply With Quote

Old   February 18, 2012, 07:20
Default
  #10
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 10,823
Rep Power: 85
ghorrocks has a spectacular aura aboutghorrocks has a spectacular aura aboutghorrocks has a spectacular aura about
No, you have mis-interpreted the error message. It knows exactly what variable you are trying to link to, it is just saying that it is not allowing it. Usually this is because this introduces additional terms in the equations which CFX does not have in it.

So this means you will have to introduce buoyancy as a body force with a source term. But note unless you are very clever you will not be including the additional terms either - but whether they are significant or not depends on what you are modelling.
amin_gls likes this.
ghorrocks is offline   Reply With Quote

Old   February 18, 2012, 10:28
Default
  #11
New Member
 
Join Date: Feb 2012
Posts: 13
Rep Power: 5
MJ55 is on a distinguished road
I actually decided to use a time variable instead with a transient run. Worked perfectly!
MJ55 is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem in running ICEM grid in Openfoam Tarak OpenFOAM 6 September 9, 2011 17:51
CEL expression chirath2003 CFX 5 March 30, 2010 05:33
CEL problem jellio CFX 5 March 6, 2010 12:39
Help to create a CEL Expression Juan Maria Campos CFX 2 December 3, 2007 08:52
Creating, loop or iteration using expression edito Jan CFX 3 July 28, 2003 11:01


All times are GMT -4. The time now is 18:25.