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/)
-   -   Boundary conditions for Internal faces (https://www.cfd-online.com/Forums/openfoam-pre-processing/116270-boundary-conditions-internal-faces.html)

Danath April 16, 2013 07:38

Boundary conditions for Internal faces
 
Hello i want to set the boundary conditons for internal faces

i run simple
how to set the internal faces for P ,U i just want the fluid flow through the face and no special boundary condition

openfoam_user May 3, 2013 05:02

Dear Evangelos,

did you find an answer ?

I have the same kind of problem. I want to set a boundary condition for a patch inside the flow domain. Let me know.

Regards,
Stephane.

Danath May 3, 2013 11:51

Quote:

Originally Posted by openfoam_user (Post 424885)
Dear Evangelos,

did you find an answer ?

I have the same kind of problem. I want to set a boundary condition for a patch inside the flow domain. Let me know.

Regards,
Stephane.

Hello ! No yet !:(:(:(:(:(:(

but if you want to connect volumes and eliminate the internal faces try " merge faces " using Gambit

wyldckat May 4, 2013 20:22

Greetings to all!

Quote:

Originally Posted by openfoam_user (Post 424885)
I want to set a boundary condition for a patch inside the flow domain.

It's possible to do this, but it depends on what exactly you want to do.

For example, there is a tutorial named "TJunctionFan", located in "incompressible/pimpleFoam/TJunctionFan", which creates a cyclic baffle. It then uses a special boundary condition of type "fan"... well, the specifics are in the file "system/createBafflesDict" and in "system/topoSetDict" you can see how the cell faces are selected for later converting to the cyclic baffles.

@Evangelos: creating a faceSet or faceZoneSet might be enough, if you want to calculate the mass-flow going through the selected faces, or some kind of value monitor. These are selected using topoSet, as described in the aforementioned tutorial.

Best regards,
Bruno

DineshramBalaji January 13, 2014 20:40

Hi ,

I have created a solid sheet patch inside a fluid domain in salome and imported to fluent. the internal patch has been defined in face zones. I want to define it as a wall and specify some field values for it. Can someone help me on this?

wyldckat January 26, 2014 14:01

Greetings Dinesh,

If you can provide a small example case, it would be easier to help you.

Best regards,
Bruno

DineshramBalaji January 26, 2014 14:03

Hi Bruno,

Thanks for the help. I can work and see on it.

wyldckat January 26, 2014 15:07

By the way, doesn't this page explain what you are trying to do? http://openfoamwiki.net/index.php/Ho...internal_walls

DineshramBalaji January 26, 2014 15:31

Hi Bruno,

I created a large box. Inside which i created a duct, as a solid domain. Then I used partition operation for two bodies.

The boundaries are created in the face zone of the polymesh. I need to create a temperature boundary condition in the walls in the 0 directory. But I cant find the boundary condition for the walls.

This is my problem.

wyldckat January 26, 2014 15:51

Hi Dinesh,

Mmm... OK, then if the instructions at http://openfoamwiki.net/index.php/Ho...internal_walls don't do what you need, then I need an example case so that I can test this myself.

Best regards,
Bruno

DineshramBalaji January 26, 2014 16:05

Hi,

If you can send ur email id, I can send the case to you directly.

alientxtmsgs January 29, 2014 22:34

Greetings everyone,

I have been running into a related issue with my simulation, although it may be an even simpler case. I've been following along the $FOAM_RUN/tutorials/incompressible/pimpleFoam/TJunctionFan tutorial to see if I can create a baffle in my domain.

My general procedure so far has been to first define my topoSetDict to create a faceZone that will then be converted into an internal wall with createBaffles.

The actions field inside my topoSetDict looks like:

PHP Code:

actions
(
    {
        
name    baffleFaces;
        
type    faceZoneSet;
        
action  new;
        
source  boxToFace;
        
sourceInfo
        
{
            
box (2.32 1.4 0) (5.6 1.4 1.15);
        }
    } 

However, I do not quite understand the boxToFace option. I want to convert a plane that coincides with cell faces in my domain. For this reason, I have attempted to define a plane in the "box" field and I am not sure if this is the correct way to proceed. It does not give me any errors when I run topoSet, but when I view the newly generated sets and zones in paraView, the plane seems to be defined in the correct location but it does not extend to the bottom of my domain like it should.

Any help would be greatly appreciated!

Regards,
Steven

alientxtmsgs January 30, 2014 23:28

Hello all,

I seem to have solved my problem. For those that are interested, I will explain what I did in order to create my infinitely thin wall. Please forgive me if my explanation isn't technically sound, it is merely how I understand it.

What I needed was essentially a vertical partition in my wave flume to create a 180 degree bend, essentially what is shown in my primitive drawing below (imagine the dots aren't there):
_________________________________________
|........ ___________________________________|
|_________________|

I needed it to behave as the external walls did with all the same initial and boundary conditions for k, epsilon, velocity, pressure, eddy viscosity, etc.

In the first step I created a topoSetDict with the following entries inside:
PHP Code:

{
        
name    baffleFaces;
        
type    faceSet;
        
action  new;
        
source  boxToFace;
        
sourceInfo
        
{
            
box (2.315 1.395 -0.05)(5.605 1.405 1.155);
        }
    }
    {
        
name    baffleFaces;
        
type    faceZoneSet;
        
action  new;
        
source  setToFaceZone;
        
sourceInfo
        
{
            
faceSet baffleFaces;
        }
    } 

The box I created in the topoSetDict enveloped the cell faces I needed to be converted into a faceZone (only slightly, by half a centimetre).

I ran topoSet after my mesh was created and was able to view the newly created "set" and "zone" in paraview (not yet a patch). To convert it to a wall I ran createBaffles with the following createBafflesDict entries:

PHP Code:

internalFacesOnly true;

baffles
{
    
baffleFaces
    
{
        
type        faceZone;
        
zoneName    baffleFaces;

        
patches
        
{
            
master
            
{
                
name            baffles;
                
type            wall;

                
patchFields
                
{
                    
epsilon
                    
{
                        
type            epsilonWallFunction;
                
value           uniform 0.1;
                    }
                    
k
                    
{
                        
type            kqRWallFunction;
                       
value           uniform 0.1;
                    }
                    
nut
                    
{
                        
type            nutkWallFunction;
                
value           uniform 0;
                    }
                    
nuTilda
                    
{
                        
type            zeroGradient;
                    }
                    
p_rgh
                    
{
                        
type            fixedFluxPressure;
                
value           uniform 0;
                    }
                    
U
                    
{
                        
type            fixedValue;
                        
value           uniform (0 0 0);
                    }
                }
            }
            
slave
            
{
                ${..
master}
            }
        }
    } 


After running createBaffles it output my new mesh to a new time directory so I changed my controlDict to start from the new time (0.001 sec). It now seems to be doing exactly as I hoped :)

If anyone who understands this better I would love to know if my procedure is standard, or if there is an easier way etc!

Hope it helps someone,
Steven



wyldckat February 2, 2014 09:30

Greetings to all!

@Dinesh:
Quote:

Originally Posted by DineshramBalaji (Post 471896)
If you can send ur email id, I can send the case to you directly.

Please use Dropbox or a similar service for uploading your case and then send me the link over private message: http://www.cfd-online.com/Forums/faq...ivate_messages
I ask this because otherwise your email will only get lost in the several other emails I get, which is why I like to keep OpenFOAM+forum related questions only on the forum itself, including private messages.


@Steven: Thanks for sharing the solution you've reached. And sorry, but I don't have time to go over the solution you've found :(.

Best regards,
Bruno

bullmut April 11, 2019 11:27

2 Attachment(s)
Good Day All


Sorry for reviving an old post but i think my question fits in here.
I have created internal faces similar to the original post
  • snappyhexmesh
  • toposet
  • createbaffles
I am trying to place a mass flow rate condition on my new baffle.
The inlet and outlet patches are pressure based and i am using bouyantSimpleFoam as the solver since i have a heating element in my mesh.
Below is my U file

Code:

/*--------------------------------*- C++ -*----------------------------------*\
  =========                |
  \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox
  \\    /  O peration    | Website:  https://openfoam.org
    \\  /    A nd          | Version:  6
    \\/    M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      volVectorField;
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 1 -1 0 0 0 0];

internalField  uniform (0 0 0);

boundaryField
{
    #includeEtc "caseDicts/setConstraintTypes"
    "Box_walls|Box_pcb|Box_heater|Box_ppm"
    {
        type            noSlip;
    }
    Box_inlet
    {
        type            pressureInletOutletVelocity;
        value          uniform (0 0 0);
        inletValue      uniform (0 0 0);
    }
    Box_outlet
    {
        type            pressureInletOutletVelocity;
        value          uniform (0 0 0);
        inletValue      uniform (0 0 0);
    }
    "baffel1_master|baffel1_slave"
    {
        type            flowRateInletVelocity;
        massFlowRate    constant 0.000925;
        rhoInlet        1;          // estimate for initial rho
    }
}

and my p_rgh file
Code:

/*--------------------------------*- C++ -*----------------------------------*\
  =========                |
  \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox
  \\    /  O peration    | Website:  https://openfoam.org
    \\  /    A nd          | Version:  6
    \\/    M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      volScalarField;
    location    "0";
    object      p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [1 -1 -2 0 0 0 0];

internalField  uniform 101325;

boundaryField
{
    #includeEtc "caseDicts/setConstraintTypes"
        "Box_walls|Box_pcb|Box_heater|Box_ppm"
    {
        type            fixedFluxPressure;
        value          uniform 101325;
    }
    Box_inlet
    {
        type            fixedFluxPressure;
        value          uniform 101325;
    }
    Box_outlet
    {
        type            fixedFluxPressure;
        value          uniform 101325;
    }
    "baffel1_master|baffel1_slave"
    {
        type            fixedFluxPressure;
        value          uniform 101325;
    }
}

I get to the point of running the solver (the mesh is built and functional for this case) but when it attempts to calculate p_rgh I get the following error:
Quote:

FOAM FATAL ERROR
Continuity error cannot be removed by adjusting outflow.
Please check the velocity boundary conditions and/or run potentialFoam...

I think i am using an incorrect boundary condition on my baffle or even the wrong solver for this case (i have run the case using rhoPimpleFoam).
I have a zip of the case file but its too large to attach
I have attached a screenshot of the mesh. the solid white patch would the baffels. The inlet and outlet are on the right side. These are clips of the stl used to make the mesh.


Any advice welcome

wyldckat April 21, 2019 07:47

Quick answers:
  1. None of the patches seem to define a pressure value, which means that they are all inferred based on the pressure within the domain. If that is the case, then you must define an appropriate reference pressure point and position in "system/fvSolution", if I remember correctly... example: https://github.com/OpenFOAM/OpenFOAM...fvSolution#L87 - line 87.
  2. The solver you are using needs the "p" field as well, which if you don't define it correctly, will result in a broken "p_rgh": https://github.com/OpenFOAM/OpenFOAM...teFields.H#L70 - line 70, which means that at least the internal field is changed...
    • This to say that you might need to copy-paste-adapt the solver code and build it, to do the calculation the other way around.
  3. My guess is that the boundary conditions for the field "p" are incorrectly defined and result in a situation that it's not possible to flow fluid. See the tutorial cases for references...
  4. Oh, the outlet on the "p_rgh" should probably have a fixed value and not the fixed flux value.
  5. Suggestion: do a simple test case without your geometry, but with the same or similar inlet/outlet boundaries, so that you can more easily test for, if the current case is too slow to run.

CFD_Paras June 26, 2019 15:31

@alientxtmsgs
I did exactly what you did and it worked. Now if I want to create inner walls which are not vertical or horizontal but inclined (60 degree) what should I choose? I cannot use box to face so what else can I use?

CFD_Paras June 26, 2019 15:37

Quote:

Originally Posted by alientxtmsgs (Post 472689)
Hello all,

I seem to have solved my problem. For those that are interested, I will explain what I did in order to create my infinitely thin wall. Please forgive me if my explanation isn't technically sound, it is merely how I understand it.

What I needed was essentially a vertical partition in my wave flume to create a 180 degree bend, essentially what is shown in my primitive drawing below (imagine the dots aren't there):
_________________________________________
|........ ___________________________________|
|_________________|

I needed it to behave as the external walls did with all the same initial and boundary conditions for k, epsilon, velocity, pressure, eddy viscosity, etc.

In the first step I created a topoSetDict with the following entries inside:
PHP Code:

{
        
name    baffleFaces;
        
type    faceSet;
        
action  new;
        
source  boxToFace;
        
sourceInfo
        
{
            
box (2.315 1.395 -0.05)(5.605 1.405 1.155);
        }
    }
    {
        
name    baffleFaces;
        
type    faceZoneSet;
        
action  new;
        
source  setToFaceZone;
        
sourceInfo
        
{
            
faceSet baffleFaces;
        }
    } 

The box I created in the topoSetDict enveloped the cell faces I needed to be converted into a faceZone (only slightly, by half a centimetre).

I ran topoSet after my mesh was created and was able to view the newly created "set" and "zone" in paraview (not yet a patch). To convert it to a wall I ran createBaffles with the following createBafflesDict entries:

PHP Code:

internalFacesOnly true;

baffles
{
    
baffleFaces
    
{
        
type        faceZone;
        
zoneName    baffleFaces;

        
patches
        
{
            
master
            
{
                
name            baffles;
                
type            wall;

                
patchFields
                
{
                    
epsilon
                    
{
                        
type            epsilonWallFunction;
                
value           uniform 0.1;
                    }
                    
k
                    
{
                        
type            kqRWallFunction;
                       
value           uniform 0.1;
                    }
                    
nut
                    
{
                        
type            nutkWallFunction;
                
value           uniform 0;
                    }
                    
nuTilda
                    
{
                        
type            zeroGradient;
                    }
                    
p_rgh
                    
{
                        
type            fixedFluxPressure;
                
value           uniform 0;
                    }
                    
U
                    
{
                        
type            fixedValue;
                        
value           uniform (0 0 0);
                    }
                }
            }
            
slave
            
{
                ${..
master}
            }
        }
    } 


After running createBaffles it output my new mesh to a new time directory so I changed my controlDict to start from the new time (0.001 sec). It now seems to be doing exactly as I hoped :)

If anyone who understands this better I would love to know if my procedure is standard, or if there is an easier way etc!

Hope it helps someone,
Steven



I did exactly what you did and it worked. Now if I want to create inner walls which are not vertical or horizontal but inclined (60 degree) what should I choose? I cannot use box to face so what else can I use?

hideonramas777 June 20, 2023 13:41

1 Attachment(s)
hi everyone, i am having the same problem, but its a boundary that is an artefact of using fluentMeshToFoam so i'm stuck with it.


the yellow wall is the wall i dont need for my simulation. i've set that boundary to internal and defined the initial conditions as type internal. this works just fine when i check my conditions (by typing paraFoam before running the sim) but upon running the sim, i get an error saying it cannot form a matrix for this wall. for the simpleFoam solver, i can use an internal condition as well (simpleFoam -listScalarBCs -listVectorBCs)

any ideas on how to fix it?

i have tried this and it doesnt work, openfoam does not expect wall_A and expects a ) or } https://openfoamwiki.net/index.php/H...internal_walls


thanks!


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