|
[Sponsors] |
July 7, 2017, 11:12 |
Changing Variable On-the-Fly
|
#1 |
New Member
Rodrigo
Join Date: Jul 2015
Posts: 18
Rep Power: 11 |
I’m trying to perform a CFX simulation and I would like to change a variable while the simulation is running (on-the-fly).
So far, I'm able to perform different simulations using the same definition file (.def) changing the input variable with the perl script. However, It doesn't allow me to change that variable on the fly. It seems that I need to go to user functions. Am I in the correct direction? Could you give me some hints about it? Many Thanks! |
|
July 7, 2017, 11:14 |
|
#2 |
Senior Member
Join Date: Jun 2009
Posts: 1,857
Rep Power: 33 |
While monitoring the simulation using the ANSYS Solver Manager, you can "edit run in progress", change certain variables, and continue.
What variable do you need to change during the run? What is the goal of changing the variable during the simulation? Can it not be done automatically by the software? |
|
July 7, 2017, 11:23 |
|
#3 |
New Member
Rodrigo
Join Date: Jul 2015
Posts: 18
Rep Power: 11 |
Thank you for your quick Reply!
I am about to run a Propulsion Simulation and I would like to perform the Continental method which means changing the Propeller frequency in order to guarantee the Equilibrium of Forces. Therefore I start with my first Propeller frequency attempt and then I should correct it depending on the result of the Equilibrium of Forces (either increase or decrease it). |
|
July 9, 2017, 08:13 |
|
#4 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,826
Rep Power: 144 |
The usual way of doing this is to use a fixed frequency/speed, as that gives you a point on the propeller performance curve (torque versus frequency). You then do a second speed and get another point, and repeat, using frequencies determined by a root finding algorithm until you have the torque within an accuracy you are happy with.
You could do this using modify run in progress, but I see little advantage in it. You loose the previous data points, and you may wish to come back to them. |
|
July 9, 2017, 08:44 |
|
#5 | |
New Member
Thales
Join Date: Jul 2017
Posts: 4
Rep Power: 9 |
Quote:
|
||
July 9, 2017, 15:32 |
|
#6 | |
New Member
Rodrigo
Join Date: Jul 2015
Posts: 18
Rep Power: 11 |
Quote:
The usual way you commented is called as English Method. This way I am able to do as I said before using a perl script to change a definition file (.def). My question is more related with The Continental Method where the propeller frequency is varying up to the point where the equilibrium of forces is reached. So, I would like to change the propeller frequency on-the-fly. Do you have any idea how to do it in CFX? The user function seems to be the way to go, however I'm not sure about it. Thank you for your help and comment! Sent from my iPhone using CFD Online Forum mobile app |
||
July 9, 2017, 18:54 |
|
#7 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,826
Rep Power: 144 |
CFX does not appear to support editing CEL expressions when using edit the simulation in progress. So that means the "Continental Method" as you put it will not work. You will be forced to use the "English Method".
You could side-step this restriction using user fortran as Thales suggests. |
|
July 10, 2017, 05:22 |
|
#8 |
New Member
Rodrigo
Join Date: Jul 2015
Posts: 18
Rep Power: 11 |
Thanks for sharing your experience!
I will keep trying it. If I get a solution for that I post it here. |
|
July 10, 2017, 10:01 |
|
#9 |
Senior Member
Join Date: Jun 2009
Posts: 1,857
Rep Power: 33 |
Not sure what your goal is, but I assume that both methods: Continental and English will produce exactly the same numbers, correct?
Those methods where the equilibrium point is obtained by effectively using a root finding, i.e. find x such f(x) = 0, must be used with a lot of care. These methods assume that evaluations of f(x) are extremely fast; otherwise, the calculation could become very expensive due to unnecessary iterations effort. Adjusting a physical parameter based on incomplete information, i.e. non-converged information, may be subject to highly non-linear behavior you must deal with. My 2 cents. |
|
July 10, 2017, 10:08 |
|
#10 |
Senior Member
Join Date: Jun 2009
Posts: 1,857
Rep Power: 33 |
Duplicate of previous post
|
|
July 11, 2017, 08:05 |
|
#11 | |
New Member
Thales
Join Date: Jul 2017
Posts: 4
Rep Power: 9 |
Quote:
The Continental has the goal to avoid two simulations, for that we need to correct the RPM during the simulation. |
||
July 11, 2017, 18:28 |
|
#12 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,826
Rep Power: 144 |
I think you would be wise to pay attention to Opaque's warning. The approach is risky. Also the extra cost of doing full simulations is not high in most cases - if you use previous simulations as initial conditions for the next simulation it should converge quickly as the simulations should not be very different from each other.
But it is your simulation so you can do it any way you like. |
|
July 12, 2017, 11:32 |
|
#13 |
Senior Member
Join Date: Jun 2009
Posts: 1,857
Rep Power: 33 |
Careful in interpreting your goals.
The goal of any simulation is to obtain meaningful results in the minimal amount of "wall clock time". It may be that a single simulation with adjusting RPM will produce the results you want in 1000 iterations, but two of them at fixed RPM will produce the results in 200 iterations each. I agree it would take a time to setup 2 of them, monitored and compute the final result; however, you may have finished the task earlier than the other simulation. |
|
July 12, 2017, 11:40 |
|
#14 |
New Member
Rodrigo
Join Date: Jul 2015
Posts: 18
Rep Power: 11 |
In order to check it one could try both methods. Therefore the need of changing the variable on-the-fly.
Anyhow, thanks for all the comments! |
|
Tags |
cfx-pre, changing variable, fortran, user function |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
changing a variable (turbulence dissipation rate) formolation | m.beh | Fluent UDF and Scheme Programming | 6 | November 7, 2016 05:53 |
changing scheme variable with UDF? | Wagemakers | FLUENT | 17 | September 30, 2015 14:34 |
Variable name for heat flux | peterle | CFX | 4 | February 13, 2014 02:21 |
error in COMSOL:'ERROR:6164 Duplicate Variable' | bhushas | COMSOL | 1 | May 30, 2008 04:35 |
variable viscosity -NOT! | George Bergantz | Main CFD Forum | 15 | September 19, 2000 14:28 |