CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Pre-Processing

Inlet boundary advice

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree2Likes
  • 1 Post By jherb
  • 1 Post By djh2

Reply
 
LinkBack Thread Tools Display Modes
Old   March 29, 2014, 16:25
Default Inlet boundary advice
  #1
New Member
 
David H.
Join Date: Oct 2013
Posts: 24
Rep Power: 4
djh2 is on a distinguished road
Hello all, I've been working with OpenFOAM for some time now, and I'm trying to model a bluff body inlet jet for LES.

I'm trying to keep my mesh structured and orthogonal, so I'd like to keep a simple graded blockMesh.

At this time, I'm trying to model the bluff body by creating a boundary condition on the inlet face that can map or specify a velocity distribution.

For example,
r=0 to r=5, U=10
r=5 to r=20, U=0
r=20 to r=30, U=5

My first stab at this was creating a blockMesh with the cylindrical jet modeled as a square. I'd like to be able to assign velocity by some step function or parabolic distribution based on the radius.

I have tried to create a boundary condition, but I'm not having much luck with it. I've also tried using the pitzExpMapInlet tutorial as an example and mapping velocities to points, but not having a lot of luck there either.

Can someone point me in the right direction to get started with this creating a custom boundary condition?
Attached Images
File Type: jpg Model with labels.jpg (16.4 KB, 21 views)
File Type: jpg Screen Shot 2014-03-20 at 1.18.12 PM.jpg (26.2 KB, 48 views)
djh2 is offline   Reply With Quote

Old   March 30, 2014, 08:53
Default
  #2
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 365
Rep Power: 10
jherb is on a distinguished road
You can use the setFields utility to modify boundary conditions locally. See the tutorial examples using this utility, e.g. by searching for setFieldsDict in $FOAM_TUTORIALS:
Code:
find $FOAM_TUTORIALS -name setFieldsDict
babakflame likes this.
jherb is offline   Reply With Quote

Old   March 30, 2014, 13:51
Default
  #3
New Member
 
David H.
Join Date: Oct 2013
Posts: 24
Rep Power: 4
djh2 is on a distinguished road
I was under the understanding that setFields could set the initial field / initial condition for a specified field or region of a field.

In my experience with creating a field, I wasn't able to get the field to stay as a boundary condition applied at each step.

I modified an application that created an initial internal field based on an approximate analytic solution. I wrote the application to create the field on the boundary, and it wrote the values for the faces, as you would expect in 0.01/U for example

I wasn't able to make OpenFOAM ignore the specified boundary conditions "inlet" etc, in lieu of my specified values for the field. I know there are utilities to map the results of one case onto another, but this still does not address the boundary values.

It is also possible that I was not operating on the boundary faces or something, so the results did not "stick". But I'm still not convinced this is the best method of this.

Ideally, I'd like something like the parabolic boundary condition from 1.5, but modify it to a step-wise defined condition across the face. I had not much success modifying this boundary condition, because I'm not sure I understand how it's really working.
djh2 is offline   Reply With Quote

Old   March 31, 2014, 15:04
Default
  #4
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 365
Rep Power: 10
jherb is on a distinguished road
E.g. in the buoyantPimpleFoam tutorial (hotroom) the temperature boundary conditions for the floor is changed in a way (by setFields), that a few cells have higher temperature than the surrounding ones. They keep this higher value for all time steps (setFields is applied for the 0 time step).
jherb is offline   Reply With Quote

Old   April 4, 2014, 12:15
Default
  #5
New Member
 
David H.
Join Date: Oct 2013
Posts: 24
Rep Power: 4
djh2 is on a distinguished road
Looking at the implementation of setFields made me think a bit more about the little application I had started. It was essentially the same thing, but I realized I had not operated on the faces, but the cell centers. As you would expect, these did not properly address the boundary values.

With that sorted out, I now have a working application mapInlet that writes my bluff body inlet conditions.

I don't know where I originally picked up some of these pieces, but they came from somewhere on this forum. I appreciate your help, though and do not claim this solely on my own (I couldn't have done it alone )

Here are the useful bits, and I can post up the whole directory if someone is interested or if I make it more general with a dictionary file, etc.

Code:
    // Define boundary faces  
    label patchi = mesh.boundaryMesh().findPatchID("inlet");
    const fvsPatchVectorField& centers = mesh.Cf().boundaryField()[patchi];
    fvPatchVectorField& uVel = U.boundaryField()[patchi];

    forAll(centers, i)
    {
        scalar x = centers[i].x();
        scalar y = centers[i].y();

        radius_squared = sqr(x) + sqr(y);

        if (radius_squared <= r0_squared) {
            uVel[i] = vector(Ux,Uy,u_jet);
            //Info<< "Zone: Jet "<<uVel[i]<< endl;
        }
    
        if (radius_squared <= r1_squared && radius_squared > r0_squared) {
            uVel[i] = vector(Ux,Uy,u_bluff);
            //Info<< "Zone: Bluff"<< endl;
        } 

	if (radius_squared > r1_squared) {
            uVel[i] = vector(Ux,Uy,u_coflow);
            //Info<< "Zone: Coflow"<<uVel[i]<< endl;
        }
    }
jherb likes this.
djh2 is offline   Reply With Quote

Old   April 26, 2014, 07:44
Default Help needed
  #6
Senior Member
 
Bobi
Join Date: Oct 2012
Location: Chicago, Illinois
Posts: 304
Rep Power: 6
babakflame is on a distinguished road
Dear Fellows

I am trying to simulate a bluff-body stabilized flame. I have used a 2D wedge-typed grid. However, after 0.08 sec it seems that the outer recirculation zone is captured much greater than the actual size and vice versa the inner recirculation zone is very tiny. ( I have attached the desired UMean and the achieved One)

This has influenced significantly my temperature profile and the outer peak in Temperature Profile is completely disappeared.

I have used the Random Inflow Boundary condition i.e. turbulentInlet. This is my 0/U file:

Code:
boundaryField
{
    OUTLET
    {
        type            zeroGradient;
    }
    COFLOW
    {
        type            turbulentInlet;
        referenceField  uniform (0 40 0);
        fluctuationScale (0.01 0.1 0.01);
        value           uniform (0 40 0);
    }
    SIDE
    {
        type            zeroGradient;
    }
    FUEL
    {
        type            turbulentInlet;
        referenceField  uniform (0 118 0);
        fluctuationScale (0.02 0.6 0.02);
        value           uniform (0 118 0);
    }
    WALL
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }
    front
    {
        type            wedge;
    }
    back
    {
        type            wedge;
    }
  
}
I have also attached pics of my MeanTemp and mixture fraction at 0.08 sec.

Would you PLZ hint me that what is my problem in not capturing the outer recirculation zone (air-driven RZ) correctly?

Do I need to do a 3D simulation or maybe modifying my 0/U file?

I have simulated the fuel and air inflows from the beginning of the injection according to mentioned 0/U file.

Regards
Bobi
Attached Images
File Type: jpg TMean.jpg (35.6 KB, 13 views)
File Type: jpg UMean.jpg (37.6 KB, 9 views)
File Type: jpg ZMean.jpg (26.3 KB, 14 views)
File Type: jpg Achieved streamline.jpg (58.5 KB, 27 views)
File Type: png DesiredStreamlines.png (48.8 KB, 23 views)
babakflame is offline   Reply With Quote

Old   July 21, 2014, 22:34
Default
  #7
New Member
 
David H.
Join Date: Oct 2013
Posts: 24
Rep Power: 4
djh2 is on a distinguished road
I'm not sure if you ever figured out a solution for your simulation.

You might want to try the mappedPatch boundary condition, check out the pitzDailyMapped tutorial for an example.

I found the mapping condition sometimes over-exaggerates the magnitude of the fluctuations, especially depending on where the values are sampled from.

That being said, it would help your jet become turbulent in a method that uses "real" coherent turbulent structures. This may be better than random noise which has been shown ineffective in LES turbulence simulations, since random fluctuations are not good at creating useful eddies.

Also, turbulence is 3D in nature, and your wedge geometry is likely adding numerical complications around the shear layers of the jet. I'd recommend checking out my other post about topoSet, and using a regular cubic mesh.
djh2 is offline   Reply With Quote

Old   February 29, 2016, 23:10
Default
  #8
Senior Member
 
Wen Xu
Join Date: May 2014
Posts: 189
Rep Power: 4
wenxu is on a distinguished road
Dear David,

I am interested in which software is used to plot the attached velocity figure?

Best regards.
Wen
wenxu is offline   Reply With Quote

Old   February 29, 2016, 23:52
Default
  #9
New Member
 
David H.
Join Date: Oct 2013
Posts: 24
Rep Power: 4
djh2 is on a distinguished road
My plot from the first post is just a cut plot from ParaView, showing the midplane from the side.
djh2 is offline   Reply With Quote

Old   February 29, 2016, 23:55
Default
  #10
Senior Member
 
Wen Xu
Join Date: May 2014
Posts: 189
Rep Power: 4
wenxu is on a distinguished road
Then how you adjust the legend with the same size of numbers and (set the number on one size of the legend?) ?

I use the version of paraview 4.1, there is no way to adjust the numbers in the legend...


Best regards,
Wen
wenxu is offline   Reply With Quote

Old   March 1, 2016, 00:01
Default
  #11
New Member
 
David H.
Join Date: Oct 2013
Posts: 24
Rep Power: 4
djh2 is on a distinguished road
I'm not sure I understand what you are asking. Can you post a picture of what you have and describe how you want it to look?
djh2 is offline   Reply With Quote

Old   March 1, 2016, 02:26
Default
  #12
Senior Member
 
Wen Xu
Join Date: May 2014
Posts: 189
Rep Power: 4
wenxu is on a distinguished road
Quote:
Originally Posted by djh2 View Post
I'm not sure I understand what you are asking. Can you post a picture of what you have and describe how you want it to look?
My problem is described in this thread, and I want the legend like the attached. Thank you in advance!!!!


My best regards,
Wen
Attached Images
File Type: png legend.png (13.3 KB, 10 views)
wenxu is offline   Reply With Quote

Old   March 5, 2016, 10:14
Default
  #13
New Member
 
David H.
Join Date: Oct 2013
Posts: 24
Rep Power: 4
djh2 is on a distinguished road
Hi Wen, I see what you are asking. For the plot in the first post, It's really just the legend moved to the bottom, and the minimum and maximum are cropped from the picture. I was using this plot (LES instantaneous) alongside a time-averaged velocity field as a demonstrative point on a poster, so the "real" data min/max were not needed.

That being said, You can choose the range on the color map editor, second icon (I think you know this), in at least ParaView 4.1.0 which I was using with OpenFoam 2.3.0 last. This sets the range of displayed data.

A workaround to get the desired displayed precision on the maximum/minimum, eg. 0.008123 (maximum) to show as 0.008 is to set this as the discrete top of the range.
djh2 is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Foam::error::PrintStack almir OpenFOAM Running, Solving & CFD 62 June 16, 2016 03:01
Radiation interface hinca CFX 15 January 26, 2014 18:11
Water subcooled boiling Attesz CFX 7 January 5, 2013 04:32
Domain Imbalance HMR CFX 3 March 6, 2011 21:10
user soubroutine of inlet boundary conditions Charlie Beghein CD-adapco 2 August 30, 2002 02:03


All times are GMT -4. The time now is 15:01.