CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Injecting 3D (https://www.cfd-online.com/Forums/openfoam-programming-development/223169-injecting-3d.html)

szamani December 29, 2019 00:00

Injecting 3D
 
Hi,
I am trying to create particles in 3D using icoUncoupledKinematicParcelFoam, but injection happens in 2D only.
I was wondering if someone could tell me how to change 2D to 3D injection?
I noticed that linear momentum happens only in 2D as well.

HPE December 29, 2019 08:02

please follow up the links below:

uosilos October 16, 2020 08:16

Same happening when trying to use coalChemistryFoam and checking different type of injections.



Blockmesh is a cube (3D) but every injection and cloud in log files show as 2D. :confused::confused:

szamani October 16, 2020 11:28

Check the boundary conditions. Make sure none of your dimensions are marked “empty”. For my case, even though I had created a 3D geometry, my boundary conditions were copied from the 2D case.
And the injection I think checks for boundary conditions before injecting.
Let me know if it does not work.

uosilos October 19, 2020 05:07

Quote:

Originally Posted by szamani (Post 785395)
Check the boundary conditions. Make sure none of your dimensions are marked “empty”. For my case, even though I had created a 3D geometry, my boundary conditions were copied from the 2D case.
And the injection I think checks for boundary conditions before injecting.
Let me know if it does not work.


Thanks szamani,


I think you are right since I checked blockMesh and some undefined faces were being added to default type empty. The problem now is I can't define some of these internal faces due to this error:

Code:
--> FOAM FATAL ERROR:
Trying to specify a boundary face 4(17 21 13 9) on the face on cell 1 which is either an internal face or already belongs to some other patch


And this was supposed to be inneccessary since I found in another thread that "Internal faces between blocks (which won't be receiving boundary conditions) don't get assigned as patches - they are simply ignored, and OpenFoam will recognize them as simply being an interface between two blocks".


I have read this could be solve duplicating some vertexes but I don't know exactly how to do it...

szamani October 19, 2020 09:01

In my experience, when that happens it means I am making a mistake in creating the geometry. Make sure you are consistent in the order and numbering in your blockmesh, following the right hand rule.
1- I tell you this, if blockMesh command works, then use “checkMesh” to get a bit more details.
2- find a 3D geometry from a tutorial that is closest to what you want, and modify that
3- use a software to create the mesh instead of blockmesh.

You can post your geometry here or email it, I could take a look when I get a chance.

uosilos October 19, 2020 09:47

Thanks again for your help, here is the blockMesh :)




Code:

xlength    0.3368;
ylength    0.3368;   
zlength    0.3368;

xrmin #calc "0.25 * $xlength";
xrmax #calc "0.75 * $xlength";
zrmin #calc "0.25 * $zlength";
zrmax #calc "0.75 * $zlength";

vertices
(
    (0            0        0) //base (v0)
    ($xlength        0        0)
    ($xlength        0        $zlength)
    (0            0        $zlength)
   
    (0            $ylength    0) //tapa (v4)
    ($xlength        $ylength    0)
    ($xlength        $ylength    $zlength)
    (0            $ylength    $zlength)
   
   
    (0          $ylength    $zrmin) //roof tapa (v8)
    ($xrmin          $ylength    $zrmin)
    ($xrmax          $ylength    $zrmin)
    ($xlength        $ylength    $zrmin)
    (0          $ylength    $zrmax)
    ($xrmin          $ylength    $zrmax)   
    ($xrmax          $ylength    $zrmax)
    ($xlength        $ylength    $zrmax)
   
    (0          0    $zrmin) //roof base (v16)
    ($xrmin          0    $zrmin)
    ($xrmax          0    $zrmin)
    ($xlength        0    $zrmin)
    (0          0    $zrmax)
    ($xrmin          0    $zrmax)   
    ($xrmax          0    $zrmax)
    ($xlength        0    $zrmax)
       
);

ncellref 80;
halfsidecell #calc "0.5 * $ncellref";
quartsidecell #calc "0.25 * $ncellref";

blocks
(
    hex (0 1 5 4 16 19 11 8)        ($ncellref $ncellref $quartsidecell )    simpleGrading (1 1 1)  //B1 (dir1=0-1 dir2=1-5 dir3=0-16)
    hex (16 17 9 8 20 21 13 12)        ($quartsidecell $ncellref $halfsidecell )    simpleGrading (1 1 1)  //B2
    hex (18 19 11 10 22 23 15 14)        ($quartsidecell $ncellref $halfsidecell )    simpleGrading (1 1 1)  //B3
    hex (20 23 15 12 3 2 6 7)        ($ncellref $ncellref $quartsidecell )    simpleGrading (1 1 1)  //B4*/
    hex (17 18 10 9 21 22 14 13)    centralCellZone    ($halfsidecell $ncellref $halfsidecell )    simpleGrading (1 1 1)  //Bcentral
);

boundary
(
    top
    {
        type wall;
        faces
        (
            (4 8 11 5)
            (8 12 13 9)
            (10 14 15 11)
            (12 7 6 15)                     
        );
    }
    roof
    {
        type patch;
        faces
        (
            (9 13 14 10)
        );
    }
    bottom
    {
        type wall;
        faces
        (
            (0 1 19 16)
            (16 17 21 20)
            (18 19 23 22)
            (20 23 2 3)
            (17 18 22 21)
        );
    }
    walls
    {
        type wall;
        faces
        (
            (3 2 6 7) //front
            (0 4 5 1) //back
           
            (0 16 8 4)    //left
            (16 20 12 8)
            (20 3 7 12)
           
            (1 5 11 19)  //right
            (19 11 15 23)
            (23 15 6 2)
        );
    }
    symmetry
    {
        type symmetryPlane;
        faces
        (
           
        );
    }
    frontAndBack
    {
        type empty;
        faces
        (
           
        );
    }
    /*fakeInterfaces   
    {
        type ??;
        faces
        (
        (16 8 9 17)
        (17 9 10 18)
        (18 10 11 19)
       
        (17 21 9 13)
        (18 10 14 22)
               
        (20 12 13 21)
        (21 13 14 22)
        (22 14 15 23)
        );
    }*/
);



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