|
[Sponsors] |
[swak4Foam] GroovyBC the dynamic cousin of funkySetFields that lives on the suburb of the mesh |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 29, 2010, 10:24 |
groovyBC
|
#161 |
New Member
Pal Schmitt
Join Date: Aug 2010
Location: Belfast
Posts: 21
Rep Power: 16 |
Dear Forum,
I successfully used groovyBC for some simple waveBC. For learning (and later doing more complex stuff) I implemented the same equations (setting values for alpha and U) in a custom BC. I then compared the BC values produced by both BCs and they were equal, except timestep 0. I cannot see the numbers for timestep 0, but in paraFoam the groovyBC case gives alpha=0 and my customBC sets it to the waterlevel. Now, I have the astonishing effect of very different development in the internal field, groovyBC behaves well and my BC produces large velocities in the internal field, even with zero amplitude waves which correctly impose zero velocity and no surface elevation. Although it seems very unlikely to me, is there something I should know about how groovyBC evaluates the gradient? Would I have to define a way to get a gradient like in mixed Patch? The whole issue does not make much sense to me, so any idea is much appreciated. I can happily share my BC and the testcases if anyone is interested. Cheers, Pal |
|
September 29, 2010, 13:26 |
|
#162 | ||
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Quote:
I'm not sure whether I understand your problem correctly "The boundary conditions look the same (except for t=0) but the solution is different (although groovyBC gives a sensible solution)" |
|||
September 30, 2010, 05:18 |
|
#163 |
Senior Member
Join Date: Sep 2010
Posts: 226
Rep Power: 17 |
hi guys
how are you? you are the Masters, i am just a new openfoam user and i have seen your posts and i thought you might be able to help me, if you please of course My problem is that i need to set a BC on a patch of a field "c" , but that BC is a function of another field "J" calculated before going to solve the Eqn of "c". Example inside the solver: . . J=pow(c,-2)+2*c+...etc....... . . solve ( ddt(c) + div(phi,c) == div(A*div(J)) ) . . so now if i go to apply a BC on a patch of the field "c", but this BC is [J=0]. how to do that? Any idea? if with groovyBC, how? help please thanks alot |
|
September 30, 2010, 05:48 |
More precisely
|
#164 |
New Member
Pal Schmitt
Join Date: Aug 2010
Location: Belfast
Posts: 21
Rep Power: 16 |
Dear Bernhard and all,
Thanks for Your reply, What I tried to say was that both BCs set the same fixed values, but when i use them on the same case they give different results. Which is of course impossible... For time step zero i have not yet verified the values of groovyBC since they are not written out automatically. Since with my BC the velocity in the internal field turns crazy I am unsure if groovyBC influences the evaluation of the gradient in any way when I only set a valueExpression . Don't know why it should but it could explain the difference. I attached my (still ugly ) implementation of what should be the same as the groovyBC command used and two mini cases to just compare the BCs. Thanks for Your input, Cheers, Pal |
|
September 30, 2010, 08:08 |
|
#165 |
New Member
Pal Schmitt
Join Date: Aug 2010
Location: Belfast
Posts: 21
Rep Power: 16 |
Seems I shouldn't trust my eyes anymore...
Last edited by wavemaster; September 30, 2010 at 11:45. Reason: need vacation |
|
September 30, 2010, 15:17 |
|
#166 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Code:
theMightyPatch { type groovyBC; valueExpression "sin(J)*J"; // or whatever the expression is } |
||
September 30, 2010, 16:44 |
MightyPatch
|
#167 |
Senior Member
Join Date: Sep 2010
Posts: 226
Rep Power: 17 |
Hi gschaider,
thanks for your reply but in the Expression, can i put an equation also ??? ! My J is a volVectorField defined and used previously inside the solver so how to put if i need "J=0" ? Can i put it directly like this "J=0" or "J=(0 0 0)" inside the ValueExpression ? or how? help please and thanks for you Last edited by T.D.; September 30, 2010 at 16:49. Reason: grammar |
|
October 1, 2010, 06:36 |
|
#168 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
You'll have to solve f(c)=0 pick the solution that makes (physical) sense and implement it in the boundary condition for c Bernhard |
||
October 1, 2010, 07:26 |
OK
|
#169 |
Senior Member
Join Date: Sep 2010
Posts: 226
Rep Power: 17 |
hi
thank you so much thanks a lot, and sorry if i insisted a bit thank you so much for your patience but i am really in trouble and i don't know what to do how can i solve J=0 knowing that it is f(c), it will be like another problem where i need also my value of "c" that i don't know on the same patch wall. It looks like setting a new problem with the same problem that stays, becuase the value of "c" at that BC wall is to be from solving "J=0"? Just for clearance i repeat: My "J" is the flux i defined (i calculated) which is a very complex form function of "c". I need after to solve a transport eqn for field "c" but where the BC on a certain patch wall for "c" filed is the (zeroFlux) "J=0" . help please, any ideas?? Can it be done by just setting a zeroGradient for the "c" filed BC at that patch wall ? Is it the same, knowing My Flux J is a special function of "c" that i defined? thanks a lot i need your patience Last edited by T.D.; October 6, 2010 at 10:10. Reason: changing |
|
October 4, 2010, 15:29 |
groovyBc compilation error
|
#170 |
Member
|
Hi Bernhard,
I am using OpenFOAM-1.6 with Fedora12. during groovyBC compilation I recieve some warnings nad errors that I copy some of them because all of them are almost the same: PatchValueExpressionParser.yy:684: error: ‘union pve::PatchValueExpressionParser::semantic_type’ has no member named ‘lfield’ PatchValueExpressionParser.yy:685: error: ‘union pve::PatchValueExpressionParser::semantic_type’ has no member named ‘lfield’ PatchValueExpressionParser.yy:685: error: ‘union pve::PatchValueExpressionParser::semantic_type’ has no member named ‘lfield’ PatchValueExpressionParser.yy:685: error: ‘union pve::PatchValueExpressionParser::semantic_type’ has no member named ‘lfield’ PatchValueExpressionParser.yy:685: error: ‘union pve::PatchValueExpressionParser::semantic_type’ has no member named ‘lfield’ PatchValueExpressionParser.yy:685: error: ‘union pve::PatchValueExpressionParser::semantic_type’ has no member named ‘lfield’ PatchValueExpressionParser.yy:686: error: ‘union pve::PatchValueExpressionParser::semantic_type’ has no member named ‘lfield’ PatchValueExpressionParser.yy:686: error: ‘union pve::PatchValueExpressionParser::semantic_type’ has no member named ‘lfield’ PatchValueExpressionParser.yy:686: error: ‘union pve::PatchValueExpressionParser::semantic_type’ has no member named ‘lfield’ PatchValueExpressionParser.yy:686: error: ‘union pve::PatchValueExpressionParser::semantic_type’ has no member named ‘lfield’ PatchValueExpressionParser.yy:686: error: ‘union pve::PatchValueExpressionParser::semantic_type’ has no member named ‘lfield’ PatchValueExpressionParser.yy:687: error: ‘union pve::PatchValueExpressionParser::semantic_type’ has no member named ‘lfield’ PatchValueExpressionParser.yy:687: error: ‘union pve::PatchValueExpressionParser::semantic_type’ has no member named ‘lfield’ PatchValueExpressionParser.yy:687: error: ‘union pve::PatchValueExpressionParser::semantic_type’ has no member named ‘lfield’ PatchValueExpressionParser.tab.cc: In member function ‘unsigned char pve::PatchValueExpressionParser::yytranslate_(int) ’: PatchValueExpressionParser.tab.cc:4941: warning: use of old-style cast make: *** [Make/linux64GccDPOpt/PatchValueExpressionParser.o] Error 1 please give me some guids and I wolud appreciate it. sincerely yours |
|
October 5, 2010, 09:01 |
|
#171 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
b) what is the output of "bison -V" Bernhard |
||
October 6, 2010, 09:10 |
groovyBc compilation error
|
#172 |
Member
|
Hi Bernhard
thanks alot for your answer. a) no, first of all, i have an error that i solved it by deleting the extra enter in make/options file. aftar that i compile again and this time, i encountered the error that i sent it to you. b)i installed bison 2.4.1 successfully is it possible that this error is relating to my OF version(1.6.x)? sincerely yours Last edited by yashar.afarin; October 6, 2010 at 09:55. |
|
October 6, 2010, 13:32 |
|
#173 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
b) Bison and OF-version should be alright as long as you downloaded the 1.6-version What did you change in Make/options. I'm suspecting that Bernhard |
||
October 8, 2010, 14:20 |
|
#174 |
Member
|
Hi bernhard
thank you for your guidance. I detected the error and could solve it successfully. |
|
October 11, 2010, 13:44 |
|
#175 |
New Member
Brian
Join Date: Aug 2010
Location: Southampton
Posts: 12
Rep Power: 16 |
Hi all,
I have got groovyBC working fine - thanks very much Bernhard =D. Reading back on this forum I think that if I am coupling two patches I can only take one value from the source patch, eg. a max, min or average value. Is this correct? I have conformal meshes at the two faces, and would like to be able to take the velocity profile from one patch and apply it as the BC for the other. What files would I have to look at modifying to try and achieve this? Or would groovyBC allow a text file (which I would write each time step from the source patch) to be read in and define a profile? Thanks in advance and sorry if a similar q has been posed b4, but I couldnt find anything on the forum Brian |
|
October 12, 2010, 08:10 |
|
#176 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
a) it would require some changes on the way results are passed around b) and this is more important: it would require some amount of checking. Otherwise there'd be a whole lot of possible user errors and I don't want to open that can of worms (and I'm not talking about parallelization yet) Reading from files I thought about, but is currently not very high on my priority list. For your case I don't think it would be the way to go anyway (a. you'd have to write the data b. the performance would be horrible) Why don't you use a cyclic BC for that anyway? Bernhard |
||
October 12, 2010, 09:01 |
|
#177 |
New Member
Brian
Join Date: Aug 2010
Location: Southampton
Posts: 12
Rep Power: 16 |
Thanks for the response. I thought that those were going to be the issues, but just wanted to check. I wanted to also be able to match the shear stress at the two faces as well... will have to have a think and play around with the cyclic condition.
Thanks again |
|
November 16, 2010, 10:43 |
|
#178 |
Member
Antonio Liggieri
Join Date: Aug 2010
Posts: 76
Rep Power: 15 |
Hello groovy People
I'm using groovyBC as well. Also for heatFlux problems and it looks like this: SURFACE_SOURCE { type groovyBC; value uniform 283; valueExpression "283"; gradientExpression "gradT"; fractionExpression "0"; variables "heatFlux=2000;Cp0=1005;rho0=1.18;gradT=heatFl ux/(alphaEff * Cp0 * rho0);"; timelines ( ); } Up to now I used it in models without radiation. As soon as radiation is implemented, the solver returns the following error: ************************************************** ******************************************* --> FOAM FATAL ERROR: Parser Error at "1.11-18" :"field alphaEff not existing or of wrong type" "heatFlux/(alphaEff * Cp0 * rho0)" " ^^^^^^^^ " From function parsingValue in file PatchValueExpressionDriver.C at line 188. ************************************************** ******************************************* Does anybody have a clue, where this problem could come from? I compared the appearance of alphaEff in buoyantSimpleFoam and in buoyantSimpleRadiationFoam. The appearance is exactly the same!! Thanx in advance for any hints! Tony |
|
November 16, 2010, 12:51 |
|
#179 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Bernhard |
||
November 17, 2010, 05:25 |
|
#180 |
Member
Antonio Liggieri
Join Date: Aug 2010
Posts: 76
Rep Power: 15 |
What do you mean with "h"?? for my understanding h is the enthalpy and it appears in the laplacian term with alphaEff. But how can I use it for my problem??
Yes the turbulence model is the same. Basically the whole solver is the same accept to the additionally implemented radiation model! This is my "debugging" procedure: I have my 0 directory with the necessary files to run buoyantSimpleRadiationFoam. The directory contains exactly the same files as the one of buoyantSimpleFoam + the G file, which provides the radiation props of the walls etc. Now I run buoyantSimpleFoam --> and it works. (even if the G file is in the dir - it's not needed) Then I run buoyantSimpleRadiationFoam --> and the above mentioned error occurs. Would it work, if I modify the solver in a manner, to let him write out alphaEff in a file every timestep? If so, do you know how to do that? I've found this piece of code in an other thread, { volScalarField alphaEff = turb.alphaEff(); alphaEff.write(); } but I don't know where to insert it. Maybe you have an idea. Tony |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Ship resistance shows wiggles when using Overset mesh and dynamic mesh in Fluent | Qingsong | FLUENT | 2 | March 21, 2022 16:08 |
sliding mesh problem in CFX | Saima | CFX | 46 | September 11, 2021 08:38 |
[ICEM] Dynamic mesh setup with ICEM | David121284 | ANSYS Meshing & Geometry | 0 | April 11, 2014 05:19 |
Dynamic Mesh "Shadow Wall" | thezack | FLUENT | 0 | June 4, 2013 23:09 |
dynamic mesh for drop interface | IndrajitW | FLUENT | 0 | March 30, 2013 09:03 |