CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   adjointShapeOptimizationFoam fixed outlet (https://www.cfd-online.com/Forums/openfoam-solving/94857-adjointshapeoptimizationfoam-fixed-outlet.html)

sailor79 November 28, 2011 10:25

adjointShapeOptimizationFoam fixed outlet
 
Hi guys,

currently I am playing around with adjointShapeOptimizationFoam. For my application I would like to work with a fixed outlet. Is adjointShapeOptimizationFoam able to compute this?

For Example:
I have an circular inlet and a rectangular outlet with bars in it for stiffening (must not be bars). If I compute this with adjointShapeOptimizationFoam, the geometry of the outlet is changed. But that's not what I would like to have.

Maybe someone has an idea.

Thanks in advance

Michael

boger November 29, 2011 07:19

In what way is the outlet geometry changed? Do you mean that alpha is not equal to 0 in the cells adjacent to the outlet patch?

sailor79 November 29, 2011 07:27

Hi David,

in certain cells within the outlet patch, alpha is not equal to 0.

Michael

boger November 29, 2011 07:36

Have you tried turning on the zeroCells(alpha, outletCells) command on line 99 of adjointShapeOptimizationFoam.C? You would also need to activate line 94 in createFields.H where outletCells is defined.

sailor79 November 29, 2011 07:39

I did not do that. I will try this and get back to you.

Michael

sailor79 November 29, 2011 08:08

Hi David,

I modified the solver. For the outlet patch alpha is 0 now. But some cells adjacent to the outlet are 0, too. The patch in this area is a "wall" type. Do you have an idea?

In the tutorial, alpha_max is set to 200. When interpreting the results in ParaFoam, do I have to scale alpha from 0 to 1 or even from 0 to 0.1 (all cells unequal to 0 are "wall")?

Thank you for your kind help

Michael

boger November 29, 2011 09:33

I guess I don't understand what you mean by "But some cells adjacent to the outlet are 0, too." Wasn't that the goal? Can you try to explain again?

As far as interpreting the results in paraFoam, you're welcome to scale the alpha results, but all that really matters is where the interface is between zero and non-zero values. Hopefully that interface is fairly crisp, but in any event, it will likely require some interpretation or fairing on your part to deduce a smooth geometry from it.

sailor79 November 29, 2011 09:40

I meant, that some cells in the adjacent walls have alpha values of 0. In my understanding, alpha values are only changed for cells without contact to wall-patches. Am I wrong?

Concerning ParaFoam: Is there a way to extract the Geometry of cells with alpha !=0 to an stl file or something?

sailor79 November 29, 2011 11:09

2 Attachment(s)
I attached two images. The inlet is on the left side of the 2d-view and the outlet is on the right side.

In the 3d-view you can see the alpha=0 cells within the wall-patch.

Michael

sailor79 November 29, 2011 11:10

I managed to export something similar to the optimized geometry by contour plot and Save Data. This issue is solved.

olivierG November 29, 2011 11:55

Hello sailor79,

I want also extract the Geometry of cells at 0<alpha<1 in order to get an STL file.

How do you manage to get STL surface in Paraview ?

regards,
olivier

sailor79 November 29, 2011 12:20

Hi Olivier,

this thread helped me: http://www.cfd-online.com/Forums/ope...-paraview.html

You can save the geometry with file- Save Data (select stl as file type).

Hope that helps. I have not gone any further, yet.


Michael

olivierG November 29, 2011 12:35

Thanks for this info, Michael

I was looking at an another way, using MeshLab (cloud point => create smooth STL surface), but doing this with paraview seems more direct.

regards,
olivier

boger November 29, 2011 16:33

Michael,

I'm glad you sorted some things out, but I'm a little confused by your results. You said:
Quote:

I meant, that some cells in the adjacent walls have alpha values of 0. In my understanding, alpha values are only changed for cells without contact to wall-patches. Am I wrong?
As far as I can tell, the only constraint imposed in the original code was that alpha (the porosity) should remain zero (i.e., open to fluid) in cells adjacent to the inlet, and we modified the code here to add that alpha should also remain zero in cells adjacent to the outlet. But alpha can remain zero or become non-zero (i.e., closed to fluid) anywhere else, including in cells adjacent to walls.

I'm also a little confused by your pictures. In the 2D slice, it looks as if the fluid enters the small inlet on the left and then branches before reaching the outlet. Maybe it's just confusing because of the particular slice you chose, but is the flow able to reach the outlet plane?

And out of curiosity, what is the cost function in this case? Are you minimizing the loss of total pressure, which was the cost function distributed with the code?

David

sailor79 December 6, 2011 08:55

5 Attachment(s)
Hi David,

excuse my late reply, but there are couple of other things going on at the moment.

I am minimizing total pressure in my example. In the pictures above, the fluid is not able to reach the outlet as far as I can see.

Also the result seems to change always. After a couple of time steps you have a similar geometry once again. Therefore I increased the Mesh density and calculated a lot of time steps. You can see 2D views attached to this post. 700 s looks similar to 500 s, 800 s looks similar to 600 s.

Does this look plausible to you?

Regards

Michael


All times are GMT -4. The time now is 00:26.