# Buoyancy convergence - Increase gravity vector using CEL (aitern)

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

 November 20, 2017, 12:16 Buoyancy convergence - Increase gravity vector using CEL (aitern) #1 New Member   Nicolas Neuburger Join Date: Jun 2016 Posts: 3 Rep Power: 3 Hello, i have a problem with a setup that comprises 2 domains: Hot air flowing through an insulated pipe (Domain 1) The pipe is cooled by natural convection (Domain 2) Due to complex geometry around the pipe, i get non-realistic velocities (> Mach 800) in the natural convection domain after 10-15 solver iterations. To improve convergence I would therefore like to apply the gravitational force in small steps using CEL (so i wouldn't have to do it by hand and can run the simulation overnight): NCzapplied = -.981*(1+(1-step(Iter-aitern))+(1-step(2*Iter-aitern))+(1-step(3*Iter-aitern))+(1-step(4*Iter-aitern))+(1-step(5*Iter-aitern))+(1-step(6*Iter-aitern))+(1-step(7*Iter-aitern))+(1-step(8*Iter-aitern))+(1-step(9*Iter-aitern))) Iter is a constant of 50, so the gravitational vector increases from -.981 m s^-2 in 9 steps to -9.81 m s^-2 over 450 solver iterations and then remains constant. CFX can plot the expressions just fine. My problem is now, I am getting the following Expression Error and I'm not sure wheter this is intended to be unavailable for the buoyancy model (and why?) or whether I am doing something wrong: Parameter 'Gravity Z Component' in object '/FLOW:Flow Analysis 1/DOMAIN:Air/DOMAIN MODELS/BUOYANCY MODEL' has been assigned an expression that references the following unavailable variables: aitern Any help would be much appreciated!

 November 20, 2017, 18:19 #2 Super Moderator   Glenn Horrocks Join Date: Mar 2009 Location: Sydney, Australia Posts: 14,313 Rep Power: 110 Thanks for providing the background for this question. The background confirms that your question is a classic XY question (http://xyproblem.info/). In other words, your question is how do I implement gravity as a function of iteration number; but the real problem is how do I get this simulation to converge. I would not recommend implementing variable gravity as a good solution to this problem. I am pretty sure it won't help anyway. Your problem is going to be more fundamental than that, so you need to find the fundamental problem rather than introducing the fundamental problem slowly. First of all, please check the basics on these FAQs on convergence: https://www.cfd-online.com/Wiki/Ansy...gence_criteria and https://www.cfd-online.com/Wiki/Ansy...do_about_it.3F If that does not work please post images of what you are modelling, your mesh and your CCL.

 November 21, 2017, 03:06 #3 New Member   Nicolas Neuburger Join Date: Jun 2016 Posts: 3 Rep Power: 3 I appreciate your answer, however ramping up the bouyancy by hand in small steps runs the simulation just fine - maybe i should've added that information right away. that's why I asked if/why it is not possible to use aitern as gravity component for the buoyancy model?

 November 22, 2017, 23:54 #4 Super Moderator   Glenn Horrocks Join Date: Mar 2009 Location: Sydney, Australia Posts: 14,313 Rep Power: 110 I am not completely sure why you cannot make gravity a function of aitern. Variable gravity will introduce new terms in the equations which have not been included in CFX. But if CFX has made a certain option not available there will be reason for it (I just don't know what it is). A better approach might be to ramp up the temperature or flow rate rather than ramping gravity.

 November 23, 2017, 08:05 #5 New Member   Nicolas Neuburger Join Date: Jun 2016 Posts: 3 Rep Power: 3 my problem is the entire domain is driven only by natural convection due to the hot surface resulting from heat transfer from the pipe with the throughflow, so gravity is the only value that i could change in that domain... Thinking of it, the surface temperature should be independent of the mass flow in a stationary simulation, as there will just be less natural convection induced... i will give this a try.

 November 27, 2017, 10:42 #6 Senior Member     Mr CFD Join Date: Jun 2012 Location: Britain Posts: 353 Rep Power: 8 Instead of aitern why can't you just use the variable, time? In steady state it should use the false pseudo time, and in transient it should use the transient time. You can achieve this using a simple user function. Step 1) create a new user function called RampGravity Step 2) set the argument units to [s] and the resultant units to [m/s^2] Step 3) Set coordinate 0 and value 0 Step 4) Set coordinate 20 and value 9.81 Step 5) Set coordinate 21 and value 9.81 Step 6) Select "extend min" and "extend max" Step 7) Apply and close the menu Step 8) Create a new expression called MyRampGravity Step 9) Set the definition of MyRampGravity to RampGravity(t) Step 10) In your domain setup set your gravity to the expression MyRampGravity Tip: in the expression MyRampGravity you can plot the curve/ramp if you want to see what it looks like. Tip 2: in step 6 "extend max" is crucial, otherwise after 21 [s] g = 0 [m/s^2] Tip 3: see if my method works when you replace time with aitern Tip 4: post outcome of your energy and mass balance...you have done this right? Tip 5: use equation 15-2 to estimate your time step, and then reduce it by an order of magnitude (https://www.sharcnet.ca/Software/Ans.../i1313401.html) Tip 6: you can under relax the energy equation by using the temperature damping function I'm assuming your mesh quality, CFX setup and everything else is perfect

 November 28, 2017, 19:25 #7 New Member   Join Date: Dec 2016 Posts: 7 Rep Power: 3 Are you using CFX5 standalone or in a version of Workbench? If you are sure that you will achieve convergence via slowly ramping gravity, there are a few Workbench tools that could help you automate this. Eg. you could set your gravity expression as a Workbench Parameter and while using the previous solution as initial conditions run design point updates from 0.1g to 1.0g. Alternatively if you don't enjoy Parameters you could have several Workbench CFX Modules feeding their results into the initial conditions of the next one. If you are using CFX5 on linux you should be able to bash script something similar with CFX-Pre macros.

 Tags buoyancy stepwise cel

 Thread Tools Display Modes Linear Mode

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

 Similar Threads Thread Thread Starter Forum Replies Last Post Admo FLUENT 3 February 23, 2012 11:43 derisala FLUENT 1 February 24, 2011 03:28 openfoam1 OpenFOAM 7 March 10, 2010 10:41 nasdak CFX 2 June 29, 2009 01:17 Ashish Pande FLUENT 0 May 12, 2006 03:36

All times are GMT -4. The time now is 10:44.