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

LES inlet boundary conditions

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By Joachim
  • 1 Post By Joachim
  • 1 Post By HPE

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 8, 2012, 11:29
Post LES inlet boundary conditions
  #1
Senior Member
 
Join Date: Nov 2012
Posts: 171
Rep Power: 13
hz283 is on a distinguished road
Hi everyone,

I am new here. Can I ask a question about how to implement the LES inlet boundary conditions in openfoam? To my limited knowledge, there are two methods: TurbulentInlet and Mapped.

I am simulating a swirling flow, and so in the inlet I should specify the axial and tengential velocities, which is realized through swak4foam. However, in order to use mapped boundary condition, I think I need to designate the inlet boundary as mapped. This will require me to change the groovyBC type for the inlet. These two things conflict. I do not how to solve this problem. Does anyone have the related experience about this problem? In other words, my question is: in the type of TurbulentInlet or mapped boundary condition, how to use groovy or swak4foam at the same time? Thank you in advance.

hz

Last edited by hz283; November 8, 2012 at 16:30. Reason: typos
hz283 is offline   Reply With Quote

Old   December 1, 2012, 17:06
Default
  #2
hfs
Member
 
Join Date: Jul 2012
Posts: 66
Rep Power: 13
hfs is on a distinguished road
I have the same question!
How can I use a logarithmic inlet profile using groovy, and in the same time use TurbulentInlet to create fluctuations??

Did you get an answer?
hfs is offline   Reply With Quote

Old   December 2, 2012, 04:06
Default turbulentRadialProfile
  #3
nsf
Senior Member
 
Nicolas Edh
Join Date: Mar 2010
Location: Uppsala, Sweden
Posts: 123
Rep Power: 18
nsf is on a distinguished road
Hi!

A while back I wrote an BC that combined the turbulentInlet from 2.0 and timeVaryingUniform. The former has synthetic turbulence and the latter interpolates a fixedValue as a function of time from a user supplied list.

What this bc (turbulentRadialProfile) does is to read a list (tuple) which has a field as a function of radius. It uses the list as a reference field and then applies the same turbulence as turbulentInlet. The user has to supply the center of the inlet and the radius is calculated as

r =|| \bar{p} - \bar{c} ||,

where \bar{p} is the positionvector.

In the attached gz there are two similar BCs, radialProfile which is the same as the above but doesn't use turbulence. xyzTurbulentProfile takes an unstructured list (tuple) of position and field. The interpolation is rubbish but works with unstructured data, just use many points.

just extract the file and go into each directory and run

Code:
wmake libso
there is an working example with each BC.

I haven't tested it with 2.1 but I suspect it only requires minor modifications.

Edit: hope fully added file =)

Best

Nicolas
Attached Files
File Type: gz nicolasBCs.gz (21.4 KB, 168 views)

Last edited by nsf; December 3, 2012 at 00:23.
nsf is offline   Reply With Quote

Old   December 2, 2012, 18:47
Default
  #4
Senior Member
 
Join Date: Nov 2012
Posts: 171
Rep Power: 13
hz283 is on a distinguished road
Hi nsf,

Thank you very much for your reply, but I did not find the attachment you mentioned... I really appreciate if you can nicely attach it again.

hz
hz283 is offline   Reply With Quote

Old   August 20, 2013, 09:08
Default Using the BC for turbulent inlet for LES-VOF
  #5
New Member
 
Kshitij kunte
Join Date: Jun 2011
Posts: 18
Rep Power: 14
k.kshitij is on a distinguished road
I'm simulating a liquid atomization inside a cylindrical nozzle with inlet of 0.6 mm. I have run a few cases where I found that the turbulence for my case is on the lower side, when specifying a normal fixedValue inlet. From the forum I found that a synthetic turbulent boundary condition for the velocity inlet can be useful for my case. I'm specifying a uniform velocity of 50 m/s at the inlet.

Do you think the boundary condition written by you would be useful for my case.
If yes how can implement it for my case.

Any help regarding above would be of a great use.

Thanking in anticipation
k.kshitij is offline   Reply With Quote

Old   August 20, 2013, 12:20
Default
  #6
Senior Member
 
Joachim
Join Date: Mar 2012
Location: Paris, France
Posts: 145
Rep Power: 15
Joachim is on a distinguished road
If you want, I just finished implementing Lund's recycling method in OpenFOAM (thanks to Perry Johnson). It seems to work just fine on a single processor, but I still can't run it in parallel. As soon as I find the solution, I'll upload it if you want.

Maybe one of you might be able to help. Actually, everything works just fine. The velocity field URecycled at the inlet is computed just as it should (I checked). However, when I do

operator==(URecycled);

I receive the following error.

[1] #0 Foam::error:rintStack(Foam::Ostream&) in "/opt/OpenFOAM/OpenFOAM-2.2.0/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[1] #1 Foam::sigFpe::sigHandler(int) in "/opt/OpenFOAM/OpenFOAM-2.2.0/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[1] #2 in "/lib/x86_64-linux-gnu/libc.so.6"
[1] #3 Foam::scaledMappedVelocityFixedValueFvPatchField:: updateCoeffs() in "/home/gatech/OpenFOAM/gatech-2.2.0/platforms/linux64GccDPOpt/lib/libScaledMappedVelocityBCMPI.so"
[1] #4 Foam::fvMatrix<Foam::Vector<double> >::fvMatrix(Foam::GeometricField<Foam::Vector<doub le>, Foam::fvPatchField, Foam::volMesh> const&, Foam::dimensionSet const&) in "/opt/OpenFOAM/OpenFOAM-2.2.0/platforms/linux64GccDPOpt/bin/pimpleFoam"
[1] #5
[1] in "/opt/OpenFOAM/OpenFOAM-2.2.0/platforms/linux64GccDPOpt/bin/pimpleFoam"
[1] #6
[1] in "/opt/OpenFOAM/OpenFOAM-2.2.0/platforms/linux64GccDPOpt/bin/pimpleFoam"
[1] #7 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
[1] #8
[1] in "/opt/OpenFOAM/OpenFOAM-2.2.0/platforms/linux64GccDPOpt/bin/pimpleFoam"
[shorthair:14372] *** Process received signal ***
[shorthair:14372] Signal: Floating point exception (8)
[shorthair:14372] Signal code: (-6)
[shorthair:14372] Failing at address: 0x3e800003824
[shorthair:14372] [ 0] /lib/x86_64-linux-gnu/libc.so.6(+0x364a0) [0x7f350a6044a0]
[shorthair:14372] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x35) [0x7f350a604425]
[shorthair:14372] [ 2] /lib/x86_64-linux-gnu/libc.so.6(+0x364a0) [0x7f350a6044a0]
[shorthair:14372] [ 3] /home/gatech/OpenFOAM/gatech-2.2.0/platforms/linux64GccDPOpt/lib/libScaledMappedVelocityBCMPI.so(_ZN4Foam42scaledMa ppedVelocityFixedValueFvPatchField12updateCoeffsEv +0x2ba) [0x7f350295ce1a]
[shorthair:14372] [ 4] pimpleFoam(_ZN4Foam8fvMatrixINS_6VectorIdEEEC1ERKN S_14GeometricFieldIS2_NS_12fvPatchFieldENS_7volMes hEEERKNS_12dimensionSetE+0x26e) [0x434a5e]
[shorthair:14372] [ 5] pimpleFoam() [0x434c13]
[shorthair:14372] [ 6] pimpleFoam() [0x41991c]
[shorthair:14372] [ 7] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7f350a5ef76d]
[shorthair:14372] [ 8] pimpleFoam() [0x41c9bd]
[shorthair:14372] *** End of error message ***
--------------------------------------------------------------------------
mpirun noticed that process rank 1 with PID 14372 on node shorthair exited on signal 8 (Floating point exception).


Would someone know how to solve this??
Thank you very much!!

Joachim
cfdonline2mohsen likes this.
Joachim is offline   Reply With Quote

Old   August 21, 2013, 05:11
Default
  #7
New Member
 
Kshitij kunte
Join Date: Jun 2011
Posts: 18
Rep Power: 14
k.kshitij is on a distinguished road
Hi

Can you please upload those files, I can try it on my case and see if it runs.
As far as the error is concerned I'm not that great at debugging and cannot tell you why it is not working.
k.kshitij is offline   Reply With Quote

Old   August 21, 2013, 13:38
Default
  #8
Senior Member
 
Joachim
Join Date: Mar 2012
Location: Paris, France
Posts: 145
Rep Power: 15
Joachim is on a distinguished road
Hum, your domain is a circular cylinder? Then Lund's method will not work. You can only use it on flat plates or similar geometries. There might be some analogous recycling methods though for your specific case.

Good luck!
Joachim is offline   Reply With Quote

Old   August 26, 2013, 14:15
Default
  #9
Senior Member
 
Joachim
Join Date: Mar 2012
Location: Paris, France
Posts: 145
Rep Power: 15
Joachim is on a distinguished road
problem solved. It seems that you cannot use any loop other than forAll in your code, if you want to parallelize it...

for example, I had something like

label k;
for (k = 0; k < N; k ++)
{
lala[k] = ...;
etc
}

Apparently, OpenFOAM did not like that. I don't really know why yet.
Joachim is offline   Reply With Quote

Old   August 26, 2013, 14:50
Default
  #10
nsf
Senior Member
 
Nicolas Edh
Join Date: Mar 2010
Location: Uppsala, Sweden
Posts: 123
Rep Power: 18
nsf is on a distinguished road
Quote:
Originally Posted by Joachim View Post
problem solved. It seems that you cannot use any loop other than forAll in your code, if you want to parallelize it...

for example, I had something like

label k;
for (k = 0; k < N; k ++)
{
lala[k] = ...;
etc
}

Apparently, OpenFOAM did not like that. I don't really know why yet.
As far as I can tell "forAll" is just a macro defined in UList.H

Code:
/**
 * \def forAll(list, i)
 * Loop across all elements in \a list
 * \par Usage
 * \code
 * forAll(anyList, i)
 * {
 *      statements;
 * }
 * \endcode
 * \sa forAllReverse
*/
#define forAll(list, i) \
    for (Foam::label i=0; i<(list).size(); i++)
There is no apparent magic there (to me at least) so maybe there is something else that differs?
nsf is offline   Reply With Quote

Old   August 26, 2013, 14:58
Default
  #11
Senior Member
 
Joachim
Join Date: Mar 2012
Location: Paris, France
Posts: 145
Rep Power: 15
Joachim is on a distinguished road
While debugging, I isolated the lines that were generating the error. The problem basically came from all my loops.

Changing

label k;
for (k = 0; k < N; k ++)
{
lala[k] = ...;
etc
}

to

forAll (patch(), patchI)
{
lala[patchI] = ...;
etc
if(patchI == N-1) { break; }
}

solved my problem. However, the solution is really not that elegant!
cfdonline2mohsen likes this.
Joachim is offline   Reply With Quote

Old   August 26, 2013, 19:00
Default
  #12
Senior Member
 
Join Date: Jan 2013
Posts: 372
Rep Power: 14
openfoammaofnepo is on a distinguished road
Hi

I think this is related the parallel running, since forAll can be directly used in parallel computations. Can you use your own looping in the serial computations?

Quote:
Originally Posted by Joachim View Post
While debugging, I isolated the lines that were generating the error. The problem basically came from all my loops.

Changing

label k;
for (k = 0; k < N; k ++)
{
lala[k] = ...;
etc
}

to

forAll (patch(), patchI)
{
lala[patchI] = ...;
etc
if(patchI == N-1) { break; }
}

solved my problem. However, the solution is really not that elegant!
openfoammaofnepo is offline   Reply With Quote

Old   August 26, 2013, 20:13
Default
  #13
Senior Member
 
Joachim
Join Date: Mar 2012
Location: Paris, France
Posts: 145
Rep Power: 15
Joachim is on a distinguished road
Yep, the "k-loop" works just fine on a single processor. The problem only appears when using mpirun.
Joachim is offline   Reply With Quote

Old   February 5, 2018, 04:03
Default
  #14
Member
 
Ardalan
Join Date: Jul 2012
Location: Atlanta, USA
Posts: 77
Rep Power: 13
Ardali is on a distinguished road
Hi Joachim,
I know this is an old post. Do you have any intention to share the Lund's BC code? If so, we will be happy to use it in our OpenFoam course at Chalmers.
Sincerely,
Ardalan
Ardali is offline   Reply With Quote

Old   February 5, 2018, 07:46
Default
  #15
Senior Member
 
Joachim
Join Date: Mar 2012
Location: Paris, France
Posts: 145
Rep Power: 15
Joachim is on a distinguished road
Hi,

If you're interested, the code has already been shared earlier in this thread. Feel free to email me if you want additional files (initialization code, test case, etc.). These are too large and can't be attached here.

Good luck with the OpenFOAM course, I think it's pretty great.

Best,
Joachim
Joachim is offline   Reply With Quote

Old   December 3, 2018, 04:51
Default
  #16
Senior Member
 
Jianrui Zeng
Join Date: May 2018
Location: China
Posts: 157
Rep Power: 7
calf.Z is on a distinguished road
Hi Joachim,

I need this BC for my DNS simulation, can you share the code and additional files to me? My email is 32420171152101@stu.xmu.edu.cn

Thank you very much.
calf.Z is offline   Reply With Quote

Old   December 16, 2019, 09:41
Default
  #17
New Member
 
Shawn
Join Date: Dec 2019
Posts: 5
Rep Power: 6
kennymhx is on a distinguished road
Quote:
Originally Posted by Joachim View Post
Hi,

If you're interested, the code has already been shared earlier in this thread. Feel free to email me if you want additional files (initialization code, test case, etc.). These are too large and can't be attached here.

Good luck with the OpenFOAM course, I think it's pretty great.

Best,
Joachim
Hi Joachim,

Could you please share the code and additional files to me? I want to test it with my LES simulation. My email is shawnhu94@gmail.com.

Thank you very much.
kennymhx is offline   Reply With Quote

Old   December 29, 2019, 16:59
Default
  #18
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 932
Rep Power: 12
HPE is on a distinguished road
Never ever use 'turbulentInlet' BC as an LES velocity inlet BC. The name is very unfortunate since it does not produce turbulence-alike time-series, but stuck due to historical reasons. Please use `turbulentDFSEM` or `turbulentDigitalFilter` BCs of OpenFOAM.com version if you are interested in synthetic inflow methods.
guanjiang.chen likes this.
HPE is offline   Reply With Quote

Reply


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
Radiation interface hinca CFX 15 January 26, 2014 17:11
CFX13 Post Periodic interface EtaEta CFX 7 December 8, 2011 17:15
Inlet boundary conditions Mattia CFX 0 February 9, 2009 13:25
New topic on same subject - Flow around race car Tudor Miron CFX 15 April 2, 2004 06:18
user soubroutine of inlet boundary conditions Charlie Beghein Siemens 2 August 30, 2002 02:03


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