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

Define non uniform TKE boundary condition in simpleFOAM

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

Reply
 
LinkBack Thread Tools Display Modes
Old   July 26, 2007, 18:34
Default Dear all, I am trying to mo
  #1
Member
 
Quinn Tian
Join Date: Mar 2009
Posts: 62
Rep Power: 7
qtian is on a distinguished road
Dear all,

I am trying to modify the inlet boundary condition for simpleFoam. I have no problem to add non uniform velocities. I also want to add non uniform tke also. For some reason, I keep getting this error message when I compile my code.

bump1BC.C:63: error: 'k' was not declared in this scope

line 63: fvPatchScalarField& inletK = k.boundaryField()[inletPatchID];

Is this because I miss some head file? I am new to C++ and OpenFoam, please give me some help. Thanks.

QT
qtian is offline   Reply With Quote

Old   July 27, 2007, 11:37
Default Is there nobody who is able or
  #2
Member
 
Quinn Tian
Join Date: Mar 2009
Posts: 62
Rep Power: 7
qtian is on a distinguished road
Is there nobody who is able or want to answer my question? I am really stuck here. Please give me some suggestions.
qtian is offline   Reply With Quote

Old   July 27, 2007, 11:54
Default No, you didn't miss any header
  #3
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,880
Rep Power: 25
alberto will become famous soon enoughalberto will become famous soon enough
No, you didn't miss any header file. The k field is defined inside the turbulence model class, so you can't access to it in that way.

Do you need to specify a profile for k with a knows mathematical expression? If so, I did something like that for my work starting from the parabolic velocity profile provided by Hrvoje and adapting it to scalar fields.

If you're interested, I can provide the source to you.

Regards,
Alberto
__________________
Alberto

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as live DVD/USB, hard drive image and virtual image.
GeekoCFD 32bit - The 32bit edition of GeekoCFD.
GeekoCFD text mode - A smaller version of GeekoCFD, text-mode only, with only OpenFOAM. Available in a variety of virtual formats.
alberto is offline   Reply With Quote

Old   July 27, 2007, 12:43
Default Alberto, Thank you very muc
  #4
Member
 
Quinn Tian
Join Date: Mar 2009
Posts: 62
Rep Power: 7
qtian is on a distinguished road
Alberto,

Thank you very much for your information. As you know, I am really a newbie to OpenFoam. I tried to search for answers in the message board and sometime like this have no success. Answers from experts like you really mean a ton to us and save us time and energy.

Of course, I am very interested in your code. At least I can have something working to start with. Please send me your source. I really appreciate your help and sharing your information with me.

QT
qtian is offline   Reply With Quote

Old   July 27, 2007, 13:03
Default If you can share the profile y
  #5
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,880
Rep Power: 25
alberto will become famous soon enoughalberto will become famous soon enough
If you can share the profile you need to implement, I can adapt the code.

Regards,
Alberto
__________________
Alberto

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as live DVD/USB, hard drive image and virtual image.
GeekoCFD 32bit - The 32bit edition of GeekoCFD.
GeekoCFD text mode - A smaller version of GeekoCFD, text-mode only, with only OpenFOAM. Available in a variety of virtual formats.
alberto is offline   Reply With Quote

Old   July 27, 2007, 14:36
Default Dear Alberto, Here is a pr
  #6
Member
 
Quinn Tian
Join Date: Mar 2009
Posts: 62
Rep Power: 7
qtian is on a distinguished road
Dear Alberto,

Here is a profile for U, k and epsilon with the interploated mathematical expression based on experimental data. Thanks for your help.

y=[0.133 100]

y1=log10(y);

U = 0.0174*y1.^6-0.5742*y1.^5-0.3304*y1.^4+4.0521*y1.^3-1.8319*y1.^2+4.8145*y1+14.91 62;

K = 0.3918*y1.^6-0.0334*y1.^5-3.0332*y1.^4+2.5104*y1.^3+0.9672*y1.^2-2.0524*y1+4.861 2;

epsilon = 529.7*y1.^6-657.7*y1.^5-4164*y1.^4+8177.8*y1.^3-793.4*y1.^2-5507.8*y1+2714.1;
qtian is offline   Reply With Quote

Old   July 27, 2007, 16:35
Default Dear all Will funkySetFields
  #7
Member
 
Quinn Tian
Join Date: Mar 2009
Posts: 62
Rep Power: 7
qtian is on a distinguished road
Dear all
Will funkySetFields do the job for me, if I have a formula for velocity and tke? I saw several cases for initial conditions, not sure that it will work for patches. Thanks.

QT
qtian is offline   Reply With Quote

Old   July 28, 2007, 13:00
Default Hi Quinn, sorry yesterday I wa
  #8
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,880
Rep Power: 25
alberto will become famous soon enoughalberto will become famous soon enough
Hi Quinn, sorry yesterday I was busy. I'm adapting the code for you right now.

Do you need "symmetric" profiles or do you use axial symmetry conditions?

Regards,
Alberto
__________________
Alberto

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as live DVD/USB, hard drive image and virtual image.
GeekoCFD 32bit - The 32bit edition of GeekoCFD.
GeekoCFD text mode - A smaller version of GeekoCFD, text-mode only, with only OpenFOAM. Available in a variety of virtual formats.
alberto is offline   Reply With Quote

Old   July 30, 2007, 09:59
Default Alberto, Sorry that I missed
  #9
Member
 
Quinn Tian
Join Date: Mar 2009
Posts: 62
Rep Power: 7
qtian is on a distinguished road
Alberto,
Sorry that I missed your message. After reading your suggestion last Friday, I did a few search for parabolic velocity profile and found out that funkySetFields did the exact same things you mentioned.

I used matlab curve fittling tool box to get the formular and have defined my non uniform inlet boundary with funkySetFields. Thanks for your suggestion and help. By the way, may I ask you one more question, why I can not use pow(pos().y,-1.29)in the formular?

Best

Quinn
qtian is offline   Reply With Quote

Old   July 30, 2007, 14:54
Default Hi Quinn, what error do you g
  #10
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,880
Rep Power: 25
alberto will become famous soon enoughalberto will become famous soon enough
Hi Quinn,
what error do you get? In your post in the funkySetField thread, it seems you have a segmentation fault error (sigfpe), so y is zero somewhere.

Regards,
A.
__________________
Alberto

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as live DVD/USB, hard drive image and virtual image.
GeekoCFD 32bit - The 32bit edition of GeekoCFD.
GeekoCFD text mode - A smaller version of GeekoCFD, text-mode only, with only OpenFOAM. Available in a variety of virtual formats.
alberto 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
Own boundary condition modified simpleFoam erorr in parallel execution sponiar OpenFOAM Running, Solving & CFD 1 August 27, 2008 09:16
Which boundary condition should be choose for a uniform field su_junwei OpenFOAM Running, Solving & CFD 0 May 2, 2008 08:22
non-uniform transient boundary condition? David FLUENT 1 September 6, 2007 17:20
How to define the boundary condition Merkle FLUENT 0 December 1, 2000 04:01
How to define boundary condition Devy FLUENT 0 November 28, 2000 03:18


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