CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

Automatic stop calculation

Register Blogs Community New Posts Updated Threads Search

Like Tree7Likes
  • 2 Post By chchong001
  • 4 Post By AlexanderZ
  • 1 Post By AlexanderZ

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 20, 2017, 03:10
Default Automatic stop calculation
  #1
New Member
 
ChenChong
Join Date: Jul 2017
Posts: 7
Rep Power: 8
chchong001 is on a distinguished road
hello,I am trying to stop calculation automatically according to a parameter value,such as temperature,if the temperature reach 300k,stop calculation.
Can someone help me? thanks a lot!
pmechz and tianjunjie like this.
chchong001 is offline   Reply With Quote

Old   October 20, 2017, 05:32
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
Hello.

You can do it through scheme script + UDF, or fluent GUI + UDF.
I will share with you these approaches, however, text is translated by google, I'm lazy to modify, excuse me.
1. http://www.eureka.im/996.html

2.

It is a way to take advantage of ANSYS Fluent's Convergence Conditions feature.

I have implemented the content as an example.

This is an example of configuring a certain number of Iteration as a convergence condition and stopping the calculation if satisfied.

It consists of two steps.

The first step is to set the convergence criterion through the UDF.

Code:
#include "udf.h"

real stop_coeff;




DEFINE_ADJUST(stop_value, d)

{

  Thread *t;

  cell_t c;




        if(N_ITER >= 416)

        {

        real stop_coeff=1;

        }

        else

        {

        stop_coeff+=1;

        }




  thread_loop_c(t,d)

  {

    begin_c_loop(c,t)

    {

      C_UDMI(c,t,0) = stop_coeff;

    }

    end_c_loop(c,t)

  }

}
As you can see, the variable stop_coeff continues to be changed until 415 iterations, and this value is stored in the UDM.

And when it reaches 416 times of iteration which is the target that is desired, stop_coeff is saved in UDM with a certain value.

This value remains constant for the 417th iteration.

(If you are familiar with Scheme, you can do this with Scheme instead of UDF.)

The next step is to set convergence judgment based on the content of the corresponding variable (UDM).

ANSYS FLUENT's "Convergence Conditions" feature allows you to configure.

This example averages the UDMI values of the entire cell and uses the values as a convergence criterion.

Therefore, we define an average value in "Report Definitions",

And in "Convergence Conditions" we set it to judge convergence based on this value.

The results show that although the Max Iteration number has not been reached and the "Residual Convergence Criterion" is set to "none"

As a result, you can see that the calculation stops at the desired target (Iteration 417).

Obviously the content is not efficient because it loops all cells.

Nevertheless, if you apply this method appropriately, it will be enough for the setting that you desire.

Best regards
AlexanderZ is offline   Reply With Quote

Old   October 20, 2017, 06:54
Default
  #3
New Member
 
ChenChong
Join Date: Jul 2017
Posts: 7
Rep Power: 8
chchong001 is on a distinguished road
thanks for your reply.you have provided 2methods,and I tried the second method as you said. But in "Convergence Conditions" ,I can't find " UDMI values",so how to set it ,could you give me the detail?
Attached Images
File Type: jpg 1.JPG (40.8 KB, 121 views)
chchong001 is offline   Reply With Quote

Old   October 22, 2017, 20:44
Default
  #4
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
Quote:
Originally Posted by chchong001 View Post
thanks for your reply.you have provided 2methods,and I tried the second method as you said. But in "Convergence Conditions" ,I can't find " UDMI values",so how to set it ,could you give me the detail?
Hello

in Fluent GUI go to "Solution" -> "Report Definitions" -> create new for User-Defined variable ( in Field variable choose User-Defined Memory... and select UDMI - 0, for this example)

Than you will have this report definition in "Convergence conditions" menu.

If you are not familiar with UDF and user-defined memory, try to use google and ANSYS Fluent Customization Manual

Best regards
dlkadk likes this.
AlexanderZ is offline   Reply With Quote

Old   October 24, 2017, 04:14
Smile
  #5
New Member
 
ChenChong
Join Date: Jul 2017
Posts: 7
Rep Power: 8
chchong001 is on a distinguished road
Quote:
Originally Posted by AlexanderZ View Post
Hello

in Fluent GUI go to "Solution" -> "Report Definitions" -> create new for User-Defined variable ( in Field variable choose User-Defined Memory... and select UDMI - 0, for this example)

Than you will have this report definition in "Convergence conditions" menu.

If you are not familiar with UDF and user-defined memory, try to use google and ANSYS Fluent Customization Manual

Best regards
Thanks you very much, I have already solved the problem with your help!best wishes for you!
chchong001 is offline   Reply With Quote

Old   April 16, 2018, 05:35
Default
  #6
Member
 
Join Date: Nov 2017
Posts: 54
Rep Power: 8
Saman95 is on a distinguished road
hi dear

I use Ansys fluent 2017, but i can't find "convergence conditions"
can u help me?

Also I can't find User-Defined variable in Field variable of report definitions
Saman95 is offline   Reply With Quote

Old   April 16, 2018, 22:25
Default
  #7
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
"convergence conditions" is implemented in version 18.0

best regards
AlexanderZ is offline   Reply With Quote

Old   April 17, 2018, 05:02
Default
  #8
Member
 
Join Date: Nov 2017
Posts: 54
Rep Power: 8
Saman95 is on a distinguished road
Quote:
Originally Posted by AlexanderZ View Post
"convergence conditions" is implemented in version 18.0

best regards
I have another question

when i go to "Report Definitions" , I have some choices like area weighted average and etc
which of these task I must choose for your example?

also what is stop criterion in convergence manager in fluent 17?
Saman95 is offline   Reply With Quote

Old   April 17, 2018, 05:31
Default
  #9
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
because you apply same value to UDMI_0 ,that's why it doesn't matter, which option you will select, area-weight average for instance.

for v17.0 I recommend you to use 1st approach with scheme script

best regards
AlexanderZ is offline   Reply With Quote

Old   January 16, 2021, 08:00
Default
  #10
New Member
 
Sagar
Join Date: Apr 2016
Posts: 23
Rep Power: 10
ksgr is on a distinguished road
Quote:
Originally Posted by AlexanderZ View Post
Hello.

You can do it through scheme script + UDF, or fluent GUI + UDF.
I will share with you these approaches, however, text is translated by google, I'm lazy to modify, excuse me.
1. http://www.eureka.im/996.html

2.

It is a way to take advantage of ANSYS Fluent's Convergence Conditions feature.

I have implemented the content as an example.

This is an example of configuring a certain number of Iteration as a convergence condition and stopping the calculation if satisfied.

It consists of two steps.

The first step is to set the convergence criterion through the UDF.

Code:
#include "udf.h"

real stop_coeff;




DEFINE_ADJUST(stop_value, d)

{

  Thread *t;

  cell_t c;




        if(N_ITER >= 416)

        {

        real stop_coeff=1;

        }

        else

        {

        stop_coeff+=1;

        }




  thread_loop_c(t,d)

  {

    begin_c_loop(c,t)

    {

      C_UDMI(c,t,0) = stop_coeff;

    }

    end_c_loop(c,t)

  }

}
As you can see, the variable stop_coeff continues to be changed until 415 iterations, and this value is stored in the UDM.

And when it reaches 416 times of iteration which is the target that is desired, stop_coeff is saved in UDM with a certain value.

This value remains constant for the 417th iteration.

(If you are familiar with Scheme, you can do this with Scheme instead of UDF.)

The next step is to set convergence judgment based on the content of the corresponding variable (UDM).

ANSYS FLUENT's "Convergence Conditions" feature allows you to configure.

This example averages the UDMI values of the entire cell and uses the values as a convergence criterion.

Therefore, we define an average value in "Report Definitions",

And in "Convergence Conditions" we set it to judge convergence based on this value.

The results show that although the Max Iteration number has not been reached and the "Residual Convergence Criterion" is set to "none"

As a result, you can see that the calculation stops at the desired target (Iteration 417).

Obviously the content is not efficient because it loops all cells.

Nevertheless, if you apply this method appropriately, it will be enough for the setting that you desire.

Best regards
I am trying to stop simulation when the temperature of the cell zone falls below a certain threshold value. I am trying to use the second approach which is is mentioned above. However, I am not sure what should I write for the volume averaged temperature variable in place of N_ITER (which corresponds to number of iterations). Any help would be appreciated.

Thanks
ksgr is offline   Reply With Quote

Old   January 18, 2021, 00:54
Default
  #11
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
instead of condition in UDF
Code:
if(N_ITER >= 416)
you may put here any other condition according to your needs
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   February 3, 2021, 08:36
Default Stop Iterations Execute command
  #12
New Member
 
Alaa
Join Date: Feb 2021
Posts: 1
Rep Power: 0
Temimy is on a distinguished road
Quote:
Originally Posted by AlexanderZ View Post
instead of condition in UDF
Code:
if(N_ITER >= 416)
you may put here any other condition according to your needs
Hello dear,
I'm using ANSYS 2019 , and try to use solution>calculation activities>Execute Commands to stop the transient solution iterations based on defined Report Definition for heat flux<100.

Can you help me to put the appropriate statement into execute command window, please.

Regards.
Temimy is offline   Reply With Quote

Reply


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Transfer output data as input for second calculation mannobot Main CFD Forum 3 December 7, 2018 09:37
compiling firefoam Farshad_Noravesh OpenFOAM 27 December 24, 2012 04:21
FSI doesnt stop if i click stop button peterputer CFX 7 November 20, 2012 15:56
continuityErrs.h, coninuity equation, automatic stop are reaching continuity idrama OpenFOAM 0 September 20, 2010 15:09
transient simulation of a rotating rectangle icesniffer CFX 1 August 8, 2009 07:25


All times are GMT -4. The time now is 12:30.