CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   Generating real 3D data from axis symmetric wedge data for cone (https://www.cfd-online.com/Forums/openfoam-pre-processing/221214-generating-real-3d-data-axis-symmetric-wedge-data-cone.html)

quarkz October 9, 2019 01:20

Generating real 3D data from axis symmetric wedge data for cone
 
Hi,

I currently have data from an axis symmetric cone simulation, ran using the 1-cell thick wedge BC.

Now I would like to simulate real 3D cone. For simplification, it's going to be a quarter cone, with the xz and yz given symmetry BC. The axis of the cone is in the z direction.

I would like to use the data I got from the 2D wedge simulation and I wonder if it is possible to copy the 2D data to 3D, replicating each slice

The reason for going from 2D to 3D is because I am going from RANS to DES simulations. And I require the resumed data from the RANS result.

GerhardHolzinger October 10, 2019 04:57

This should be quite easy. Just follow these steps:
  1. Map the data from the 2-D case to the 3-D case
  2. Rotate the 3-D simulation domains with an angle smaller than the wedge angle of the 2-D domain
  3. Continue with point 1 until this loop has been traversed a sufficient number of time, so that the whole 360 degrees of the 3-D domain have been covered.

mengge July 26, 2021 11:41

Hi, have you successfully did it?
I followed Gerhard's method, but now there are some problems. In the first step, the mapping doesn't seem to get the correct results, as the print attached below.
Quote:

Originally Posted by GerhardHolzinger (Post 746694)
This should be quite easy. Just follow these steps:
  1. Map the data from the 2-D case to the 3-D case
  2. Rotate the 3-D simulation domains with an angle smaller than the wedge angle of the 2-D domain
  3. Continue with point 1 until this loop has been traversed a sufficient number of time, so that the whole 360 degrees of the 3-D domain have been covered.

Any suggestions would be appreciate. Thank you!
https://i.loli.net/2021/07/26/LKardTpoXD3myvu.png
https://i.loli.net/2021/07/26/49UYNodvbJiglLt.png

GerhardHolzinger July 27, 2021 07:18

This looks quite reasonable. You can only map data between the 2D and the 3D case in places which are contained in both meshes.
That's why I formulated my recipe as a loop:

* map the data
* rotate the domain
* continue at the top, until the whole of the 3D domain has mapped data

mengge July 28, 2021 03:02

Thanks! After the whole loop is done I've found that too. And this method does seem to be feasible!
https://z3.ax1x.com/2021/07/28/WTinu6.png
Thanks again!

dylewiczk April 11, 2024 04:44

Quote:

Originally Posted by mengge (Post 809117)
Thanks! After the whole loop is done I've found that too. And this method does seem to be feasible!
https://z3.ax1x.com/2021/07/28/WTinu6.png
Thanks again!

Hey mengee,

It is great you got it working! I am trying to achieve the exact same thing but I am not sure how to execute the method GerhardHolzinger posted.

I have 2D field and when I simply apply mapFields to my fully 3D domain, then I have the same problem as you did previously (only small portion of the 3D mesh contains the solution).

I guess, I am not entirely sure on the 'rotate the mesh' part. How did you achieve that? Through rotateMesh? And how did you just continue doing the interpolation? Doesn't the new interpolation, after I rotated the mesh, overwrite the previous interpolation so I end up again only with small portion of the 3D mesh containing the solution?

Thanks!

GerhardHolzinger April 11, 2024 04:52

Think of cutting a cake. You make the first cut (which reaches from the outer diameter of the cake to the center; unless you cut your cake with a sword, knifes generally found in kitches are roughly half the diameter of typical cakes).


Then, you rotate the cake a certain angle, the angle is depending on whether you want to get 8, 12, or 16 slices out of it, and you make another cut.


This goes on until the cake is fully sliced.






The 2D-to-3D mapping follows the same idea.


The initial mapping creates the first slice, then you need to rotate the 3D mesh a little onwards. The angle must not be larger than the angle of the 2D domain.
Following the rotation of the 3D mesh, the next mapping operation with create a new slice.
You continue this until you have covered the full 3D mesh.

dylewiczk April 11, 2024 05:10

That makes perfect sense conceptually, what I am struggling with is how to do that in OpenFOAM. I cannot figure out the workflow that permits me doing the sequence of interpolation-rotation-interpolation-rotation-... until a whole domain is covered.

I was trying to combine mapFields and rotateMesh OpenFOAM functions but it did not get me far.

Do you have any suggestions on how to implement your method?

GerhardHolzinger April 11, 2024 05:27

You have two separate cases: the 2D case and the 3D case.
The 2D case has been run, and now you want the transfer the 2D data to the 3D case. Since, the 2D domain is a slice of the 3D domain, we should be able to geometrically "cover" the full 3D domain by rotating the 2D domain.



The tools, we use:



mapFields is a tool to map data from one case onto another case


transfortPoints is a tool to perform geometric manipulations on a case, e.g. rotate the whole domain by a certain angle





The sequence of operations



Here, we are performing a series of individual operations, one at a time.
Everything described here is done to the 3D case

  1. Map data from the 2D case
  2. Rotate the geometry by a small angle
  3. Goto 1 until you have completed a full circle







This is the script I created back then to map the data from an axi-symmetric case onto a 3D case.


Note, that we have two case-folders: axiSym and full3d. The respective names make it clear, which is which. The script below, is part of the full3d case, if that's not obvious.



Code:

#!/bin/bash
cd ${0%/*} || exit 1    # Run from this directory


# for-loop syntax:
# for VAR in {START..STOP..INCREMENT}
for i in {0..193..1}
do
    echo "Performing step $i"

    # transformPoints -rollPitchYaw <vector>
    #  transform in terms of '(roll pitch yaw)' in degrees

    # 360 degrees / 193 = 1.865284974 degrees

    transformPoints -rollPitchYaw '(1.8653 0 0)'

    mapFields -sourceTime latestTime ../axiSym
done


mengge April 11, 2024 05:32

Hi,
It's been quite a while, and I can't even find that case. But I think I should have achieved it through 'rotateMesh', rotating the 3D domain axially with an angle smaller than the wedge angle as GerhardHolzinger said.
'rotateMesh' rotates the mesh along with the field data, so the next mapping will map the 2D results into the empty part of the 3D domain, without overwriting the previous one.
So after all the loops are done with suitable angles, you should obtain the complete 3D results.

dylewiczk April 11, 2024 17:46

Thanks for your help! I have managed to do the interpolation and successfully run the 3D case.

I think it is worth adding for other people who come across this thread in the future that, at least in my case, I had to fix BCs after interpolation as they got messed up but this could be problem specific to my two geometries.


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