|
[Sponsors] |
February 16, 2012, 13:03 |
Help with creating a simple CEL expression
|
#1 |
New Member
Join Date: Feb 2012
Posts: 13
Rep Power: 14 |
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. |
|
February 16, 2012, 18:14 |
|
#2 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,871
Rep Power: 144 |
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. |
|
February 16, 2012, 19:40 |
|
#3 |
New Member
Join Date: Feb 2012
Posts: 13
Rep Power: 14 |
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? |
|
February 17, 2012, 05:23 |
|
#4 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,871
Rep Power: 144 |
Well, rather than setting the gravity to be -g, set it to 200*x or whatever your function is.
|
|
February 17, 2012, 05:35 |
|
#5 |
Senior Member
Join Date: Jul 2011
Location: Berlin, Germany
Posts: 173
Rep Power: 15 |
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. |
|
February 17, 2012, 08:44 |
|
#6 |
New Member
Join Date: Feb 2012
Posts: 13
Rep Power: 14 |
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? |
|
February 17, 2012, 09:29 |
|
#7 |
Senior Member
Join Date: Jul 2011
Location: Berlin, Germany
Posts: 173
Rep Power: 15 |
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 |
|
February 17, 2012, 09:41 |
|
#8 |
Senior Member
Join Date: Jul 2011
Location: Berlin, Germany
Posts: 173
Rep Power: 15 |
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... |
|
February 17, 2012, 12:22 |
|
#9 |
New Member
Join Date: Feb 2012
Posts: 13
Rep Power: 14 |
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. |
|
February 18, 2012, 07:20 |
|
#10 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,871
Rep Power: 144 |
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. |
|
February 18, 2012, 10:28 |
|
#11 |
New Member
Join Date: Feb 2012
Posts: 13
Rep Power: 14 |
I actually decided to use a time variable instead with a transient run. Worked perfectly!
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
CEL problem | jellio | CFX | 6 | July 14, 2016 06:15 |
Problem in running ICEM grid in Openfoam | Tarak | OpenFOAM | 6 | September 9, 2011 18:51 |
CEL expression | chirath2003 | CFX | 5 | March 30, 2010 06:33 |
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 12:01 |