|
[Sponsors] |
![]() |
![]() |
#1 |
Senior Member
Laurent DASTUGUE
Join Date: May 2014
Location: Chartres, France
Posts: 122
Rep Power: 12 ![]() |
Hi,
i would like to define a boundary condition which is dependent of a quantity which is not the time (but the inlet velocity). To be clear, i am currently using externalWallHeatFluxTemperature boundary condition and i would like to use a value of h calculated by a function, from the value of the velocity on the inlet of my geometry (a sort of pipe). Is there a way to use a function of this type or must i create a new boundary condition ? I think i have to use the nonuniform option and the "include file" command but i don't see any examples of the use of such a function. If you need more precision to answer this question, ask questions. Thank you. Laurent |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Senior Member
Hesam
Join Date: Feb 2015
Posts: 139
Rep Power: 12 ![]() |
Hi Laurent,
You can use groovyBC for this purpose. |
|
![]() |
![]() |
![]() |
![]() |
#3 |
Senior Member
Laurent DASTUGUE
Join Date: May 2014
Location: Chartres, France
Posts: 122
Rep Power: 12 ![]() |
Thx a lot, i will take a look on it.
Laurent |
|
![]() |
![]() |
![]() |
![]() |
#4 |
Senior Member
Laurent DASTUGUE
Join Date: May 2014
Location: Chartres, France
Posts: 122
Rep Power: 12 ![]() |
So i have looked for informations related to groovyBC.
I have some questions to do what i want to do : - Do i have to install groovyBC utility ? (i am using OF2.3.1) - What about swak4Foam ? - Is there anywhere a tutorial for this kind of boundary conditions (not in my OF files anyway) ? Thanks everybody who spend some time to help me. Laurent |
|
![]() |
![]() |
![]() |
![]() |
#5 | ||
Member
Timm Severin
Join Date: Mar 2014
Location: Munich
Posts: 63
Rep Power: 13 ![]() |
Quote:
Quote:
For specific help I fear an actual example (just try to use the BC and see what happens) would be useful. |
|||
![]() |
![]() |
![]() |
![]() |
#6 |
Senior Member
Laurent DASTUGUE
Join Date: May 2014
Location: Chartres, France
Posts: 122
Rep Power: 12 ![]() |
I have installed swak4Foam, following the commands given by :
https://openfoamwiki.net/index.php/I...tion/swak4Foam Now i will try to use it to define the value of the h convection coefficient by a function (or a table depending on another quantity which is the velocity on a specific region). When i look availables examples, the BC used is : groovyBC. For example : Code:
atmosphere { type groovyBC; variables "r1=0.25*(max(pts().x)-min(pts().x));r2=r1*0.2*(1-0.5*cos(54*time()));"; valueExpression "(sqrt(pow(pos().x-r1*sin(10*time()),2)+pow(pos().z-r1*cos(15*time()),2))<r2) ? 1 : 0"; value uniform 0; } Can i use the externalWallHeatFluxTemperature linked with the groovyBC ? Or: Do i have to extract expressions used by externalWallHeatFluxTemperature and construct a new one with the changes i want ? Thanks a lot. Laurent |
|
![]() |
![]() |
![]() |
![]() |
#7 |
Member
Timm Severin
Join Date: Mar 2014
Location: Munich
Posts: 63
Rep Power: 13 ![]() |
First a small sugesstion, what is rarely shown, but makes things a lot easier to read, reformat the variables section so you can have one variable per line:
Code:
atmosphere { type groovyBC; variables ( "r1=0.25*(max(pts().x)-min(pts().x));" "r2=r1*0.2*(1-0.5*cos(54*time()));" ); valueExpression "(sqrt(pow(pos().x-r1*sin(10*time()),2)+pow(pos().z-r1*cos(15*time()),2))<r2) ? 1 : 0"; value uniform 0; } Alternatively use any textbook on heat transfer (or you knowledge) to specify a suitable equation yourself. Reading the C++ code can be confusing if you're not used to it. |
|
![]() |
![]() |
![]() |
![]() |
#8 | |
Senior Member
Laurent DASTUGUE
Join Date: May 2014
Location: Chartres, France
Posts: 122
Rep Power: 12 ![]() |
Thank you for the tip, it is very easier to read.
Quote:
Another question : Can i use a function name or a function number for the expression of a variable (h in my case) and fill the function in another file (with a include file i suppose) ? Last one (for the moment) : Can i use a tabular in place of the expression, with for example a value of h depending on the value of Uinlet ? In this case, the tabular can be written in another file. Thanks for your time. |
||
![]() |
![]() |
![]() |
![]() |
#9 | ||
Member
Timm Severin
Join Date: Mar 2014
Location: Munich
Posts: 63
Rep Power: 13 ![]() |
Quote:
Quote:
|
|||
![]() |
![]() |
![]() |
![]() |
#10 |
Senior Member
Laurent DASTUGUE
Join Date: May 2014
Location: Chartres, France
Posts: 122
Rep Power: 12 ![]() |
I have read the topic you have indicated to me. It is very useful thank you very much.
Only one thing is still a problem. Can i use groovyBC but with a lookuptables for a variable and not for the main field ? For example, in the case : Code:
ailetteFace { type groovyBC; variables ("hBC=50.0;" "Ta=20.0;" "kBC=0.5;"); valueExpression "Ta"; fractionExpression "1.0/(1.0 + kBC/(mag(delta())*hBC))"; value uniform 293.15; } Laurent |
|
![]() |
![]() |
![]() |
![]() |
#11 |
Senior Member
Laurent DASTUGUE
Join Date: May 2014
Location: Chartres, France
Posts: 122
Rep Power: 12 ![]() |
I think i am on the right road to my objective.
Doing this for example : Code:
ailetteFace { type groovyBC; variables (//"hBC=50.0;" "Ta=20.0;" "kBC=0.5;"); lookuptables ( { name data; outOfBounds clamp; fileName "$FOAM_CASE/data.data"; } ); valueExpression "Ta"; fractionExpression "1.0/(1.0 + kBC/(mag(delta())*data(kBC)))"; value uniform 293.15; } Code:
( (0 0) (1 0.1) (3 0.1) (4 -0.1) ) Can anyone confirm it is the good way ? (don't be affraid about the numerical values, it is completely crazy, i am just trying to build the boundary condition as i want for the moment. I will fulfill the good values and the good dependencies after.) How can i verify that the value written on the tabular are read correctly ? Thanks. Laurent |
|
![]() |
![]() |
![]() |
![]() |
#12 |
Senior Member
Laurent DASTUGUE
Join Date: May 2014
Location: Chartres, France
Posts: 122
Rep Power: 12 ![]() |
I think i am on the right road to my objective.
Doing this for example : Code:
ailetteFace { type groovyBC; variables (//"hBC=50.0;" "Ta=20.0;" "kBC=0.5;"); lookuptables ( { name data; outOfBounds clamp; fileName "$FOAM_CASE/data.data"; } ); valueExpression "Ta"; fractionExpression "1.0/(1.0 + kBC/(mag(delta())*data(kBC)))"; value uniform 293.15; } Code:
( (0 0) (1 0.1) (3 0.1) (4 -0.1) ) Can anyone confirm it is the good way ? (don't be affraid about the numerical values, it is completely crazy, i am just trying to build the boundary condition as i want for the moment. I will fulfill the good values and the good dependencies after.) How can i verify that the value written on the tabular are read correctly ? Thanks. Laurent |
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
sliding mesh problem in CFX | Saima | CFX | 46 | September 11, 2021 07:38 |
Installing OF 1.6 on Mac OS X | gschaider | OpenFOAM Installation | 129 | June 19, 2010 09:23 |
vorticity boundary condition | bearcharge | Main CFD Forum | 0 | May 14, 2010 11:32 |
Missing math.h header | Travis | FLUENT | 4 | January 15, 2009 11:48 |
Free surface boudary conditions with SOLA-VOF | Fan | Main CFD Forum | 10 | September 9, 2006 12:24 |