CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Non uniform inlet velocity conditions

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 10, 2022, 10:47
Post Non uniform inlet velocity conditions
  #1
New Member
 
Anon
Join Date: Dec 2020
Posts: 20
Rep Power: 5
CfdUser5855 is on a distinguished road
Hi all,

I ran a simulation using atmBoundaryLayer to prescribe a log law boundary condition to my inlet conditions over a dune field.

However, when I compared the actual output data from a larger scale model which I used to inform my CFD, it does not perfectly follow the log law for boundary conditions and therefore I need to re run a simulation, giving specific heights certain velocities.

I now want to try and have an inlet condition which is : (heights are given as above the STL surface)

11.65 ms at 5.00 m
13.94 ms at 15.00 m
14.96 ms at 27.00 m
15.7 ms at 40.00 m
16.35 ms at 55.00 m
16.9 ms at 72.00 m
17.31 ms at 91.00 m
17.96 ms at 112.00 m
18.46 ms at 135.00 m
18.97 ms at 161.00 m
19.48 ms at 191.00 m
20.01 ms at 223.00 m
20.54 ms at 260.00 m
21.03 ms at 302.00 m
21.47 ms at 348.00 m
21.85 ms at 400.00 m
22.13 ms at 457.00 m

My blockMesh file is shown below:

convertToMeters 1;

vertices
(
(0 518200 0)
(2150 518200 0)
(2150 519270 0)
(0 519270 0)
(0 518200 475)
(2150 518200 475)
(2150 519270 475)
(0 519270 475)

);

blocks
(
hex (0 1 2 3 4 5 6 7) (40 15 10) simpleGrading (1 1 1)
);

edges
(
);

boundary
(
outlet
{
type patch;
faces
(
(0 4 7 3)
(1 5 4 0)
);
}

inlet
{
type patch;
faces
(
(2 6 5 1)
( 3 7 6 2 )
);
}
DuneField
{
type wall;
faces
(
(0 3 2 1)
);
}
top
{
type patch;
faces
(
(4 5 6 7)
);
}
);

I have looked at using TimeVaryingMappedFixedValue but that doesn't seem to be the right thing for this application

It seems like it should be relatively easy but I am unsure how to run the case

Any help would be greatly appreciated
CfdUser5855 is offline   Reply With Quote

Old   January 12, 2022, 10:14
Default
  #2
Member
 
Julio Pieri
Join Date: Sep 2017
Posts: 96
Rep Power: 8
JulioPieri is on a distinguished road
If those numbers come from a function, you could implement it in the source code for the atmBoundaryLayer BC. It isn't that scary, you could go to the same file, make a copy of it and (probably) edit this part:

Code:
scalarField Un
    (
        (Ustar(z0)/kappa_)*log(((zDir() & pCf) - groundMin - d + z0)/z0)
    );
and place your function. There are plenty of tutorials on how to create custom BC. Here are some:
https://www.dam.brown.edu/people/ntrask/CFD/bctut.pdf
Custom Boundary Condition with OpenFOAM

As an alternative, check out swak4Foam, it's pretty straightforward to use and might be good.
Also, there is the "codedFixedValue" BC, but I haven't used it yet.

Edit: I think with codedBC would be good. I haven't tested it, but a good starting point could be, in your U file,:

Code:
boundaryField
{
youAtmInletPatchName {
type codedFixedValue; value uniform 0; name codedPatchBC; code #{
const vectorField& faceCenter = this->patch().Cf(); vectorField& windVelocity = *this; forAll(faceCenter, i) {
windVelocity[i].x() = YOUR FUNCTION HERE; // then zero in other coordinates
}
#};
} rest of you patches BC
}
I haven't tested this! It's just a starting point for you.

Hope some of these help
JulioPieri is offline   Reply With Quote

Reply

Tags
atmboundarylayer, inlet boundary condition, non uniform velocity


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[OLAFLOW] The OLAFLOW Thread Phicau OpenFOAM Community Contributions 457 March 27, 2024 00:59
Boundary Conditions MtnRunBeachBum OpenFOAM Pre-Processing 1 April 30, 2015 16:33
simpleFoam Floating point error (Core Dumped) sam.ho OpenFOAM Running, Solving & CFD 2 December 31, 2013 06:57
[swak4Foam] Air Conditioned room groovyBC Sebaj OpenFOAM Community Contributions 7 October 31, 2012 14:16
turbulent jet simulation antonio_ing OpenFOAM Running, Solving & CFD 5 September 16, 2010 02:31


All times are GMT -4. The time now is 14:28.