|
[Sponsors] |
[swak4Foam] groovyBC and funkySetFields married and got a kid named swak4Foam |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 17, 2012, 11:29 |
|
#121 |
Senior Member
Anne Gerdes
Join Date: Aug 2010
Location: Hamburg
Posts: 168
Rep Power: 16 |
Hey Matthew,
I tested your example and when using the same expression like you did, nothing happened. It worked when changing the order of functions and libs, try it this way HTML Code:
functions ( monitorAirOutlet { type patchExpression; accumulations (sum); patches (airout); expression "area()"; verbose true; } ); libs ( "libOpenFOAM.so" "libsimpleSwakFunctionObjects.so" "libswakFunctionObjects.so" ) ; Anne |
|
September 17, 2012, 11:34 |
|
#122 |
New Member
Matthew Kube-McDowell
Join Date: Sep 2012
Posts: 4
Rep Power: 14 |
Oh dang, it was something stupidly simple. I forgot the ";" after the libs list. Thanks, that's what I needed to fix it.
|
|
September 17, 2012, 11:35 |
|
#123 |
Senior Member
Anne Gerdes
Join Date: Aug 2010
Location: Hamburg
Posts: 168
Rep Power: 16 |
Oh, alright, I did not check this, but your are right.
The missing ';' was the reason! |
|
October 31, 2012, 12:10 |
|
#124 |
New Member
Join Date: Sep 2012
Posts: 3
Rep Power: 14 |
Greetings to all FOAMers and SWAKers
I am working with chtMultiRegionFoam and I have included in my simulation a fluid with the following thermoType: hRhoThermo<pureMixture<sutherlandTransport<specieT hermo<janafThermo<perfectGas>>>>> My question is if it is possible to obtain the thermal conductivity K as a separate file using swak4foam (or any other tool). Thank you in advance for any comments. |
|
November 1, 2012, 10:32 |
|
#125 |
New Member
Romain
Join Date: Aug 2012
Posts: 12
Rep Power: 14 |
Hello all,
I just installed swak4foam and I tried one of the tutorials : multiRegionHeaterFeedback since it seems interesting and close of what I am looking for. I use the file Allrun, but I have an error : Code:
Selecting thermodynamics package hRhoThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>> #0 Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" #1 Foam::sigFpe::sigHandler(int) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" #2 in "/lib/x86_64-linux-gnu/libc.so.6" #3 Foam::hRhoThermo<Foam::pureMixture<Foam::constTransport<Foam::specieThermo<Foam::hConstThermo<Foam::perfectGas> > > > >::calculate() in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libbasicThermophysicalModels.so" #4 Foam::hRhoThermo<Foam::pureMixture<Foam::constTransport<Foam::specieThermo<Foam::hConstThermo<Foam::perfectGas> > > > >::hRhoThermo(Foam::fvMesh const&) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libbasicThermophysicalModels.so" #5 Foam::basicRhoThermo::addfvMeshConstructorToTable<Foam::hRhoThermo<Foam::pureMixture<Foam::constTransport<Foam::specieThermo<Foam::hConstThermo<Foam::perfectGas> > > > > >::New(Foam::fvMesh const&) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libbasicThermophysicalModels.so" #6 Foam::basicRhoThermo::New(Foam::fvMesh const&) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libbasicThermophysicalModels.so" #7 in "/opt/openfoam211/platforms/linux64GccDPOpt/bin/chtMultiRegionFoam" #8 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" #9 If I use a fixedValue boundary condition and not the groovyBC boundary condition the tutorial is running. The groovyBC is the following : Code:
minY { type groovyBC; value uniform 300; valueExpression "Tin-(Tout-300)"; variables "Tout{maxX/topAir}=average(T);Tin{minY/heater}=average(T);"; } Even if the valueExpression is used, the patch minY should be set at T_heater-(T_topAir-300) thus 500 K - (300-300) = 500 K. I tried different groovyBC expression for the temperature, but my temperature on this patch is always set to 0, which cause the simulation to fail. If someone could show what is wrong with this boundary condition, or with the example case (multiRegionHeaterFeedback, which is included is the installation package of swak4foam) it will be really useful. Thanks, Romain edit : I found my problem ! while I was looking at the wiki (http://openfoamwiki.net/index.php/Contrib/swak4Foam) I observed that OF211 seems to not be yet supported. And effectively, it is working with OF210. It seems that swak is not yet working correctly with OF211. At least one hour wasted on that ! Hopefully it will help someone to not repeat my mistake. Last edited by romain.h; November 1, 2012 at 16:12. |
|
November 4, 2012, 07:08 |
|
#126 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Greetings to all!
@HighOrderCFD: Quote:
Best regards, Bruno
__________________
|
||
November 5, 2012, 10:35 |
|
#127 |
Member
Join Date: Mar 2009
Posts: 90
Rep Power: 17 |
I am using swak4foam to monitor mass flow rate on faceZones. Does anyone know if it's possible to do pressure averaging on a faceZone using swak4foam?
|
|
November 5, 2012, 17:01 |
|
#128 | ||
New Member
Romain
Join Date: Jun 2010
Location: Lyon
Posts: 28
Rep Power: 16 |
Quote:
It seem that you are looking to do something similar to what is explaining here, part 3.6 ---------------------- On another point, I am looking to implement a boundary condition in chtMultiRegionFoam for conduction between two solids, but with a contact resistance. I was thinking to use something along the lines of Quote:
qHot { type swakExpression; valueType patch; patchName hot; verbose true; expression "-K*area()*snGrad(T)"; accumulations (sum); region Solid_2; } Do you think that something like that could work ? Thanks Last edited by nakor; November 7, 2012 at 09:23. |
|||
November 5, 2012, 17:52 |
|
#129 | |
Member
Join Date: Mar 2009
Posts: 90
Rep Power: 17 |
Quote:
|
||
November 14, 2012, 18:56 |
|
#130 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
To access properties of the thermal model that are not accessible by fields you can load a function plugin by adding "libswakThermoTurbFunctionPlugin.so" to your libs. Then the field parser has additional functions like thermo_alpha() (which gives you the thermalDiffusivity) FunctionPlugins only work with the latest release of swak4Foam
__________________
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 |
||
November 14, 2012, 19:01 |
|
#131 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
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 |
||
November 16, 2012, 05:36 |
|
#132 | ||
New Member
Romain
Join Date: Jun 2010
Location: Lyon
Posts: 28
Rep Power: 16 |
Quote:
http://sourceforge.net/apps/mantisbt...nbn=1#bugnotes : My solution was to switch to OF210, which resolve the groovyBC problem, but OF210 is not working properly with one of my other boundary condition (externallWallHeatFluxTemperature). I could stick with OF210 and groovyBC if I could replace externallWallHFTemperature with a similar groovy boundary condition. Do you think that the following one could do the trick ? Quote:
edit: after test, it seem that I have to use hc=hext/lambda; I do not see why... But at least it is working. Last edited by nakor; November 19, 2012 at 18:10. |
|||
November 20, 2012, 20:39 |
|
#133 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
autoInterpolate true; this tells the parser to automatically interpolate volume fields to the faces
__________________
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 |
||
November 30, 2012, 00:34 |
Refining my case
|
#134 | ||
New Member
Matthew Kube-McDowell
Join Date: Sep 2012
Posts: 4
Rep Power: 14 |
Hi again, now that I've got swak working I'm looking for a more elegant solution to my actual problem.
I'm running my case in interFoam, and what I'm trying to measure is the mass or volume flow of one phase out an outlet. What I've got right now is Quote:
What I want is an expression more like Quote:
|
|||
November 30, 2012, 13:14 |
|
#135 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Inner product is & and normal() gets you the face vectors
__________________
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 |
||
January 28, 2013, 22:12 |
|
#136 |
New Member
sorush ahmadian
Join Date: Jun 2012
Posts: 5
Rep Power: 14 |
Dear Bernard, I am newly working with OpenFOAM. I am trying to use the groovyBC library for a convective heat transfer boundary condition. I have used two kinds of expression:
1- { type groovyBC; variables "ktherm=0.5;ktot=ktherm;htot=3400;Tinf=253.15; "; valueExpression "Tinf"; gradientExpression "0"; fractionExpression "(1/(1+ktot/htot*(mag(delta()))))"; value uniform 293.15; } For this kind of expression unfortunately when I change variables like htot no change in the solution is observed. So alternatively I used the following expression: 2- { type groovyBC; value uniform 293.15; variables "htot=340;Tinf=253.15;Cp=384;k=ktherm*0.01;gra dT=-htot*mag((T-Tinf))/k;";//k=alphaEff*rho*Cp; gradientExpression "gradT"; fractionExpression "0"; timelines ( ); } For this kind of expression, the results seem reasonable but when I increase the value of htot for a limit, a floating point expression is occurred and the solution is not converged. Can you please kindly help me in this regards? I prefer to use the second solution but dont know how to avoid the Floating point exception. I would really appreciate your help! Regards |
|
January 29, 2013, 15:15 |
|
#137 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Question: do you see groovyBC in the stacktrace? If not then I guess the problem is not groovyBC per se but the way you use it
__________________
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 |
||
January 29, 2013, 15:26 |
|
#138 |
New Member
Alex
Join Date: Jan 2013
Posts: 1
Rep Power: 0 |
Dear Bernard,
I am a student of shipbuilding. At the moment I am writing my bachelor thesis. Therefore I am using your swirl, which you have published on the website: http://openfoamwiki.net/index.php/Contrib_groovyBC I do know how the swirl is working, but I am not sure, how the swirl looks alike. What i want to adjust: I want to indicate a swirl at the Inlet, which goes through the domain, so that I can map the results at my simulation. Below you can see my actual swirl. For the construction I have used your parameters. This swirl drifts along the y axis. Unfortunately i do not believe that this is how your swirl should look alike. The swirl originates at the beginning of my plate, that’s why I believe that the plate is causing the swirl. Would it be possible that you send me images of your swirl? Or do you have any advice for me, how to accomplish my swirl? Your information on CFD-online are really helpful and I am grateful, that you are such an active user of CFD-online. screenshots: https://www.dropbox.com/sh/t6uuyhhaslmcsoi/RRK13N6Um- Code: inlet { type groovyBC; variables "rpm=8000.0;Un=55.8;c=sum(pos()*mag(Sf()))/sum(mag(Sf()));n=sum(normal())/mag(sum(normal()));p=pos()-c;r=mag(p)+1.0e-10;R=max(r);xt=vector(n.y,-n.x,0);xT=xt/mag(xt);yt=vector(-n.x*n.z,-n.y*n.z,n.x*n.x+n.y*n.y);yT=yt/mag(yt);"; valueExpression "-Un*normal() + (rpm*pi/30)*((p & yT)*xT - (p & xT)*yT)"; } Kind regards, Alexander Last edited by Alex3262; January 30, 2013 at 02:59. |
|
January 29, 2013, 21:55 |
|
#139 | |
New Member
sorush ahmadian
Join Date: Jun 2012
Posts: 5
Rep Power: 14 |
Quote:
Thanks so much for your reply! I tried to change the time step (high to very small) and even the mesh (finer) but again got Floating point expression. I guess there is a problem with numerical calculation. The reason I am telling this is that for example with variables htot=340 and k=ktherm*0.1 the solution is correct but when I change htot to for example 500 (which is not a big change) or the k to ktherm*0.05 then the temperature of the wall and the cells accross the wall fall to very small values of orders -1e20 and finally floating point expression is occurred. It seems that the solution is fine until a certain value of gradT or heat flux but heat fluxes higher than that value will cause a heat sink at the boundary. One of the problems that may affect the solution can be the expression of mag(T-Tinf) which for T values lower that Tinf gradient is still imposed which should not. In OF codes I usually use for example max(0, (T-Tinf)) instead of mag(T-Tinf) but in groovyBC I tried this with no success. Do you know how to do this in groovyBC? Any idea on improving the BC? Thanks again for your consideration. |
||
January 30, 2013, 05:06 |
|
#140 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Just some notes: - making the mesh finer will NOT make the problem with the explicit gradient (the second formulation) go away but make it worse. ONLY change the timestep - the first formulation should be in my opinion more stable - the max-expression SHOULD work
__________________
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 |
||
|
|