CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   Getting solution values per iteration (https://www.cfd-online.com/Forums/cfx/23138-getting-solution-values-per-iteration.html)

 Joao Bettencourt October 4, 2006 08:16

Getting solution values per iteration

Hi,

I want to use the value of CL and/or Cd as criteria for convergence. I'm thinking of calculating something like (CL(i)-CL(i-1))/CL(i-1), where i is the current iteration and i-1 is the previous. How can i get the values of variables from the previous and current iteration and do such a calculation?

Thanks

Joćo

 Joe October 4, 2006 08:52

Re: Getting solution values per iteration

AFAIK you will have to use MMS to create user variables on the stack user /USER_DATA to store the previous iterations values and then use a user CEL function to read them e.g.:

(CL(i)-CL(i-1))/CL(i-1)

CL(i) will be a standard CEL expression defined in CFXpre. CL(i-1) will be a call to a user CEL routine e.g. getPreviousCL(args)

You had better have hairy balls because MMS isnt for the feint of heart.

 Joao Bettencourt October 4, 2006 09:01

Re: Getting solution values per iteration

Joe,

Thanks. I was gessing it wouldn't be easy...Just what is MMS, so that I can get this started?

Joao

 Robin October 4, 2006 10:24

Re: Getting solution values per iteration

It is not recommended to converge based on a global parameter like this. It is entirely possible that the lift coefficient could stabilize for a while then change. For instance, the boundary layer may continue to develop slowly and have little effect on lift, then separate, which will have a dramatic effect on lift. In such a case, your convergence criteria would completely miss the separation.

The best criteria for convergence are the MAX and RMS residuals. It would be better to determine what MAX or RMS residual level is needed to get your lift coefficient within a required tolerance and stick with this value.

Keep in mind that simply observing that a value doesn't change does not mean you have a solution.

Regards, Robin

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