|
[Sponsors] |
[swak4Foam] Mass flow through faceZone using swak4foam when running in parallel |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 13, 2013, 10:33 |
Mass flow through faceZone using swak4foam when running in parallel
|
#1 |
Member
Daniel Pielmeier
Join Date: Apr 2012
Posts: 99
Rep Power: 14 |
I try to obtain the mass flow through a faceZone with swak4foam using the following function in my controlDict:
Code:
flowIntFluid { type swakExpression; valueType faceZone; region fluid_water; zoneName int_fluid; expression "phi*flip()"; accumulations ( sum ); verbose true; } Code:
{ name int_fluidSlaveCells; type cellSet; action new; source faceZoneToCell; sourceInfo { name int_fluid; option slave; } } Is it possible to distribute this set information to the individual directories? |
|
April 13, 2013, 12:52 |
|
#2 |
Member
Daniel Pielmeier
Join Date: Apr 2012
Posts: 99
Rep Power: 14 |
I figured out that I do not need swak4foam for this task, using the following function in controlDict does the same and works when running in parallel.
Code:
flowIntFluid { type faceSource; functionObjectLibs ("libfieldFunctionObjects.so"); enabled true; outputControl timeStep; region fluid_water; log true; valueOutput false; source faceZone; sourceName int_fluid; operation sum; fields ( phi ); } |
|
April 13, 2013, 17:12 |
|
#3 | |
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 |
||
April 13, 2013, 17:13 |
|
#4 | |
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 |
||
April 13, 2013, 17:36 |
|
#5 |
Member
Daniel Pielmeier
Join Date: Apr 2012
Posts: 99
Rep Power: 14 |
||
April 13, 2013, 17:45 |
|
#6 | |
Member
Daniel Pielmeier
Join Date: Apr 2012
Posts: 99
Rep Power: 14 |
Quote:
Running funkyDoCalc on the reconstructed case with the following dictionary works as well: Code:
massFlow { valueType faceZone; zoneName int_fluid; accumulations ( sum ); expression "phi"; } |
||
April 13, 2013, 18:32 |
|
#7 |
Member
Daniel Pielmeier
Join Date: Apr 2012
Posts: 99
Rep Power: 14 |
I checked the face normals in paraview and they are all oriented in the same way. So the slave cell set is not required in this case. I still do however get the wrong output when running in parallel.
|
|
April 14, 2013, 06:53 |
|
#8 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Define "garbage". Anyway: there may be a corner case where the sums are not correct: if a face in the set is on a processor-boundary. In that case it may be counted twice or not at all
__________________
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 |
|
April 14, 2013, 07:01 |
|
#9 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
0 A 1 2 B 3 Here on A and B phi is positive. In another case 1 A 0 2 B 3 on A the phi is negative while on B it is still positive. Summing it up without multiplying it with the flip will give you a wrong result. That is what I mean with "orientation" and am not sure how you'd visualize this with paraview (as you mentioned in another posting)
__________________
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 |
||
April 14, 2013, 07:45 |
|
#10 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
what does flip do?
|
|
April 14, 2013, 09:03 |
|
#11 | |||
Member
Daniel Pielmeier
Join Date: Apr 2012
Posts: 99
Rep Power: 14 |
Quote:
Quote:
Output for single processing: Code:
# Time sum 1 -0.195176 2 -0.195298 3 -0.195382 4 -0.19532 5 -0.19533 6 -0.195343 7 -0.195337 8 -0.195337 9 -0.195339 10 -0.195338 11 -0.195338 12 -0.195339 13 -0.195339 14 -0.195338 15 -0.195338 Code:
# Time sum 1 -172000 2-6.34742e-310 3 -0.000473733 4 -nan 5 0.0251599 6 -4042.94 7 -0.00175415 8-8.93413e-310 9 -0.00423105 10 -nan 11 5.71386 12 3.23021e-51 13 126807 14 -15.0175 15-1.42553e+248 Quote:
Last edited by billie; April 14, 2013 at 11:27. |
||||
April 14, 2013, 11:00 |
|
#12 | |||
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Quote:
That really looks like garbage 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 |
||||
April 14, 2013, 11:03 |
|
#13 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
A function returning -1 or +1 that helps working around the situation I described above (the flipMap is usually set by some other utility)
__________________
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 |
|
April 14, 2013, 15:25 |
|
#14 |
Member
Daniel Pielmeier
Join Date: Apr 2012
Posts: 99
Rep Power: 14 |
So probably this is meshing related. The mesh comes from Hypermesh and is exported directly to OpenFOAM format. It contains one internal surface which I want to use for mass flow calculation. From the export a faceZone is created for the internal surface as well as a boundary patch which I remove from the boundaries file as else the meshCheck fails. Afterwards I run renumberMesh to get rid of the unordered face warning
Code:
***Faces not in upper triangular order. <<Writing 186 unordered faces to set upperTriangularFace Currently I do not know a better way of creating the faceZone and the required cell set, but maybe there is a more elegant way to do this. |
|
April 14, 2013, 18:09 |
|
#15 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Have you tried leaving renumberMesh out (whether then things 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 |
||
April 15, 2013, 06:40 |
|
#16 | ||
Member
Daniel Pielmeier
Join Date: Apr 2012
Posts: 99
Rep Power: 14 |
Quote:
Quote:
My current workflow is as follows (it is a multi-region case btw.): Code:
runApplication transformPoints -scale '(0.001 0.001 0.001)' runApplication renumberMesh -overwrite runApplication checkMesh -allGeometry -allTopology runApplication splitMeshRegions -cellZonesOnly -overwrite for i in solid_aluminium solid_steel do rm -f 0*/${i}/{mut,nuTilda,k,epsilon,omega,p_rgh,U} done for i in fluid_water do rm -f 0*/${i}/{dummy} done for i in fluid_water solid_aluminium solid_steel; do if [ -f log.changeDictionary.${i} ]; then echo "changeDictionary already run on ${PWD}: remove log to re-run" else changeDictionary -region ${i} 2>&1 >log.changeDictionary.${i} fi done runApplication decomposePar -allRegions COUNT=0 NPROCS=$(getNumberOfProcessors) while [ "${COUNT}" -lt "${NPROCS}" ]; do if [ -f log.topoSetDict.processor${COUNT} ]; then echo "topoSetDict already run on ${PWD}: remove log to re-run" else topoSet -case processor${COUNT} -dict ${PWD}/system/topoSetDict \ -region fluid_water 2>&1 >log.topoSetDict.processor${COUNT} fi let 'COUNT += 1' done runParallel $(getApplication) ${NPROCS} runApplication reconstructPar -allRegions -latestTime |
|||
April 15, 2013, 14:48 |
|
#17 | ||
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Different decomposition? Just curious if this makes the -1 go away 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 |
|||
April 15, 2013, 15:17 |
|
#18 |
Member
Daniel Pielmeier
Join Date: Apr 2012
Posts: 99
Rep Power: 14 |
It looks like the problem was mesh related. The problems occurred with a small test model which consists of a simple channel with the interior surface in between. Today I tested it with a full model with one inlet which splits eight times and combines again afterwards. There I would like to know the mass flux distribution. For this model the flux is reported correct from the swakExpression as well as the faceSource. The sets created for the decomposed case do not include negative face numbers here.
Another thing I noticed the OpenFoam output from Hypermesh does not reliable create the faceZones, thus I exported first to Fluent format and converted to OpenFoam format using fluent3DMeshToFoam. This way I have all required boundaries, cellZones, faceZones etc. with no need to change anything manually. Plus it creates flipMaps for the faceZones. Could this probably why the reason the output from the faceZone is correct? |
|
April 15, 2013, 15:23 |
|
#19 | |||
Member
Daniel Pielmeier
Join Date: Apr 2012
Posts: 99
Rep Power: 14 |
Quote:
Quote:
Quote:
If the Hypermesh output is buggy I will contact the Altair support about this issue. |
||||
April 15, 2013, 16:58 |
|
#20 | |
Member
Daniel Pielmeier
Join Date: Apr 2012
Posts: 99
Rep Power: 14 |
Quote:
While checking this I recognized that sometimes the startFaces of the inter processor boundaries are not the same. I think they should be same as they share the same faces. So I have procBoundary0to1 -> startFace 15775 and procBoundary1to0 -> startFace 15571. What is strange that I get no other errors. Anyway I think there is a problem with the Hypermesh mesh export. I will take a look at this and report back here. |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Specify mass flow rate for periodic boundary conditions in channel flow | lion1990 | OpenFOAM Running, Solving & CFD | 1 | July 9, 2018 18:46 |
mass flow in is not equal to mass flow out | saii | CFX | 12 | March 19, 2018 06:21 |
mass flow rate... | sanjar | OpenFOAM Running, Solving & CFD | 1 | December 2, 2013 01:09 |
Discrete Phase & Mass Flow Rate | MagnusZeus | FLUENT | 0 | December 2, 2011 18:57 |
Target mass flow rate | Saturn | FLUENT | 0 | December 10, 2004 05:18 |