|
[Sponsors] |
[swak4Foam] Post-processing on an empty patch using swak4foam |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 9, 2013, 10:42 |
Post-processing on an empty patch using swak4foam
|
#1 |
Member
Join Date: Jan 2011
Posts: 45
Rep Power: 15 |
Hi,
I have a large domain consisting of multiple similar regions for which I want to calculate surface flow field quantities such as U*T*dA through a surface in order to come up with an energy balance. I used topoSet to create cellSets (for each region) and then created smaller meshes using subsetMesh. However, the new meshes contain an empty patch (which was internal before) called oldInternalFaces. I understand why that empty patch must be there, but how can I now calculate surface field flow? I tried swak4Foam with this function object: Code:
QFlow { type patchFieldFlow; functionObjectLibs ( "libsimpleFunctionObjects.so" ); verbose true; patches ( inX outX oldInternalFaces ); fields ( k ); factor 4185; outputControl timeStep; outputInterval 1; } Also, the field I'm interested in (T) cannot be found by swak4foam (that's why I used k in the above example). Does anybody know why and how I can fix that? The field is where it's supposed to be and I can view it in paraFoam. When I do the same calculation in paraFoam using the calculator filter with U*T, the resulting surface field flow is non-zero. So to sum it up: How can I calculate quantities such as U*T*dA and integrate them over an empty patch? I don't want to use paraFoam as I'd like to use the results in scripts (many cases). Regards Christoph |
|
October 9, 2013, 11:08 |
|
#2 | |||
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Quote:
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 |
||||
October 9, 2013, 11:35 |
|
#3 | ||
Member
Join Date: Jan 2011
Posts: 45
Rep Power: 15 |
Quote:
I'm using simpleFoam with an added equation for T. Here's the instatiation: Code:
volScalarField T ( IOobject ( "T", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); Quote:
Code:
QFlow1 { type surfaces; valueType surface; surfaceName oldInternalFaces; expression "U&Sf())*T"; accumulations (sum); outputControl timeStep; outputInterval 1; } My conclusion for now is that my way of splitting the domain for post-processing is not well suited for my goal of integrating over the new surface created by the split. |
|||
October 9, 2013, 12:01 |
|
#4 |
Member
Join Date: Jan 2011
Posts: 45
Rep Power: 15 |
If that matters, here's how I execute the function:
Code:
execFlowFunctionObjects -dict funkyDoCalcDict |
|
October 9, 2013, 16:23 |
|
#5 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
And it "finds" T (you must have changed something) Splitting is OK (I guess). The problem is that "empty" is not the appropriate BC for that. That BC is for "erasing" the 3rd dimension for a 2D-calculation. So it is designed to "not let anything through".
__________________
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 |
||
October 10, 2013, 03:42 |
|
#6 | |
Member
Join Date: Jan 2011
Posts: 45
Rep Power: 15 |
Quote:
Yes, empty is not suitable in this case. Any suggestion what I could use instead without too much hassle? I tried to turn it into a plain patch using createPatch and then remap the fields, but mapFields refused to map anything. |
||
October 10, 2013, 10:57 |
|
#7 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
I'm not sure what your "multiple regions" (original posting) are. Your setup only makes sense for a multiRegion-solver like chtFoam. If you want "control surfaces" in a single-region solver then faceZones or faceSets are more what you need
__________________
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 |
||
October 10, 2013, 11:13 |
|
#8 |
Member
Join Date: Jan 2011
Posts: 45
Rep Power: 15 |
Thanks for the hint, the term "region" in my first post was misleading. I'll try faceSets or faceZones. I have never used faceZones, what exactly are they? The documentation is not very verbose in that respect...
|
|
October 10, 2013, 13:31 |
|
#9 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
But that is not a swak-problem anymore
__________________
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 |
||
October 11, 2013, 04:25 |
|
#10 |
Member
Join Date: Jan 2011
Posts: 45
Rep Power: 15 |
I did a forum search on the difference between faceSets and faceZones, and found this thread: http://www.cfd-online.com/Forums/ope...condition.html (post #8). So what I would need here is a faceZone wherever I want to sample in the field and I could then use swak4Foam or some other post-processing tool to calculate the quantities I'm interested in and integrate them over the zone. Does that sound viable? It would still be a potential swak-problem
To make this more descriptive, here are two screenshots of the whole mesh and of the subdomain: wholeDomain.jpg The whole domain consists of 5 similar subdomains for which I want to calculate an energy balance. This is one of the subdomains I generated with subsetMesh, the new empty patch is on the left side: gasketRegion.png |
|
October 11, 2013, 08:28 |
|
#11 | |
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 |
||
October 11, 2013, 08:46 |
|
#12 |
Member
Join Date: Jan 2011
Posts: 45
Rep Power: 15 |
Well, I was able to create a faceSet from the new empty patch, but not in the larger domain where these faces would be internal.
Evaluating with swak4foam didn't work as expected. This is the code I used: Code:
functions ( QFlow2 { type swakExpression; valueType faceSet; setName beforeFilter; expression "phi*flip()*T"; accumulations ( sum ); verbose true; } ); Code:
Unknown function type swakExpression Table of functionObjects is empty |
|
October 11, 2013, 09:58 |
|
#13 | |
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 |
||
October 11, 2013, 11:52 |
|
#14 |
Member
Join Date: Jan 2011
Posts: 45
Rep Power: 15 |
Thanks for the hint, will try that on monday...
|
|
October 14, 2013, 04:59 |
|
#15 |
Member
Join Date: Jan 2011
Posts: 45
Rep Power: 15 |
Adding the lib helped a bit, but didn't give me a result. For
Code:
functions ( QFlow2 { type swakExpression; valueType faceSet; setName intFaces; expression "phi*flip()*T"; accumulations ( sum ); verbose true; } ); Code:
actions ( { name intFaces; type faceSet; action new; source patchToFace; sourceInfo { name "oldInternalFaces"; } } { name intFacesSlaveCells; type cellSet; action new; source faceToCell; sourceInfo { set intFaces; // Name of faceSet option any; } } ); Code:
execFlowFunctionObjects -time 10011 -dict funkyDoCalcDict |
|
October 14, 2013, 08:31 |
|
#16 | |
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 |
||
October 14, 2013, 08:49 |
|
#17 |
Member
Join Date: Jan 2011
Posts: 45
Rep Power: 15 |
I didn't use funkyDoCalc because I didn't get it working first, that's all. I didn't know about any substantial differences between the two so this was not real decision.
Removed the "functions" block surrounding the definition to make it work with funkyDoCalc, this is the resulting dict: Code:
QFlow2 { type swakExpression; valueType faceSet; setName intFaces; searchOnDisk true; expression "phi*flip()*T"; accumulations ( sum ); verbose true; } Code:
Could not find a field name T of type scalar (neither surfaceScalarField nor volScalarField) autoInterpolate: 0 (try setting 'autoInterpolate' to 'true') From function SubsetValueExpressionDriver::getFieldInternalAndInterpolate(const word &name,const Subset &sub) in file SubsetValueExpressionDriverI.H at line 303. |
|
October 14, 2013, 10:15 |
|
#18 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
No matter what I write into the error messages the effect is similar to writing "There is a problem. Ask Bernhard". And when I ask nobody says "Well. I would have understood that error message if it had said ...." so I guess people think "Ups. I should have read the content of the message before asking"
__________________
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 |
||
October 14, 2013, 10:37 |
|
#19 | ||
Member
Join Date: Jan 2011
Posts: 45
Rep Power: 15 |
Quote:
Quote:
adding autoInterpolate true to the function indeed made the error disappear, I'll see if the results make any sense. Thanks! Christoph |
|||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] Can't Shake Erros: patch type 'patch' not constraint type 'empty' | BrendaEM | OpenFOAM Meshing & Mesh Conversion | 12 | April 3, 2022 18:32 |
[Commercial meshers] Mesh conversion problem (fluent3DMeshToFoam) | Aadhavan | OpenFOAM Meshing & Mesh Conversion | 2 | March 8, 2018 01:47 |
Compressor Simulation using rhoPimpleDyMFoam | Jetfire | OpenFOAM Running, Solving & CFD | 107 | December 9, 2014 13:38 |
[GAMBIT] periodic faces not matching | Aadhavan | ANSYS Meshing & Geometry | 6 | August 31, 2013 11:25 |
[Commercial meshers] Fluent msh and cyclic boundary | cfdengineering | OpenFOAM Meshing & Mesh Conversion | 48 | January 25, 2013 03:28 |