|
[Sponsors] |
[swak4Foam] swak4FoamFilter to filter grid data- could use some Help |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 27, 2018, 07:12 |
swak4FoamFilter to filter grid data- could use some Help
|
#1 |
Member
Jeff
Join Date: May 2016
Posts: 44
Rep Power: 10 |
Hi
I am trying to extract and write into a file the positions (x,y,z) and ideally closest cell volume but I still has to figure out how to to that, where the velocity magnitude exceed a threshold using swak4foam writeIf feature. After reading some examples, I came with the following: Code:
{ type writeIfSwakExpression; verbose yes; outputControlMode timeStep; outputInterval 1; valueType internalField; writeCondition "mag(U)>90"; writeControlMode always; cooldownMode no; storeAndWritePreviousState no; writeConditionAccumulation or; variables ( "X=pos().x;" "Y=pos().y;" "Z=pos().z;" ); storedVariables ( { name X; name Y; name Z; initialValue "0"; } ); } Code:
swak4Foam: Allocating new repository for sampledMeshes swak4Foam: Allocating new repository for sampledGlobalVariables filterTest: "mag(U)>90" evaluated to true filterTest starts writing filterTest triggered writing of t=1 filterTest: Writing .... But when the case ends I cannot find the information I need. Obviously I am doing something wrong but I dont know what If someone could point me into the right direction, it will be much appreciated Thanks JF ps: the motivation is to build a script that refine a mesh based on some physical criteria |
|
August 27, 2018, 18:29 |
|
#2 |
New Member
Paul Lee
Join Date: Jun 2018
Location: Vancouver
Posts: 14
Rep Power: 7 |
is swak4foam compatible with current version of OpenFOAM v6 or OpenFOAM v1806?
I want to used groovyBC, which is a sub function in swak4foam and found this page: https://openfoamwiki.net/index.php/Contrib/swak4Foam but cannot find a version supporting v6 or v1806. Do I have to install a legacy OpenFoam? what version of swak4Foam are you using with what version of OpenFOAM? Can you post me a link? |
|
August 27, 2018, 19:49 |
|
#3 | |
Member
Jeff
Join Date: May 2016
Posts: 44
Rep Power: 10 |
Quote:
(almost) Everythng is explained there (with some news on the tweet feed as well). TO answer your question I am using swak 0.4.2 with foan-extend 4.1,but I read that swak should work with OF6 and 18.06 Just download the dev version on the mercurial website as explained on the wiki JF |
||
August 27, 2018, 20:45 |
|
#4 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
writeIfSwakExpression only triggers the writing of a complete timestep storedVariable is "only" a special time of variable that keeps its value between timesteps (applications would be finding a maximum over time, summing up mass-flows etc) What kind of data would you need? Only one position or all the cells "violating" the condition?
__________________
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 |
||
August 27, 2018, 21:13 |
|
#5 |
Member
Jeff
Join Date: May 2016
Posts: 44
Rep Power: 10 |
All the cell violating a condition ( that can be possibly complex ) ==>
It generate a cloud of points ( a file of x,y,z possibly with vol(cell) s an added information that can then be used to refine the mesh automatically in a scriptable mesher. I currently do it through paraview threshold but this is not practical for large mesh size ( but sufficient to test the workflow). JF |
|
August 28, 2018, 05:28 |
|
#6 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Have a look at manipulateCellSet in swakFunctionObjects (example in Examples/other/topoSetDamBreak). That creates a cellSet depending on a condition. cellSets are "natural" for a lot of OpenFOAM-tools If you still need to output all cell centers then you can use dumpSwakExpression from simpleSwakFunctionObjects (which I hardly use because of its tendency to clutter the hard-disk)
__________________
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 |
||
August 28, 2018, 07:04 |
|
#7 |
Member
Jeff
Join Date: May 2016
Posts: 44
Rep Power: 10 |
Thank you
a quick look at the exemple indicates that manipulateCellSet is the function I need for my current endeavor. I will play a bit with it to get acquainted first As for dumpSwakExpression, you clearly documented the disk cluttering issue in the relevant example! I will nevertheless take the time to understand what it does.. just in case. JF |
|
August 28, 2018, 07:47 |
|
#8 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Stupid question: have you considered using dynamicRefineFvMesh with a custom field that you calculate with an expressionField functionObject (instead of the alpha.water that is used in the damBreakWithObstacle-tutorial)?
__________________
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 |
||
August 28, 2018, 08:03 |
|
#9 |
Member
Jeff
Join Date: May 2016
Posts: 44
Rep Power: 10 |
Yes, briefly but I did not explore it.
Indeed, and to the best of my understanding of the documentation, dynamicRefineMesh will cut a cell in 8 or not based on a predefined criteria. That does not work well for complex unstructured mesh such as the ones I am working with, as it increases contrast between cell that are cut and the ones that are not. I cannot speak in general, but in most situation I can think of ( read: useful to me), this decrease the overall mesh quality. On the other hand a scriptable mesher allows for more complex remeshing strategies in order to maintain mesh quality around the "bad" cell that will be reduced. Last edited by jf_vt; August 28, 2018 at 08:04. Reason: typos |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[General] Extracting ParaView Data into Python Arrays | Jeffzda | ParaView | 30 | November 6, 2023 21:00 |
CFD by anderson, chp 10.... supersonic flow over flat plate | varunjain89 | Main CFD Forum | 18 | May 11, 2018 07:31 |
Remapping pressure data for another grid | clktp | OpenFOAM Post-Processing | 3 | February 6, 2018 08:34 |
Run OpenFoam in 2 nodes of a cluster | WhiteW | OpenFOAM Running, Solving & CFD | 16 | December 20, 2016 00:51 |
matching variable data with grid point data | anfho | OpenFOAM Programming & Development | 0 | May 6, 2011 15:28 |