How not to consider the first iterations in the parametric calculation in Fluent?

  • 29 Views
  • Last Post 3 weeks ago
andreaimpiombato posted this 06 November 2019

Hi,
I have the following problem with Ansys Fluent Workbench 2019 R2. I am conducting a transient parametric simulation (I want to use the response surface) but I would like to eliminate the first two iterations from the calculation since they provide non-physical results while the following are correct.

how can I solve this problem?

I am currently printing the values in a .txt file and processing them without considering the first two lines.

A second question that derives from this problem: how can I write a UDF that calculates the Root Mean Square of incoming pressures and gives this result as an output parameter?

Order By: Standard | Newest | Votes
abenhadj posted this 5 weeks ago

How are you printing? I guess you may create report definition per udf and ignore the first iterations. Same can be done within an expression with 2019R3.

Best regards,

Amine

andreaimpiombato posted this 5 weeks ago

Thanks for the answer.

I print the pressure values compute in inlet (because in outlet I setted p=0); as you can see the first two values are incorrect:

Next, I calculate the Root Mean Square of each variable with MATLAB not considering the first two iterations.

This result is the variable that interests me.

I repeat this procedure for each simulation.

Finally, through Matlab, I get the response surface.

Surely I can automate everything, but I don't know how. With my procedure I can control the variables.

Is it possible to write a UDF (or some procedure) that allows me to calculate the RMS of the pressure variable without considering the two initial iterations? if so, how? are there some tutorials?

I can´t use the 2019R3 version because all project it is in 2019R2 version in the university.

 

Thanks very much

 

abenhadj posted this 5 weeks ago

Check customization manual for UDF. In MATLAB you can write code to always ignore the first values. In Fluent you can 3an two iterations abdvtgen start writing files. You can autonate this via journal.

Best regards,

Amine

  • Liked by
  • andreaimpiombato
abenhadj posted this 5 weeks ago

And yiu directly access mean and RMSE values in Flyebt whenver you ebable statistics gathering.

Best regards,

Amine

andreaimpiombato posted this 4 weeks ago

thank you so much,
but I am interested in defining the variables through the UDF as the RMS that calculates fluent does not convince me and has a different definition from the one I have to use.

Best Regards

rwoolhou posted this 4 weeks ago

Can you use an IF statement so that the UDF doesn't calculate anything until time > something? 

  • Liked by
  • andreaimpiombato
abenhadj posted this 4 weeks ago

Basic conditional treatment inside the routine.

Best regards,

Amine

abenhadj posted this 4 weeks ago

Even doable via Expressions.

Best regards,

Amine

  • Liked by
  • andreaimpiombato
andreaimpiombato posted this 3 weeks ago

Yes,

I tried the IF loop in the UDF, but still calculates the values. As if it bypassed the cycle.

Regards

andreaimpiombato posted this 3 weeks ago

Thanks for your help,
I try with the road of Expressions.

IF(iter<=2, 0, sqrt(...))

Within sqrt (...) I would like to specify the sum of the pressure values calculated for each iteration.
How do I add up over time? It can be done?

Best regards

abenhadj posted this 3 weeks ago

Look in the manual there are some example or in any c tutorial

Best regards,

Amine

Close