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

Define non uniform TKE boundary condition in simpleFOAM

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 26, 2007, 19:34
Default Dear all, I am trying to mo
  #1
Member
 
Quinn Tian
Join Date: Mar 2009
Posts: 62
Rep Power: 17
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, 12:37
Default Is there nobody who is able or
  #2
Member
 
Quinn Tian
Join Date: Mar 2009
Posts: 62
Rep Power: 17
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, 12: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,912
Rep Power: 36
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 Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   July 27, 2007, 13:43
Default Alberto, Thank you very muc
  #4
Member
 
Quinn Tian
Join Date: Mar 2009
Posts: 62
Rep Power: 17
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, 14: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,912
Rep Power: 36
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 Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   July 27, 2007, 15:36
Default Dear Alberto, Here is a pr
  #6
Member
 
Quinn Tian
Join Date: Mar 2009
Posts: 62
Rep Power: 17
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, 17:35
Default Dear all Will funkySetFields
  #7
Member
 
Quinn Tian
Join Date: Mar 2009
Posts: 62
Rep Power: 17
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, 14:00
Default Hi Quinn, sorry yesterday I wa
  #8
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
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 Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   July 30, 2007, 10:59
Default Alberto, Sorry that I missed
  #9
Member
 
Quinn Tian
Join Date: Mar 2009
Posts: 62
Rep Power: 17
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, 15: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,912
Rep Power: 36
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 Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto 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
Own boundary condition modified simpleFoam erorr in parallel execution sponiar OpenFOAM Running, Solving & CFD 1 August 27, 2008 10:16
Which boundary condition should be choose for a uniform field su_junwei OpenFOAM Running, Solving & CFD 0 May 2, 2008 09:22
non-uniform transient boundary condition? David FLUENT 1 September 6, 2007 18:20
How to define the boundary condition Merkle FLUENT 0 December 1, 2000 05:01
How to define boundary condition Devy FLUENT 0 November 28, 2000 04:18


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