
[Sponsors] 
July 22, 2013, 18:46 

#21  
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,997
Rep Power: 42 
Quote:
Assuming that inlet.dat has Tinf as a function of x you can write Code:
valueExpression "inlet(pos().x)";
__________________
Note: I don't use "Friend"feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request 

July 23, 2013, 13:39 

#22 
New Member
sebastian n
Join Date: Nov 2012
Posts: 17
Rep Power: 6 
First of all i want to thank gschaider for the prompt reply To specify my problem: In a heat transfer experiment i measured the Temperature in a pipe (Tinf); and via the robin boundary condition (groovyBC) i want to simulate the heat transfer through the pipe wall; i calculated the heat transfer coefficent htot by using the Dittus Boelter approximation; but i dont want to simulate the fluid flow convection heat transfer, just the solid heat transfer with laplacianFoam; But i dont know how to implement the measured Temperature Tinf, which i put into a inlet.dat file, to be read by the groovyBC; The inlet.dat file has got two columns; in the first columns i write the measured time in step of 1 minute; and in column two i write the measured temperature in °Kelvin:
( (0.000000 295.244444) (60.000000 295.747222) (120.000000 295.986111) (180.000000 296.288889) .... ) The way to write it like that is from chtMultiRegionFoam and the boundary condition for table files: type uniformFixedValue; uniformValue tableFile; tableFileCoeffs { fileName "$FOAM_CASE/inlet.dat" outOfBounds warn; }; Now i am asking myself how to deal with groovy boundary condition and the .dat file read by Tinf 

July 23, 2013, 14:01 

#23  
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,997
Rep Power: 42 
Quote:
Quote:
Quote:
Code:
valueExpression "inlet(time())"; Code:
valueExpression "inlet";
__________________
Note: I don't use "Friend"feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request 

July 24, 2013, 12:41 

#24 
New Member
sebastian n
Join Date: Nov 2012
Posts: 17
Rep Power: 6 
I want to thank you for the good advices; my case is running; i have reworked the Boundary condition a little and inserted valueExpression "inlet(time())";
Code:
wall { type groovyBC; variables "htot=1429.44;Tinf=295.36;rho=2650.0;cp=724.0;k=DT*rho*cp;"; valueExpression "inlet(time())"; fractionExpression "1.0/(1.0 + k/(mag(delta())*htot))"; lookuptables ( { name inlet; outOfBounds clamp; fileName "$FOAM_CASE/inlet.dat"; } ); } Code:
solvers { T { solver PCG; preconditioner DIC; tolerance 1e06; relTol 0; } } > FOAM Warning : From function groovyBCFvPatchField<Type>::groovyBCFvPatchField(c onst fvPatch& p,const DimensionedField<Type, volMesh>& iF,const dictionary& dict) in file groovyBCFvPatchField.C at line 131 No value defined for T on wall therefore using 11214{0} Reading transportProperties Reading diffusivity DT SIMPLE: no convergence criteria found. Calculations will run for 187200 steps. Calculating temperature distribution 

July 24, 2013, 13:18 

#25  
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,997
Rep Power: 42 
Quote:
Code:
value uniform 295.36;
__________________
Note: I don't use "Friend"feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request 

August 6, 2013, 12:57 
Overestimation of the temperature distribution

#26 
New Member
sebastian n
Join Date: Nov 2012
Posts: 17
Rep Power: 6 
Hello,
the comparison of my Openfoam results to the measured Data show that the Openfoam results are too high; In the experiment water flows through a pipe and the temperature at the inlet is measured (my lookuptable reads out temperature data called inlet.dat). Besides the temperature are measured on the outside of the pipe. I want to compare these temperatures to my openfoam Results. My idea is to use the solver laplacianFoam and the heat transfer from the water to the pipe wall is calculated by the groovyBC; Code:
wall { type groovyBC; variables "htot=1429.44;Tinf=295.36;rho=2650.0;cp=724.0;k=DT*rho*cp;"; valueExpression "inlet(time())"; fractionExpression "1.0/(1.0 + k/(mag(delta())*htot))"; lookuptables ( { name inlet; outOfBounds clamp; fileName "$FOAM_CASE/inlet.dat"; } ); } my inlet.dat data file looks like this: (temperature on the outside is measured every minute) Code:
( (0.000000 295.244444) (60.000000 295.747222) (120.000000 295.986111) (180.000000 296.288889) (240.000000 296.744444) (300.000000 296.866667) (360.000000 297.277778) .... (187080.000000 311.847222) (187140.000000 311.847222) (187200.000000 311.847222) Best regards, gruenertee 

August 6, 2013, 14:52 

#27  
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,997
Rep Power: 42 
Quote:
__________________
Note: I don't use "Friend"feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request 

August 14, 2013, 14:02 

#28  
New Member
sebastian n
Join Date: Nov 2012
Posts: 17
Rep Power: 6 
Quote:
Quote:
Quote:
2. Question: Is there any function to read out values (I have a T Field but i want to read out the difference between the T field value at xyz coordinate minus value at x'y'z' divided by c over the whole time range); at the time i am using sampleDict Best Regards 

August 14, 2013, 18:27 

#29  
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,997
Rep Power: 42 
Quote:
The real problem I think is that you already started from the last timestep (187200) so nothing will be done Quote:
Just one value or a whole subset of the geometry?
__________________
Note: I don't use "Friend"feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request 

August 15, 2013, 16:20 

#30  
New Member
sebastian n
Join Date: Nov 2012
Posts: 17
Rep Power: 6 
Quote:
A whole subset of the geometry would be really helpful 3. question I am working with chtMultiRegionFoam with two regions (Fluid and Solid); is there any possibilty to read out the overall heat transfer coefficient from fluid to solid by using swak4foam; or do you know another (better) way to do this Best Regards 

August 16, 2013, 05:30 

#31  
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,997
Rep Power: 42 
Quote:
Basically mapping from itself using an offset. Sorry. This currently can not be done. You mean "overall heat transfer" (no coefficient)? Whatever. Calculate whatever you want on a "perface"basis on one side (either fluid or solid), multiply it with the face areas and sum it up: voila. Overall (=integral). Or calculate it on both sides to be sure that it is consistent
__________________
Note: I don't use "Friend"feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request 

June 20, 2016, 06:30 

#32  
Senior Member
Laurent DASTUGUE
Join Date: May 2014
Location: Chartres, France
Posts: 118
Rep Power: 5 
Quote:
I want to use groovyBC as an externalWallHeatFluxTemperature condition, with the value of h read from a tabular. Thank you Laurent 

June 20, 2016, 08:23 

#33 
Senior Member
Laurent DASTUGUE
Join Date: May 2014
Location: Chartres, France
Posts: 118
Rep Power: 5 
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 

June 9, 2017, 04:23 

#34 
New Member
Sachin
Join Date: Sep 2016
Location: Poitiers,France
Posts: 17
Rep Power: 2 
Hello,
I also would like to implement robin boundary condition in my electrostatic program. To implement my robin BC in code, I was comparing with heat exchange robin BC. Final robin BC in heat exchange problem is Tface = f*Tinf + (1f)* Tcentre ; f=(1+(k/alpha*delta)) So my question is how to find fraction value (f) in robin BC? In a my code I am solving governing equation related electrostatics problem. I want to implement following robin BC in my wall. My robin BC is (kp*E*Np)(D*grad(Np)) Where kp and D is physical properties value(fixed=1), E is surfacescalarfiels(which I am calculate in code), Np is volscalarfield (which I am calculate in my code) In a my code 1st I calculate (volvectorField) Efiled and then also convert the Efield in (surfacescalarfield) named "E". Then I calculate governing equation for Np. which is (volscalarfield). So my question is how to implement (kp*E*Np)(D*grad(Np)) BC in time directories. I tried through groovy BC, but not succeeded. Following way I implement robin BC in groovy type groovyBC; variables " N_P=N_P*mag(Sf()); E=E*mag(Sf());K_P=1;D=0.0001; " valueExpression "(K_P*E*N_N)(D*snGrad(N_P))"; // gradientExpression "0"; value uniform 0; fractionExpression "0"; // 0 for neumann and 1 for dirichlet But dont understand how to calculate fractionExpression for my robin BC. Thanks Last edited by smodh; June 15, 2017 at 03:05. 

June 15, 2017, 10:59 

#35 
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Leoben (Austria)
Posts: 1,801
Blog Entries: 6
Rep Power: 32 
Hi,
I think I got the point but your formating is a bit poor. However, to implement a Robin BC in FOAM you can use groovy or the codedMixedBC. Groovy provides you a lot of things and easy handling and access to fields that are available in the OpenFOAM database. Right now I always code it in codedMixed but groovy is the easier choice. Your question is related on  how to get/calc the valueFraction  right? So just do that by defining a new variable and use this in the valueFraction expression. An example (I am not sure about the correct syntax now but you will figure it out yourself or with the groovyBC tutorials): Code:
variables "Tinf=243; valFrac=log(T+13)*exp(U)14;"; valueExpression "Tinf"; gradientExpression "0"; fractionExpression "valFrac"; value uniform 0; Code:
fractionExpression "log(T+13)*exp(U)14"; But that's how it works. In the case that I made some mistakes, I hope that Bernhard will clearify everything. Its a while ago that I used Groovy. Good luck. By the way, if you just read the post above yours, you should get the feeling about how you have to do it.
__________________
Keep foaming, Tobias Holzmann 

June 15, 2017, 12:17 

#36 
New Member
Sachin
Join Date: Sep 2016
Location: Poitiers,France
Posts: 17
Rep Power: 2 
Hello Tobi,
Thanks for your reply. I think, I did not explain properly my problem. I want to implement robin BC in my wall. My robin BC is (kp*E*Np)(D*grad(Np))=0 Where kp and D is physical properties value(fixed=1). In a my solver code 1st, I calculate (volvectorField) Efield and convert the Efield in surfacescalarfield named "E". Np is volscalarfield (which I am calculate in my solver code) So my question is how to implement (kp*E*Np)(D*grad(Np)) BC in time directories for Np. I tried through groovy BC, but not succeeded. In a codedMixed BC, I don't under stand how I can call the value which I am calculate in a solver. I hope you understand my problem. Thanks again. Sachin. 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Numerical errors in nested domain with precalculated boundary values  Arnoldinho  OpenFOAM Running, Solving & CFD  3  April 4, 2012 10:31 
max node values exceed max element values in contour plot  jason_t  FLUENT  0  August 19, 2009 11:32 
exact face values  RubenG  Main CFD Forum  0  June 22, 2009 11:09 
strange node values @ solid/fluid interface  help  JB  FLUENT  2  November 1, 2008 13:04 
Generating table values in a loop  Jarrod Sinclair  CDadapco  1  November 26, 2003 20:26 