CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   CD and CL convergence history get overwritten (https://www.cfd-online.com/Forums/fluent/120971-cd-cl-convergence-history-get-overwritten.html)

ziggo July 18, 2013 08:23

CD and CL convergence history get overwritten
 
I'm running a simulation on a cluster, so I direct all actions through a journal file.
In that file I enable the drag and lift monitors as follows:

Code:

/solve/monitors/force/drag-coefficient y wall-air () y y "./output/cd-25" n n 0 0 -1
/solve/monitors/force/lift-coefficient y wall-air () y y "./output/cl-25" n n 0 1 0

Both monitors get written to a file (cd-25 and cl-25) but Fluent (v14) overwrites the file on every time step (it's a transient 3D simulation)
This means that I don't get a list of values, but the file is constantly updated with a new value during the simulation.
What I want is a list of time and cl or cd values, how do I enable that?

blackmask July 18, 2013 10:06

Try
Code:

/solve/monitors/force/set-drag-monitor cd-1 yes wall-air () yes yes "./output/cd-25" no no 0 0 -1
/solve/monitors/force/set-force-monitor cl-1 yes wall-air () yes yes "./output/cl-25" no no 0 1 0


Far July 18, 2013 12:07

http://hpc.hud.ac.uk/w/images/2/2b/F..._Reference.pdf

ziggo July 19, 2013 11:41

@blackmask:
Thank you for the suggestion but both Fluent v14 and v13 say that those are invalid commands.
My original commands work with v13 as they should. A list of CL and CD values is stored in a text file for every timestep. The file is not overwritten every time.

@Far:
Thank you for trying to help me. Could you please be a bit more specific on what you wanted to refer to in that document? I searched for drag and monitor, but found nothing that resembles the code I had.

star July 21, 2013 12:52

convergence criteria
 
Hello friends. I just started to work on Fluent 14.0. I am learning it to simulate flow around an airfoil. I want to ask a basic question.
How will we know that solution has converged? Is it depend on the value of Residuals which we set? and if it converges, it means the solution is correct?
I will thankful if somebody help me...

ziggo July 21, 2013 17:20

Hi Star,

This topic is not about your subject. Please search the forums or ask a new question in a separate topic (in the Fluent forum). But please search first.

ziggo July 22, 2013 14:19

@blackmask
I tinkered around with your proposed solution and found the correct one.
It is as follows:

Code:

/solve/monitors/force/set-drag-monitor cd-1 yes wall-air () yes yes "./output/cd-25" no no 0 0 -1
/solve/monitors/force/set-lift-monitor cl-1 yes wall-air () yes yes "./output/cl-25" no no 0 1 0

It was lift-monitor instead of force-monitor. This code only works in fluent v14. For v13 the code I originally posted works. Thank you for your help.

behest August 16, 2013 19:51

Hi my friend
Thank you very much for your guidline. Actually, I am simulating a fluid flow around a 3D wing, transient, by Fluent 14. I also have the same problem with you and I can not obtain convergence history of CL and CD. The values are updated in every time step and replace.
It would be appriciated if you help me and give me more details how was solved your problem.

cheers,

Quote:

Originally Posted by ziggo (Post 441302)
@blackmask
I tinkered around with your proposed solution and found the correct one.
It is as follows:

Code:

/solve/monitors/force/set-drag-monitor cd-1 yes wall-air () yes yes "./output/cd-25" no no 0 0 -1
/solve/monitors/force/set-lift-monitor cl-1 yes wall-air () yes yes "./output/cl-25" no no 0 1 0

It was lift-monitor instead of force-monitor. This code only works in fluent v14. For v13 the code I originally posted works. Thank you for your help.


ziggo August 17, 2013 03:01

How does your code look? Can you post your commands that write the CD and CL history, just as I did in my first post?

behest August 17, 2013 05:43

1 Attachment(s)
Actually, we applied Fluent 14 software and we create 2 commands in "calculation activities" like below:
/solve/monitors/force/set-drag-monitor cd-1 yes wing () yes yes "./output/cd-25" no no 0 0 1
/solve/monitors/force/set-lift-monitor cl-1 yes wing () yes yes "./output/cl-25" no no 0 1 0
I enclose a picture from the software too.
The code is the last one you suggested, but the problem has not solved yet. Please make any comments

Quote:

Originally Posted by ziggo (Post 446253)
How does your code look? Can you post your commands that write the CD and CL history, just as I did in my first post?


ziggo August 17, 2013 13:13

From your screenshot I see that you're executing the command every iteration.
As the command sets up a force monitor with the name cd-1 (or cl-1) which writes to the file cd-25 (or dl-25) in the folder output. With your situation every iteration a force monitor is setup with the same name and the same output file, so naturally the force history gets overwritten every iteration.

As you're not using the text user interface I would not recommend using the two lines of code I supply in my post. I'm not sure you understand what they do, so the outcome might not be what you want.
It's easier to use the graphical user interface.

1) Go to the Monitors tab
2) Press Create -> Drag
3) Fill in the form
4) Do the same with Create -> Lift

behest August 18, 2013 12:38

Thank you very much. Unfortunately, I applied graphical user interface, too; and as you said, I used monitors tab and lift and drag was created and their forms were filled out, too. But The files were overwritten again. The software writes last time step results to the files.
Please make a comment and help me to solve it. I need a convergence history.
May you learn me exactly what you did? How can I use text user interface?

ziggo August 18, 2013 15:15

When you setup the lift and drag monitors through the Monitors tab only everything should work as expected and the force history should be saved.

Perhaps you ran the simulation both with the monitors set through the Monitors tab and through the Calculation Activities?

Below you can find the steps to use the Text User Interface (TUI):

1] Click in the command window. That's where it says "Interrupting client" and "Done." in your screenshot.

2] Hit enter. A list of menu items appears. One is "solve/".

3] Type solve and hit enter twice. You are now in the "solve" menu and you see a list of different commands in that menu. If you want to go up to the main menu type "q" and hit enter.

4] Type "monitors" and hit enter twice. You are now in the "monitors" menu that contains different menu items. One of them is "force/".

5] Type "force", hit enter twice.

6] Type "clear-monitors", hit enter and then type "yes". This will delete any monitors you've previously set. This prevents any monitors being created with the same name, but make sure you recreate all the monitors you had through the TUI.

7] Type "set-lift-monitor" to setup a lift force monitor. Then type in the desired monitor name. The default is shown in between square brackets (it's cl-1 on my machine). Name it anything you want or don't type anything and hit enter to keep the default.

8] Fluent now will ask you questions to setup the monitors. When it asks for "zone id/name(1)" type in the name of the object on which the force will work. If everything is correct you defined this name yourself as a named selection. If you don't know the name look it up through "Display -> Mesh" in the menu bar. You can now show/hide different surfaces and find the name of the surface you want to know the forces for.

9] Next it asks for a second zone for which forces should be monitored. Leave it empty by just hitting enter.

10] "Print data?" refers to the printing of the data to the command window during the simulation. Answer whatever suits you most.

11] "Write data?" refers to the force history you're after. Type "yes" hit enter and then type a convenient filename for it.

12] "Plot data?" answer "yes" if you want to see the force monitor data plotted during the simulation. Define a window id for the plot in the next question, the default value should be ok.

13] "Plot per zone" should be set to "no" if you're only monitoring one surface.

14] "x/y/z-component of lift vector". The answer to these three questions really depends on how you've setup your simulation. If your flow is in the direction of the negative z-axis and your y-axis is pointing upwards the x-component of the lift monitor should be 0, y-component 1 and z-component 0. But again, decide this for yourself according to the situation you're simulating.

15] Now you're back again in the "force" menu.

Now you've setup the lift monitor and I hope you understand, based on this experience, how to setup the drag monitor.

Make sure that the commands you're showing in the screenshot are not executed every iteration.

behest August 20, 2013 14:27

Thank you very much my friend. Your comment is very helpful.
I did do all steps that you said. It works when I select the serial in the processing options, Fluent Launcher. But when I want to use the parallel option, the convergence history files will be overwritten again.
Do you have any solution to solve it? Actually, the mesh is very big and I should use the parallel process

ziggo August 20, 2013 15:24

If it works in serial mode it should work in parallel as well if you do the exact same steps. As far as I know there should be no difference.

I would advise opening up a new thread on this forum with the serial/parallel problem as it seems unrelated to the original question of this thread.

Guitou December 13, 2013 10:09

Solution
 
Ok, I had the same problem with v14.5.7, and had encountered the same problem in the past with other versions. I did find a solution. I remembered I didn't have the issue when running on HPC clusters, so I thought there was an issue with this feature when used from the GUI.

To get your files to increment rather than be overwritten, you can launch your computation without the GUI. Just run it (I'm talking linux here, but I'm pretty sure you can do the same in windows) using the "fluent -t nprocx -g -i journal.jou". I use a journal to launch the computation and it works well. You can make you journal very short by setting everything up in the case file from the GUI, save the case file, and then launch from the command line using the command above. in this case, the journal is simply :

/file/read-case "fluent_simulation.cas"
/file/read-data "fluent_simulation.dat"
/solve/dual-time-iterate
20
1000
yes
yes
/exit
yes
I don't know if it works without the journal by just typing those commands in the command line (I don't see why it wouldn't), but you can try it.

Hope this helps !

star December 19, 2013 23:05

Thanks Guitou for your help. Because of history overwriting problem i switch to fluent 6.3 instead of Ansys 14.0. I didn't get the procedure completely which you have shown. I am using window 7. Can you please write in steps what and how to write journal file to get CL history. e.g I want to get CL history after every 1e-04 sec. I will be thankful. Thanks in advance.

Guitou December 20, 2013 14:01

I don't really know if it is any different in windows 7 since I only have my Fluent under linux. However, I'm pretty sure you can still launch from the command window under win7, which is the principal step.

  1. First, from the GUI, setup you case file all the way including setting up the proper time step, convergence criteria, monitors (drag and lift) etc... Basically everything you would do and stop before clicking the "calculate" button. Save your case file, data file, and close the fluent GUI.
  2. Then you need to write a journal file (e.g journal.jou) which basically contains all the command you'll want to run in fluent. Usually, it's reading the case file, reading the data file, and run the calculation. The journal should be something like that:
    Code:

    /file/read-case "your_fluent_simulation.cas"
    /file/read-data "your_fluent_simulation.dat"
    /solve/dual-time-iterate
    20
    1000
    /exit
    yes

  3. Then you need to launch fluent from the command line without gui, and read the journal. Open the command line and go in the folder where your case, data, and journal files are located and type:
    Code:

    fluent -v2ddp -tnx -g -i journal.jou
    of course, change the -v2ddp to whatever solver you want (3ddp, 3d, 2d) and the -tnx so that nx reflects the number of processors you want to use (if you want to run serial, remove that option).

If you want a 1e-4 time step in your CL, Cd, you need to solve with a time step of 1e-4 at least. If you don't want to setup the Cl and Cd in the gui, you can add these lines in the journal, before the dual-time-iterate line:

Code:

/solve/monitors/force/drag-coefficient y wall-zone () y y "./output/cd-file-name" n n 0 0 -1
/solve/monitors/force/lift-coefficient y wall-zone () y y "./output/cl-file-name" n n 0 1 0

Your output files will be in the folder you're running from.
I hope this helps...

guxin7005 November 10, 2014 14:12

use jou file in GUI can solve the overwriting problem. Thank you a lot!

Quote:

Originally Posted by Guitou (Post 467235)
I don't really know if it is any different in windows 7 since I only have my Fluent under linux. However, I'm pretty sure you can still launch from the command window under win7, which is the principal step.

  1. First, from the GUI, setup you case file all the way including setting up the proper time step, convergence criteria, monitors (drag and lift) etc... Basically everything you would do and stop before clicking the "calculate" button. Save your case file, data file, and close the fluent GUI.
  2. Then you need to write a journal file (e.g journal.jou) which basically contains all the command you'll want to run in fluent. Usually, it's reading the case file, reading the data file, and run the calculation. The journal should be something like that:
    Code:

    /file/read-case "your_fluent_simulation.cas"
    /file/read-data "your_fluent_simulation.dat"
    /solve/dual-time-iterate
    20
    1000
    /exit
    yes

  3. Then you need to launch fluent from the command line without gui, and read the journal. Open the command line and go in the folder where your case, data, and journal files are located and type:
    Code:

    fluent -v2ddp -tnx -g -i journal.jou
    of course, change the -v2ddp to whatever solver you want (3ddp, 3d, 2d) and the -tnx so that nx reflects the number of processors you want to use (if you want to run serial, remove that option).

If you want a 1e-4 time step in your CL, Cd, you need to solve with a time step of 1e-4 at least. If you don't want to setup the Cl and Cd in the gui, you can add these lines in the journal, before the dual-time-iterate line:

Code:

/solve/monitors/force/drag-coefficient y wall-zone () y y "./output/cd-file-name" n n 0 0 -1
/solve/monitors/force/lift-coefficient y wall-zone () y y "./output/cl-file-name" n n 0 1 0

Your output files will be in the folder you're running from.
I hope this helps...


jfjf1g12 December 9, 2014 14:15

Hi guys,

I am running a transient solution for a ship propeller. I have a similar problem that is I can't seem to save my Cl convergence history. I tried using the method above but the journal file returns an error after the last iteration of that time step. It seems that it is not able to save the Cl data. Any ideas on why is that?

Kind regards,
Jeremy


All times are GMT -4. The time now is 02:17.