CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [mesh manipulation] Second air inlet within the mesh (https://www.cfd-online.com/Forums/openfoam-meshing/153403-second-air-inlet-within-mesh.html)

Flexi1095 May 25, 2015 13:08

Second air inlet within the mesh
 
Hi,
I'am searching for a possibility to create a second air inlet within my box (now just a normal rectangle with an inlet on the one side and an outlet on the other side).
In the best case it should be only a very small circle with a second air inlet on a specific position inside the box.
Any idea how I can realize that / is this even possible?

Thank you in advance :)
Flexi1095

zfaraday May 25, 2015 15:04

Try createPatch utility.

Flexi1095 May 29, 2015 11:42

1 Attachment(s)
Hi zfaraday,
thanks for your reply.

As I am not so experienced with OpenFoam could you (or anyone else) maybe help me a bit more. Which method do I have to use from createPatch to change a certain cell to an inlet?
(-overwrite, -parallel, -roots "(DIR1 [...DIRN])", -region NAME, -case DIR, -noFunctionObjects)?

Flexi1095

zfaraday May 29, 2015 12:07

Well, first of all, whenever you need some information about the usage of a utility try the following command:

Code:

grep -ri "utility name" $FOAM_TUTORIALS
With this you will find all the files where the utility is called in the tutorials directory. Otherwise, you may also try this other command
Code:

find $FOAM_TUTORIALS -name "utility name*"
With this one you will be able to find all the files with the name of the utility ended with "Dict" (it is important to use * after the utility name! Otherwise you won't find anything), since many of the utilities use entries coming from dictionaries with its own name ended with "Dict". It is important to study these files in order to be able to run many of the utilities!

Besides that, I wil give you some information about the use of createPatch utility, since today I have use it for the first time! :p I would need more information about your geometry in order to give you more accurate help. However, as a quick guide, I will tell you that first you need to create a faceSet with the patch faces you want to convert into your new inlet patch. I recomend you to do it by making use of topoSet utility. Once you have created your faceSet with the faces that you want to be in a new patch you can run createPatch, after having set up correctly the createPatchDict, of course...

Hope it helps! Regards,

Alex

Flexi1095 June 4, 2015 17:31

1 Attachment(s)
Hi zfaraday,
thank you so much for your help so far!
With the commands I found some informations, but when I want to create a cellSet it returns an error.
My topoSetDict looks like this:
Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.3.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    object      topoSetDict;
}
actions
(
  {
    name    Einlass;
    type    cellSet;

    action  new;
    source  cellToFace;

  source nearestToCell;
    {
      points ((0.992718405535614, 0.00241252922952359, 0.0319775971417239) );
    }

  }
)

An the eror:
Code:

michael@michael-Lenovo-G510:~/OpenFOAM/michael-2.3.0/run/AutoWF2014$ topoSet
/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.3.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 2.3.0-f5222ca19ce6
Exec  : topoSet
Date  : Jun 04 2015
Time  : 23:16:12
Host  : "michael-Lenovo-G510"
PID    : 5154
Case  : /home/michael/OpenFOAM/michael-2.3.0/run/AutoWF2014
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create polyMesh for time = 0

Reading topoSetDict



--> FOAM FATAL IO ERROR:
"ill defined primitiveEntry starting at keyword 'actions' on line 16 and ending at line 34"

file: /home/michael/OpenFOAM/michael-2.3.0/run/AutoWF2014/system/topoSetDict at line 34.

    From function primitiveEntry::readEntry(const dictionary&, Istream&)
    in file lnInclude/IOerror.C at line 132.

FOAM exiting

Any idea? Is my topoSet wrong?

If you are interested in the geometry have a look at the attachment. It's like a small F1 car :) I want to create the second outlet (1 cell would be enough) at the left end of car in the mid of the cylinder.
Best regards,
Flexi1095

zfaraday June 5, 2015 07:07

You missed a semicolon behind the last bracket!

Flexi1095 June 9, 2015 16:45

Thank you zfaraday! Searched over 1 hour and in the end only one semicolon was missing. >.<
Now I have created the cellSet and with that the faceSet.

If I understood correctly I can now run createPatch?
My createPatchDict looks like:
Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.3.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    object      createPatchDict;
}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
pointSync false;

patches
(
    {
        // Name of new patch
        name Einlassluft;

        // Type of new patch
        patchInfo
        {
        type patch;
        }
     
        // How to construct: either from 'patches' or 'set'
        constructFrom set;

        // If constructFrom = set : name of faceSet
        set Einlassface;
    }
);

// ************************************************************************* //

But it returns:
Code:

michael@michael-Lenovo-G510:~/OpenFOAM/michael-2.3.0/run/AutoWF2014$ createPatch
/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.3.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 2.3.0-f5222ca19ce6
Exec  : createPatch
Date  : Jun 09 2015
Time  : 22:25:44
Host  : "michael-Lenovo-G510"
PID    : 3949
Case  : /home/michael/OpenFOAM/michael-2.3.0/run/AutoWF2014
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create polyMesh for time = 0

Reading createPatchDict

Adding new patch Einlassluft as patch 7 from
{
    type            patch;
}


Read 119 faces from faceSet Einlassface


--> FOAM FATAL ERROR:
Face 68824 specified in set Einlassface is not an external face of the mesh.
This application can only repatch existing boundary faces.

    From function createPatch
    in file createPatch.C at line 727.

FOAM exiting


If I interpret it right a new patch can only created when the faces are not already part of the mesh.
So do I first have to delete the relevant faces (with setSet??) and then run createPatch or is there another way?

Best regards and thank you so much for the help so far. ;)
Flexi1095

zfaraday June 10, 2015 07:09

Ok, this problem has an easy diagnostic. The faceSet you created contains internal faces instead of only contain external faces, which is a requirement when you use createPatch since it can only convert external faces into patch faces but it cannot handle internal faces.

Rebuild your faceSet in order to make it only contain external faces.

Flexi1095 June 10, 2015 14:13

Hi zfaraday,
can you maybe give me a hint how to create the faceSet with only external faces? Do I have to use another utility? :confused:

I've tried to add the invert command within topoSet, but it occurs the same error.
- Flexi1095

zfaraday June 10, 2015 15:21

Well, I always do it with topoSet. My advice is to select the whole existing wall patch where you want to add the new inlet patch and convert it into a faceSet. Once you have the existing patch in a faceSet, delete the surplus faces until you get only the needed faces in the faceSet. Then you can use it so as to create the the patch properly!

Hope it helps,

Alex


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