CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   How to implement a sensitivity analysis for certain items (https://www.cfd-online.com/Forums/cfx/142987-how-implement-sensitivity-analysis-certain-items.html)

Mason liu October 13, 2014 22:50

How to implement a sensitivity analysis for certain items
 
1 Attachment(s)
Hi,
I have read lots of the Sensitivity Analysis of some items, e.g. mesh size, inflation layer parameters,,, in this forum. But I'm not very sure how to implement this analysis. In my view maybe like below. Please give your comments.:confused:



For the first layer thickness(correlated with Yplus) of inflation layer, if we want to do a sensitivity analysis we need to keep the other mesh parameters same and just change first layer thickness(maybe 1e-2mm, 5e-3mm, 1e-3mm,,,) to finish several simulation and see if results(especially the variable you concern, maybe Drag Force) varies obviously.
  1. If no big difference, then the analysis is finished and we think that results are independent of first layer thickness. We can use this thickness(maybe 5e-3mm) in future sensitivity analysis of other parameters.
  2. If varies obviously, then we need to do further analysis of first layer thickness with other values(maybe 5e-2mm,,5e-4mm).
All in all, we need to find a region of first layer thickness within which variable we concern varies little(Form a flat region as below picture), then we can take this region as final value in further simulation.

Attachment 34377

Is my understanding about sensitivity analysis right or proper? Thank you so much.

ghorrocks October 14, 2014 00:24

I should write an FAQ to explain this idea more thoroughly.

The main problem with your description is that the whole concept assumes that the output parameter converges as the input parameter is refined. So coarse inputs (such as a coarse mesh) should give large changes as the input parameter is refined, fine inputs (such as a fine mesh) should give small changes as the input parameter is refined, and eventually the changes in input parameter result in changes in output parameter which is too small to see. Further refinement in the input parameter does not affect the output.

That is the ideal situation, some things which can cause headaches include:
* The sensitivities are coupled, so mesh refinement requires time step refinement and might also change you convergence criteria.
* You cannot refine the mesh too much as the simulation run time or memory requirements becomes too large
* Effects such as numerical round-off means you cannot refine the mesh or time step too far either

This is a very simple outline of it. This reference goes into more detail: http://journaltool.asme.org/Template...umAccuracy.pdf and the text book "Computational Fluid Dynamics" by Roache is the seminal textbook on CFD accuracy, so is definitely worth a read if you want a thorough understanding of it.

Mason liu October 14, 2014 02:39

Quote:

Originally Posted by ghorrocks (Post 514176)
I should write an FAQ to explain this idea more thoroughly.

Thank you.:) This would be really great for us.

Quote:

Originally Posted by ghorrocks (Post 514176)
That is the ideal situation, some things which can cause headaches include:

OK, you have given me a good clarification of sensitivity analysis, yes this is the ideal situation.

Quote:

Originally Posted by ghorrocks (Post 514176)
This is a very simple outline of it. This reference goes into more detail: http://journaltool.asme.org/Templates/JFENumAccuracy.pdf and the text book "Computational Fluid Dynamics" by Roache is the seminal textbook on CFD accuracy, so is definitely worth a read if you want a thorough understanding of it.

Thank you, I'm trying to find this book's pdf edition for convenient read.

Mason liu October 14, 2014 03:12

1 Attachment(s)
Quote:

Originally Posted by ghorrocks (Post 514176)
I should write an FAQ to explain this idea more thoroughly.

Hi, Glenn, thank you. Another question.

Is it acceptable that last cell thickness in inflation layer is very small than nearby tetra element size? Like below picture, I know that mesh in (B) is obviously good, but sometimes it's really hard to realize this expansion ratio. And my question is that 'mesh in (A) is acceptable???' Thanks a lot.

Attachment 34385

ghorrocks October 14, 2014 05:57

Case B is preferable. But whether A is acceptable will depend on what you are modelling. Different models have different sensitivities to mesh quality. The best thing to do here is to do a sensitivity study on this parameter (the ratio of the element size from the tets to the first prism layer) and see if it makes a difference in your case.

camposrf August 10, 2017 23:10

Is my mesh good enough?
 
Thanks ghorrocks for helping everyone.

I was applying those criteria but I did not know that this procedure had a name. I found this article for FEA simulation that complements your idea:

https://caeai.com/blog/how-do-i-know...sh-good-enough

Quote:

Originally Posted by Steven Hale at caeai.com;
(...) Meshes that are "good enough" are ones that produce results with an acceptable level of accuracy, assuming that all other inputs to the model are accurate. (...)

(...) One of the ways to evaluate the quality of your mesh (and a model overall) is to compare results to test data or to theoretical values. (...)

(...) The most fundamental and accurate method for evaluating mesh quality is to refine the mesh until a critical result, such as the maximum stress in a specific location converges (i.e. it doesnít change significantly with each refinement) (...)

(...) Another option is to evaluate the magnitude of stress discontinuity between adjacent elements in the critical region. (...)

I start the simulation with a very coarse mesh and a poor residuals convergence, just looking for potential errors; Most of them are simple errors that I could have noticed before running the simulation. Many times I ran the simulation and had to wait a lot of time to discover in the post processing that I had done something wrong in the data loading process (it is very frustrating). Then when everything looks fine I try to refine the mesh in the critical areas where I need the information and improve the convergence. If the result overall makes sense then I put a little nodes more, if the result is pretty similar to the previous one I stop simulating.

At the beginning, I though that CFX meshing software had some hidden command to evaluate the mesh. :)

JuPa August 14, 2017 08:13

In the .out file you can see the mesh statistics, which are measured by:
OK
ok
!

OK - this is good
ok - this is "okay" but can be improved if needed
! - this needs attention

ghorrocks August 14, 2017 08:21

Thanks Mr CFD, it is good to mention those quality measures.

Note that these mesh quality measures (and in fact any mesh quality measures) need to be considered against the simulation you are doing. For instance if you are doing a simple simulation - maybe a single phase flow at low Reynolds number - then lots of "!" mesh quality elements is still going to be fine. But if you are doing surface tension simulations then any elements which are out of the "OK" zone will cause problems.

So a mesh which is good for one type of simulation might not be good for another. So mesh metrics are just a guide.

camposrf August 14, 2017 15:35

Mesh statistics measure
 
Quote:

Originally Posted by JuPa (Post 660649)
In the .out file you can see the mesh statistics, which are measured by:
OK
ok
!

OK - this is good
ok - this is "okay" but can be improved if needed
! - this needs attention

Thanks JuPa.

Is it the same notation for CFX 5?

Did you mean the red words in the following extract of the output file?

If your answer is yes. what is the meaning of "**" and "F"?

I have no "!" in this file, so I guess "**" and "F" means this needs attention

================================================== ====================
OUTER LOOP ITERATION = 1 CPU SECONDS = 2.298E+01
----------------------------------------------------------------------
| Equation | Rate | RMS Res | Max Res | Linear Solution |
+-------------------+------+---------+---------+--------------------+
| U-Mom-Air at 25 C | 0.00 | 3.9E-06 | 9.3E-05 | 4.6E+00 F |
| V-Mom-Air at 25 C | 0.00 | 3.8E-06 | 8.8E-05 | 6.1E+00 F |
| W-Mom-Air at 25 C | 0.00 | 1.6E-02 | 1.7E+00 | 1.8E+00 F |
| U-Mom-Water | 0.00 | 2.4E-05 | 1.2E-03 | 4.4E+00 F |
| V-Mom-Water | 0.00 | 2.2E-05 | 1.3E-03 | 5.2E+00 F |
| W-Mom-Water | 0.00 | 2.4E-01 | 6.3E+01 | 1.2E+00 F |
| P-Vol | 0.00 | 7.5E-10 | 1.1E-07 | 17.2 2.6E-01 ok|
+----------------------+------+---------+---------+------------------+
| Mass-Air at 25 C | 0.00 | 1.1E-01 | 3.9E-01 | 10.7 1.7E-03 OK|
| Mass-Water | 0.00 | 9.9E-02 | 3.1E-01 | 10.6 2.5E-03 OK|
+----------------------+------+---------+---------+------------------+

================================================== ====================
OUTER LOOP ITERATION = 2 CPU SECONDS = 1.134E+02
----------------------------------------------------------------------
| Equation | Rate | RMS Res | Max Res | Linear Solution |
+----------------------+------+---------+---------+------------------+
| U-Mom-Air at 25 C |99.99 | 3.0E-03 | 3.5E-02 | 4.5E-02 OK|
| V-Mom-Air at 25 C |99.99 | 2.7E-03 | 3.3E-02 | 4.7E-02 OK|
| W-Mom-Air at 25 C |72.43 | 1.2E+00 | 7.5E+00 | 5.9E-04 OK|
| U-Mom-Water |99.99 | 8.5E-03 | 2.5E-01 | 6.4E-02 OK|
| V-Mom-Water |99.99 | 7.6E-03 | 2.4E-01 | 6.5E-02 OK|
| W-Mom-Water |12.06 | 3.0E+00 | 1.9E+01 | 6.6E-04 OK|
| P-Vol |99.99 | 6.4E-03 | 7.7E-01 | 9.1 8.0E-02 OK|
+----------------------+------+---------+---------+------------------+
| Mass-Air at 25 C | 0.39 | 4.2E-02 | 3.8E-01 | 10.6 1.1E-03 OK|
| Mass-Water | 0.70 | 6.9E-02 | 4.3E-01 | 10.6 1.3E-03 OK|
+----------------------+------+---------+---------+------------------+

| W-Mom-Water | 0.00 | 2.4E-01 | 6.3E+01 | 1.2E+00 F |
| P-Vol | 0.00 | 7.5E-10 | 1.1E-07 | 17.2 2.6E-01 ok|
| U-Mom-Air at 25 C |99.99 | 1.2E-05 | 2.6E-03 | NaN ok |
| U-Mom-Air at 25 C | 0.14 | 1.8E-06 | 3.0E-04 | NaN ** |
| Mass-Air at 25 C | 2.49 | 2.0E-02 | 1.0E+00 | 10.4 1.8E-02 OK|

ghorrocks August 14, 2017 20:04

Same notation as CFX-5 - Yes. But that is very old, I hope you are not using CFX5, it is very superseded now.

What you have shown here is different. You are showing the convergence of the linear solver. OK means the linear solver converged OK, "ok" means it converged but only just, F means it failed to converge but did not diverge massively, and the other symbols mean you may have a problem.

This is discussed in more detail in the CFX documentation.

camposrf August 17, 2017 09:46

CFX documentation
 
Thanks ghorrocks!

Quote:

Originally Posted by ghorrocks (Post 660728)
Same notation as CFX-5 - Yes. But that is very old, I hope you are not using CFX5, it is very superseded now.

Bad news! I am using it! :D Is the faster version I can use in my old PC. I already try 14.5 but it creates a lot of files and runs slow, I mean opening windows and these stuffs. Running the solver, it runs as fast as the version 10.

Quote:

Originally Posted by ghorrocks (Post 660728)
(...) What you have shown here is different. You are showing the convergence of the linear solver. (...)

I guess that, All the *.out files generated by cfx solver in my working folder says the same. I did not find any "mesh statistics", but the convergence report.


Quote:

Originally Posted by ghorrocks (Post 660728)
(...) This is discussed in more detail in the CFX documentation. (...)

Do you remmember the especific PDF help file? I found this "Pre_SolverControl.pdf" but I did not see anything about mesh statistics.


All times are GMT -4. The time now is 09:15.