|
[Sponsors] |
[swak4Foam] mass Flow of water with Swak4Foam |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 19, 2015, 18:57 |
mass Flow of water with Swak4Foam
|
#1 |
Member
Rafael Marques
Join Date: Mar 2014
Location: Almada/Mülheim a.d. Ruhr, Portugal/Germany
Posts: 67
Rep Power: 12 |
Hi Everybody,
I am simulating a wave breaker and i try to get the overtopping. I want to obtain the mass flow of the water on the top of the structure and I know that is possible to intergrate the velocity over a faceZone, so i want to ask if somebody can give me a hind how to do it? The main question is how to integrate the velocity of alpha over a faceZone? I created a expression Field with the x velocity of the water VeloxAgua { type expressionField; outputControl timeStep; valueType internalField; outputInterval 1; fieldName UxAlpha; variables ( "thres=0.5;" "xDirection=vector(1,0,0);" "Ua1x=alpha1>thres ? (U & xDirection) : 0;" ); expression "Ua1x"; autowrite true; } but after that i don know hoew to integrate this UxAlpha over a faceZone. thanks to everybody Rafa Marques |
|
August 21, 2015, 18:17 |
|
#2 |
Member
Rafael Marques
Join Date: Mar 2014
Location: Almada/Mülheim a.d. Ruhr, Portugal/Germany
Posts: 67
Rep Power: 12 |
Hi Bruno,
First i want to says thanks for your didactic answer. I finally got, my problem was that i hat now ideia how the information are stored in the cells so, i tried to get information of the cell volume with the cell face and that didn't work, so that is what i did to get the mass flow of the only of the water. i created a simpled case of a water recipient that is drowning out through a pipe to know the answer. them i created a faceZone and a slave cell with the toposetdict: Code:
actions ( { name massFlow; type faceSet; action new; source boxToFace; sourceInfo { box (0.8 -1 0) (0.805 1 0.1); } } { name massFlow; type faceZoneSet; action new; source setToFaceZone; sourceInfo { faceSet massFlow; // name of cellSet } } { name massFlow_SlaveCells; type cellSet; action new; source faceZoneToCell; sourceInfo { name massFlow; option slave; } } ); and then i used swakExpression to get the water velocity at the faceZone, using the alpha as if condition (like the example in the swakWiki) Code:
functions ( flowIntFluid { type swakExpression; valueType faceZone; zoneName massFlow; variables ( "thres=0.5;" "phiAl=U & Sf();" "phiAlpha1=alpha1>thres ? (phiAl*alpha1) : 0;" ); expression "phiAlpha1"; accumulations ( sum ); verbose true; autoInterpolate true; } flowIntFluid2 { type swakExpression; valueType faceZone; zoneName massFlow; variables ( "thres=0.5;" "phiAlpha=alpha1>thres ? (phi*flip()*alpha1) : 0;" ); expression "phiAlpha"; accumulations ( sum ); verbose true; autoInterpolate true; } ); Thanks again i learned a lot Rafa Marques [ Moderator note: Moved from http://www.cfd-online.com/Forums/ope...code-do-2.html ] Last edited by wyldckat; September 6, 2015 at 12:41. Reason: Added [CODE][/CODE] markers and moderator note |
|
August 21, 2015, 19:10 |
|
#3 | ||
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Hi Rafa,
Sorry, I had plans on providing a more detailed answer, but I ended up not having the time and inspiration to do so But you certainly have provided the main details that I would have had to test and write, so thank you for doing so! Quote:
Code:
orientFaceZone [OPTIONS] <faceZone> <outsidePoint> Quote:
Curiously, this is in the FAQ: http://openfoamwiki.net/index.php/FA..._is_writing.3F Best regards, Bruno
__________________
|
|||
August 22, 2015, 08:54 |
|
#4 |
Member
Rafael Marques
Join Date: Mar 2014
Location: Almada/Mülheim a.d. Ruhr, Portugal/Germany
Posts: 67
Rep Power: 12 |
Hi Bruno,
thanks for the quick answer, i tried to use the orientFaceZone utility but at the moment i didn't get it to work for now, i am quite a noob at openfoam and linux so everything takes a while for me to figured out. one question about the flipmap, when i didn't turn it of i get negative results, is that because of the slave cells are switch? and one more question the slave cells are the cells of both side off the faceZone and i get the information about the alpha1 from them? but i need the information of the cell where the water passing by first. Greets Rafa Marques |
|
August 22, 2015, 09:02 |
|
#5 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Quote:
|
||
August 22, 2015, 09:25 |
|
#6 |
Member
Rafael Marques
Join Date: Mar 2014
Location: Almada/Mülheim a.d. Ruhr, Portugal/Germany
Posts: 67
Rep Power: 12 |
Thanks again Bruno
i will study this thread ! greets Rafa MArques |
|
September 19, 2015, 16:58 |
Defining the field alpha
|
#7 |
Senior Member
Saideep
Join Date: Apr 2015
Location: INDIA
Posts: 203
Rep Power: 12 |
hi Bruno and Rafa;
Bruno, as usual thanks for redirecting me here. I spent quite a lot of time but never found this thread. I tried this sort of procedure some time back but i had and have a problem. Now as rafa is taking outflux at certain specific face, I have not used the topoSetFields utility. I am only interested at the boundary face as of now. I want to define and would like to read someting like this: "phiAlpha1=alpha1>thres ? (phiAl*alpha1) : 0;" but how can you write the output of alpha1 field? In older versions of OF, you had to specify alpha field in createFields.h. But now its not the case. however, I traced back to the older versions of OF(1.7) and made changes accordingly to make my alpha field to be read and updated every time step. I think so I was sucessful but though i had a series of errors forcing me to specify someting like alpha.phase1 and related alpha.phase1 data in the fvSolutions dictionary though it does not update the values in the later time steps. Also I tested both ways and alpha values{also results obviously} are different. I tested the damBreak case. So, how did you do it? Thanks and best; Saideep |
|
September 19, 2015, 17:17 |
|
#8 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Hi Saideep,
Can you please adapt the tutorial case "interFoam/ras/waterChannel" and attach it onto your next post? I ask this because this tutorial case is the closest to your description and it would make it easier for me to test things. Best regards, Bruno
__________________
|
|
September 20, 2015, 07:19 |
|
#9 |
Senior Member
Saideep
Join Date: Apr 2015
Location: INDIA
Posts: 203
Rep Power: 12 |
hi Bruno;
As told, I tested both interFoam and my modified solver{lets call it so } for the waterChannel case. I also attached in a word doc with my changes to my modified solver. Just a few lines actually. Also you can see the attached results which show some sort of variation between both the solvers. {ofcourse not much of use if i just specify for only 1 time step. This is at 15s.} Apart from that an other question. Does the function accumulate ( sum ) give a cumulative output or time specific output? I am under an assumption that it gives the cumulative sum of a field. Correct me if wrong. Thanks; Saideep |
|
September 20, 2015, 07:49 |
|
#10 | |||
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Quick answers:
Quote:
In other words, the test case would make it quicker for me to take a look at whatever might be going wrong with the original case and settings. Quote:
Quote:
|
||||
September 20, 2015, 08:32 |
|
#11 |
Senior Member
Saideep
Join Date: Apr 2015
Location: INDIA
Posts: 203
Rep Power: 12 |
hi Bruno;
I will check out for accumulation (sum) function as you advised so that i am sure of what is it calculating. But are you asking me to provide a test case for checking the difference in results? Actually as you mentioned the presence of dot operator gives an error using swak4Foam. So, I was not able to use field alpha.water and so had to opt to create a field for alpha seperately and output that. But what is confusing me is the difference in results though i expect them to be the same. Saideep |
|
September 20, 2015, 09:49 |
|
#12 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
OK, it took some mental digging through my memories and then I remembered this bug report: http://sourceforge.net/p/openfoam-ex...swak4foam/210/
Quoting Bernhard's answer: Quote:
|
||
November 21, 2022, 10:20 |
|
#13 |
Member
|
Hello,
Currently running OpenFOAM 6 and downloaded that version of Swak4Foam with rollback "hg update v0.4.2" for compilation needs per Bernhard's recommendation. I'm attempting funkySetFields with OF6 interFoam for an alpha.water field, where in this post, and also https://sourceforge.net/p/openfoam-e...swak4foam/210/ and https://openfoamwiki.net/images/d/db...mReference.pdf the reference is to place aliases { alphaWater alpha.water; } in the "specification directory". Can someone help me understand what exactly this means or how to do this more specifically? I have tried to place in: 0/alpha.water and in: system/funkySetFieldsDict but running it does not seem to recognize the aliases command and continues to give: "Parser Error for driver FieldValueExpressionDriver at "1.2-11" : "field alphaWater not existing or of wrong type" "alphaWater==1) ? (randNormal() > 0.0 ? 0.55 : ).45) : 0" It only seems to go away if I make a duplicate of 0/alpha.water and name it 0/alphaWater. In trying to add some GaussianNoise, your advice on this matter would be appreciated. Thank you, LtH |
|
Tags |
alpha1, interfoam, mass flow, swak4foam, water |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Define mass flow profile with regards to species mass fraction | danS | Fluent UDF and Scheme Programming | 0 | June 20, 2017 07:21 |
Target Mass Flow Rate | Nitin | FLUENT | 9 | June 17, 2017 11:30 |
Wrong flow in ratating domain problem | Sanyo | CFX | 17 | August 15, 2015 07:20 |
Low torque values on Screw Turbine | Shaun Waters | CFX | 34 | July 23, 2015 09:16 |
Discrete Phase & Mass Flow Rate | MagnusZeus | FLUENT | 0 | December 2, 2011 18:57 |