when I did what you said, to add "-normal()*profile(pos().y)"it gives me that message
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Create mesh for time = 0 Reading field p Reading field U --> FOAM FATAL IO ERROR: attempt to read beyond EOF file: /home/lamia/Bureau/CASE/0/U::boundaryField::inlet::lookuptables at line 38. From function ITstream::read(token&) in file db/IOstreams/Tstreams/ITstream.C at line 83. FOAM exiting why? |
it's okey, I could fix it
|
tabular data with groovyBc
Hi
if I use this program as condition of my inlet : boundaryField { inlet { type groovyBC; fields ( U yn ); lookuptables ( { name profile; outOfBounds clamp; fileName "$FOAM_CASE/profile.data"; valueExpression "-normal()*profile(pos().U)"; } ); } and the attached file is the following: ( (0.00000 0.00000) (0.14580 0.00001) (0.19580 0.00002) (0.22580 0.00003) (0.25580 0.00004) (0.27580 0.00005) (0.29580 0.00006) (0.30580 0.00007) (0.31580 0.00008) (0.32580 0.00009) (0.33580 0.00010) (0.34580 0.00011) (0.35580 0.00012) (0.36580 0.00013) (0.37580 0.00014) (0.38580 0.00015) (0.39580 0.00017) (0.40580 0.00018) (0.41580 0.00020) (0.42580 0.00021) (0.43580 0.00023) (0.44580 0.00025) (0.45580 0.00027) (0.46580 0.00029) (0.48580 0.00033) (0.47580 0.00033) (0.49580 0.00035) (0.50580 0.00038) (0.51580 0.00040) (0.52580 0.00043) (0.53580 0.00046) (0.54580 0.00048) (0.55580 0.00051) (0.56580 0.00055) (0.57580 0.00058) (0.58580 0.00061) (0.59580 0.00065) (0.60580 0.00068) (0.61580 0.00072) (0.62580 0.00076) (0.63580 0.00080) (0.64580 0.00085) (0.65580 0.00089) (0.66580 0.00094) (0.67580 0.00098) (0.68580 0.00103) (0.69580 0.00108) (0.70580 0.00114) (0.71580 0.00119) (0.72580 0.00125) (0.73580 0.00130) (0.74580 0.00136) (0.75580 0.00143) (0.76580 0.00149) (0.77580 0.00155) (0.78580 0.00162) (0.79580 0.00169) (0.80580 0.00176) (0.81580 0.00184) (0.82580 0.00191) (0.83580 0.00199) (0.84580 0.00207) (0.85580 0.00215) (0.86580 0.00224) (0.87580 0.00232) (0.88580 0.00241) (0.89580 0.00250) (0.90580 0.00260) (0.91580 0.00269) (0.92580 0.00279) (0.93580 0.00289) (0.94580 0.00300) (0.95580 0.00310) (0.96580 0.00321) (0.97580 0.00332) (0.98580 0.00344) (0.99580 0.00356) (1.00580 0.00368) (1.01580 0.00380) (1.02580 0.00392) (1.03580 0.00405) (1.04580 0.00418) (1.05580 0.00432) (1.06580 0.00445) (1.07580 0.00459) (1.08580 0.00474) (1.09580 0.00488) (1.10580 0.00503) (1.11580 0.00518) (1.12580 0.00534) (1.13580 0.00550) (1.14580 0.00566) (1.15580 0.00583) (1.16580 0.00600) (1.17580 0.00617) (1.18580 0.00634) (1.19580 0.00652) (1.20580 0.00670) (1.21580 0.00689) (1.22580 0.00708) (1.23580 0.00727) (1.24580 0.00747) (1.25580 0.00767) (1.26580 0.00788) (1.27580 0.00808) (1.28580 0.00830) (1.29580 0.00851) (1.30580 0.00873) (1.31580 0.00895) (1.32580 0.00918) (1.33580 0.00941) (1.34580 0.00965) (1.35580 0.00989) (1.36580 0.01013) (1.37580 0.01038) (1.38580 0.01063) (1.39580 0.01089) (1.40580 0.01115) (1.41580 0.01142) (1.42580 0.01169) (1.43580 0.01196) (1.44580 0.01224) (1.45580 0.01252) (1.46580 0.01281) (1.47580 0.01310) (1.48580 0.01340) (1.49580 0.01370) (1.50580 0.01400) (1.51580 0.01431) (1.52580 0.01463) (1.53580 0.01495) (1.54580 0.01527) (1.55580 0.01560) (1.56580 0.01594) (1.57580 0.01628) (1.58580 0.01662) (1.59580 0.01697) (1.60580 0.01733) (1.61580 0.01769) (1.62580 0.01805) (1.63580 0.01843) (1.64580 0.01880) (1.65580 0.01918) (1.66580 0.01957) (1.67580 0.01996) (1.68580 0.02036) (1.69580 0.02076) (1.70580 0.02117) (1.71580 0.02158) (1.72580 0.02200) (1.73580 0.02243) (1.74580 0.02286) (1.75580 0.02330) (1.76580 0.02374) (1.77580 0.02419) (1.78580 0.02464) (1.79580 0.02510) (1.80580 0.02557) (1.81580 0.02604) (1.82580 0.02652) (1.83580 0.02701) (1.84580 0.02750) (1.85580 0.02799) (1.86580 0.02850) (1.87580 0.02901) (1.88580 0.02952) (1.89580 0.03004) (1.90580 0.03057) (1.91580 0.03111) (1.92580 0.03165) (1.93580 0.03220) (1.94580 0.03275) (1.95580 0.03331) (1.96580 0.03388) (1.97580 0.03445) (1.98580 0.03504) (1.99580 0.03562) (2.00580 0.03620) (2.01580 0.03682) (2.02580 0.03743) (2.03580 0.03805) (2.04580 0.03867) (2.05580 0.03930) (2.06580 0.03994) (2.07580 0.04058) (2.08580 0.04123) (2.09580 0.04189) (2.10580 0.04256) (2.11580 0.04323) (2.12580 0.04391) (2.13580 0.04460) (2.14580 0.04530) (2.15580 0.04600) (2.16580 0.04671) (2.17580 0.04743) (2.18580 0.04816) (2.19580 0.04889) (2.20580 0.04963) (2.21580 0.05038) (2.22580 0.05114) (2.23580 0.05190) (2.24580 0.05268) (2.25580 0.05346) (2.26580 0.05425) (2.27580 0.05505) (2.28580 0.05585) (2.29580 0.05667) (2.30580 0.05749) (2.31580 0.05832) (2.32580 0.05916) (2.33580 0.06001) (2.34580 0.06086) (2.35580 0.06173) (2.36580 0.06260) (2.37580 0.06348) (2.38580 0.06437) (2.39580 0.06527) (2.40580 0.06618) (2.41580 0.06709) (2.42580 0.06802) (2.43580 0.06895) (2.44580 0.06989) (2.45580 0.07084) (2.46580 0.07181) (2.47580 0.07278) (2.48580 0.07375) (2.49580 0.07474) (2.50580 0.07574) (2.51580 0.07675) (2.52580 0.07776) (2.53580 0.07879) (2.54580 0.07982) (2.55580 0.08087) (2.56580 0.08192) (2.57580 0.08298) (2.58580 0.08405) (2.59580 0.08514) (2.60580 0.08623) (2.61580 0.08733) (2.62580 0.08844) (2.63580 0.08956) (2.64580 0.09069) (2.65580 0.09184) (2.66580 0.09299) (2.67580 0.09415) (2.68580 0.09532) (2.69580 0.09650) (2.70580 0.09769) (2.71580 0.09889) (2.72580 0.10011) (2.73580 0.10133) (2.74580 0.10256) (2.75580 0.10380) (2.76580 0.10506) (2.77580 0.10632) (2.78580 0.10760) (2.79580 0.10888) (2.80580 0.11018) (2.81580 0.11149) (2.82580 0.11280) (2.83580 0.11413) (2.84580 0.11547) (2.85580 0.11682) (2.86580 0.11818) (2.87580 0.11956) (2.88580 0.12094) (2.89580 0.12233) (2.90580 0.12374) (2.91580 0.12516) (2.92580 0.12659) (2.93580 0.12803) (2.94580 0.12948) (2.95580 0.13094) (2.96580 0.13241) (2.97580 0.13390) (2.98580 0.13540) (2.99580 0.13690) (3.00580 0.13842) (3.01580 0.13996) (3.02580 0.14150) (3.03580 0.14306) (3.04580 0.14463) (3.05580 0.14621) (3.06580 0.14780) (3.07580 0.14940) (3.08580 0.15102) (3.09580 0.15265) (3.10580 0.15429) (3.11580 0.15594) (3.12580 0.15760) (3.13580 0.15928) (3.14580 0.16097) (3.15580 0.16267) (3.16580 0.16439) (3.17580 0.16612) (3.18580 0.16786) (3.19580 0.16961) (3.20580 0.17137) (3.21580 0.17315) (3.22580 0.17494) (3.23580 0.17675) (3.24580 0.17856) (3.25580 0.18039) (3.26580 0.18224) (3.27580 0.18409) (3.28580 0.18596) (3.29580 0.18784) (3.30580 0.18974) (3.31580 0.19165) (3.32580 0.19357) (3.33580 0.19551) (3.34580 0.19746) (3.35580 0.19942) (3.36580 0.20140) (3.37580 0.20339) (3.38580 0.20539) (3.39580 0.20741) (3.40580 0.20944) (3.41580 0.21148) (3.42580 0.21354) (3.43580 0.21562) (3.44580 0.21770) (3.45580 0.21980) (3.46580 0.22192) (3.47580 0.22405) (3.48580 0.22619) (3.49580 0.22835) (3.50580 0.23052) (3.51580 0.23271) (3.52580 0.23491) (3.53580 0.23713) (3.54580 0.23936) (3.55580 0.24160) (3.56580 0.24386) (3.57580 0.24614) (3.58580 0.24842) (3.59580 0.25073) (3.60580 0.25305) (3.61580 0.25538) (3.62580 0.25773) (3.63580 0.26009) (3.64580 0.26247) (3.65580 0.26486) (3.66580 0.26727) (3.67580 0.26970) (3.68580 0.27214) (3.69580 0.27459) (3.70580 0.27706) (3.71580 0.27955) (3.72580 0.28205) (3.73580 0.28457) (3.74580 0.28710) (3.75580 0.28965) (3.76580 0.29221) (3.77580 0.29479) (3.78580 0.29739) (3.79580 0.30000) (3.81580 0.30527) (3.82580 0.30793) (3.83580 0.31061) (3.84580 0.31330) (3.85580 0.31601) (3.86580 0.31873) (3.87580 0.32147) (3.88580 0.32423) (3.89580 0.32700) (3.90580 0.32979) (3.91580 0.33260) (3.92580 0.33542) (3.93580 0.33827) (3.94580 0.34112) (3.95580 0.34400) (3.96580 0.34689) (3.97580 0.34979) (3.98580 0.35272) (3.99580 0.35566) (4.00580 0.35862) (4.01580 0.36160) (4.02580 0.36459) (4.03580 0.36760) (4.05580 0.37367) (4.15580 0.37673) (4.15580 0.38291) (4.15580 0.38603) (4.15580 0.38916) (4.15580 0.39231) (4.15580 0.39548) (4.15580 0.39866) (4.15580 0.40187) (4.15580 0.45000) (4.15580 0.50000) (4.15580 0.55000) (4.15580 0.65000) (4.15580 0.70000) (4.15580 0.75000) (4.15580 0.80000) (4.15580 0.85000) (4.15580 0.87500) ) knowing that the first column is the velocity U while the second represents y and I get this message: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Create mesh for time = 0 Reading field p Reading field U --> FOAM FATAL ERROR: out-of-order value: 0.4758 at index 25 From function Foam::interpolationTable<Type>::checkOrder() const in file /opt/openfoam211/src/OpenFOAM/lnInclude/interpolationTable.C at line 226. FOAM exiting why can I do?? please I need to understand what's wrong |
Quote:
|
attempt to read beyond EOF (groovyBC)
Good afternoon,
I'm on OF 2.2 and I'm trying to put velocity inlet boundary conditions. It's a profile of velocity 2D saved in a data file named "test_profile.data" with 2 columns of datas: 1) U (m/s) and 2) y (altitude in meter) looks like that: ( (0.0 0) (5.3 10) (5.9 20) (6.4 30) (7.0 40) (7.9 50) (8.0 60) ) I have reproduced all the syntax you've proposed but the compilation doesn't work and I don't understand the reason of the error: "--> FOAM FATAL IO ERROR: attempt to read beyond EOF file: /home/cgouriou/OpenFOAM/cgouriou-2.2.0/run/tutorials/ejemplo/LIPC/LIPC_2D_refined/lipc4/0/U.boundaryField.inlet.lookuptables at line 55. From function ITstream::read(token&) in file db/IOstreams/Tstreams/ITstream.C at line 83. FOAM exiting" The syntax of my velocity file U is like that: boundaryField { inlet { type groovyBC; fields ( y U ); lookuptables ( { name test_profile; outOfBounds clamp; fileName "$FOAM_CASE/test_profile.data"; } valueExpression "vector(velocity(pos().y),0,0)"; ); } } I've simplified at the maximum my case in order to get a value of velocity at each point of the mesh, but it still doesn't run. Is that possible to put a velocity profile with less points that the mesh contains? Could you give me some ideas, please? thank you for you attention Clément |
Quote:
|
answer
Quote:
That was right I removed the "ValueExpression" from the the "lookuptables" and changed the "vector(velocity(pos().y),0,0)" by "-normal()*test_profile(pos().y)" and it ran perfectly! boundaryField { inlet { type groovyBC; fields ( U y ); lookuptables ( { name test_profile; outOfBounds clamp; fileName "$FOAM_CASE/test_profile.data"; } ); valueExpression "-normal()*test_profile(pos().y)"; } } Thank you so much sincerly Clément |
inlet boundary condition for U and k
Good morning,
I have succeded in writing velocity inlet boundary conditions thanks to you help on this forum, but now I'd like to add turbulence boundary conditions. I have choosen a "simpleFoam" solveur (turbulence model komegaSST) and just have change the inlet conditions for k (0.org/k) in the same way that I did it for the file 0.org/U (see below). "#include "include/initialConditions" dimensions [0 2 -2 0 0 0 0]; internalField uniform $turbulentKE; boundaryField { //- Set patchGroups for constraint patches #include "${WM_PROJECT_DIR}/etc/caseDicts/setConstraintTypes" //- Define inlet conditions //#include "include/fixedInlet" inlet { type groovyBC; fields ( U y ); lookuptables ( { name profile_tke_inv; outOfBounds clamp; fileName "$FOAM_CASE/profile_tke_inv.data"; } ); valueExpression "vector(profile_tke_inv(pos().y),0,0)"; //"-normal()*profile_tke_inv(pos().y)"; } atmosphere { type symmetryPlane; } outlet { type inletOutlet; inletValue $internalField; value $internalField; } ground { type kqRWallFunction; value $internalField; } frontAndBack { type empty; } }" Morover I have adapted the file include/initialConditions like that: "//flowVelocity (6 0 0); pressure 0; turbulentKE 0; turbulentOmega 1.78; #inputMode merge // ************************************************** *********************** //" Finally when I look and the log.simplefoam file I get this error message: "Create time Create mesh for time = 0 Reading field p Reading field U --> 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 U on inlet therefore using 400{(0 0 0)} Reading/calculating face flux field phi Selecting incompressible transport model Newtonian Selecting RAS turbulence model kOmegaSST --> 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 k on inlet therefore using 400{0} bounding k, min: 0 max: 0 average: 0 kOmegaSSTCoeffs { alphaK1 0.85034; alphaK2 1; alphaOmega1 0.5; alphaOmega2 0.85616; gamma1 0.5532; gamma2 0.4403; beta1 0.075; beta2 0.0828; betaStar 0.09; a1 0.31; b1 1; c1 10; F3 false; } Creating finite volume options No finite volume options present SIMPLE: no convergence criteria found. Calculations will run for 500 steps. Starting time loop Time = 1 smoothSolver: Solving for Ux, Initial residual = 1, Final residual = 0.0549726, No Iterations 2 smoothSolver: Solving for Uy, Initial residual = 0, Final residual = 0, No Iterations 0 GAMG: Solving for p, Initial residual = 1, Final residual = 0.0741149, No Iterations 7 time step continuity errors : sum local = 0.0787424, global = -0.00602472, cumulative = -0.00602472 smoothSolver: Solving for omega, Initial residual = 0.967767, Final residual = 0.0353544, No Iterations 2 --> FOAM FATAL ERROR: The expected return type scalar is different from the stored result type "vector" From function tmp<Field<Type> > ExpressionResult::getResult() in file ../swak4FoamParsers/lnInclude/ExpressionResultI.H at line 238. FOAM exiting" I think that the problem comes from my variable "k" but I have no idea where I can change the type of the stored result, as indicated in the error message. Thank you for your help sincerly Clément |
Please use CODE for output and configuration files. It makes the post MUCH more readable
Quote:
Code:
valueExpression "vector(profile_tke_inv(pos().y),0,0)"; Code:
valueExpression "profile_tke_inv(pos().y)"; |
inlet boundary condition for U and k
3 Attachment(s)
Hello Bernhard,
Thank you very much an other time for your quick answer. Quote:
Quote:
But I still have an other question: my velocity profile has the right form but the values are wrong (around 10 times higher), and I don't understand how can I get velocity value of 60m/s when my velocity inlet profile has a maximum value of only 8m/s! In which part of my program do I have to change something, please? Here are my screenshot of the velocity field and the correspondant velocity profile obtained from my velocity inlet conditions. Thank you for your advices very helpful. Clément |
Quote:
But my first guess would be the boundary-conditions. |
boundary layer error value
3 Attachment(s)
Good morning Bernhard,
Quote:
I'm facing 3 problems that I present to you: 1) When you see at the velocity profile the trend is very good except at the boundary (60m of height) where we can see an absurd horizontal line. I've looked for the reasons of appearance of this abberation but I still haven't found. Quote:
Code:
/*--------------------------------*- C++ -*----------------------------------*\ Code:
((0.000000 0.000000) 3) Finally, when I see the film of my simulation at x=0 (entry patch), I don't understand why the inlet velocity profile changes. I thought that it would always be the same because it's constant boundary condition (see last attached file named curve_U_t5_x0.png). Do you have an idea to explain these changing? I hope my explainations are enough clear. Thank you, Sincerly Clément |
Quote:
Quote:
Quote:
|
groovyBC 2D resolved
Quote:
Code:
fields Quote:
And finally thank you for the time you took to analyse my problem, it runs perfectly now. Sincerly Clément |
Quote:
Quote:
|
Hello Bernhard,
I've got just one question regarding the Clement's case: since the input data is a discrete velocity field, an interpolation might be required for grid points between the specified values. Does the OpenFOAM interpolate automatically (if yes, which interpolation method is set as default?) or user has to specify the inlet data exactly at boundary points? Many thanks! Edit1: I've tried it out, and ideed, OF seems to interpolate the prescribed discrete velocity profile on the boundary. However, I still couldn't find any information on the interpolation method that has been applied. It would be great, if you could provide some info. Thx! |
Remark: Warning at initialising groovyBC
Thanks for all the hints - I found this thread really helpful! That's why I would like to add a warning where I spend some hours on:
During the first iteration/ time step with a groovyBC-boundary Foam printed: Code:
--> FOAM Warning : (Here for a SpalartAllmaras model with specified nuTilda at the inlet.) I took this warning for a sign that groovyBC was not working - wrong! It works perfectly fine as one can see after the first iteration in paraFoam e.g. So thanks a lot again for the wonderful tool! |
Quote:
Sorry that this warning message is confusing. This really only happens during initialization. groovyBC can't do any calclations because some of the fields it uses in valueExpression might not yet be in memory (which would lead to the death of the simulation) and there is no "value" defined on the patch. Then it can only "guess" the value. 0 is not a good idea (think of T. or p in a compressible case) so it falls back to using the internal field (which should have a sensible value). But that happens only at the start. All other time-steps work as expected. I only added this warning because in some esoteric cases it could be a problem and the warning would help |
logarithmatic velocity inlet
Hi foamers,
I would to specify logaritmatic velocity at the inlet of the form Code:
U=2.5Um*ln*(z*Um/nu) + A My groovyBC look like Code:
inlet I have the error when i run the case file. Code:
swak4Foam: Allocating new repository for sampledGlobalVariables I notice the error is within the log function because i tried a case constant value in the argument and the case was fine. How do I define the log correctly in terms of position and a constant value nu from the transport properties. Thank you Kabir |
Quote:
This is swak4Foams obscure way or saying "I beg your pardon: how is the logarithm of a vector defined?". You multiply the vector u_f with a scalar and divide it by a scalar. Result is a scalar. swak4Foam expects a scalar as the argument for the log-function. So it says "Surely Kabir meant to do something to the vector to give me the scalar that I so desperately need. But I see a ')' which means I won't get the scalar. This makes me sad and I will therefore kill the program" (swak4Foam acts like a spoilt child if it doesn't get what it wants. It learned that from OpenFOAM itself) My guess is that you wanted to use the absolute value of u_f (with the mag-function) or a component of it |
All times are GMT -4. The time now is 06:15. |