|
[Sponsors] |
[swak4Foam] Using calculated swak expressions in another functions |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 21, 2016, 08:06 |
Using calculated swak expressions in another functions
|
#1 |
Member
Arsalan
Join Date: Jul 2014
Posts: 74
Rep Power: 12 |
Dear Foamers,
How could I use the calculated swak expressions at other functions for example like below: Code:
createInterface { type createSampledSurface; outputControl timeStep; outputInterval 1; surfaceName interface; surface { type isoSurface; isoField alpha.water; isoValue 0.5; interpolate true; } } surface { ignore_unimplemented_simpleFunctionObject::movePoints true; type swakExpression; valueType surface; surfaceName interface; verbose true; expression "sum(area())"; accumulations ( min ); autowrite true; } k { aliases { alphawater alpha.water; } ignore_unimplemented_simpleFunctionObject::movePoints true; type swakExpression; valueType internalField; variables ( "thres=0.5;"//which cells to keep "VolC= sum (alphawater < thres ? C*vol() : 0);" ); expression "VolC/surface"; accumulations ( average ); } Moreover, we couldn't calculate area() in the k function separately because this function has an internalField valueType while using area() needs a surface valueType! The second question is how could we use the runTime() value in the functions? I think it has a keyword but I don't remember that. Any help and comment will be appreciated. Regards, Arsalan. |
|
October 22, 2016, 07:20 |
|
#2 | ||
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Code:
"surface{surface'interface}=sum(area());" Quote:
Both questions are answered in the (incomplete) Reference Guide in the Documentation folder. Especially the external expressions (with your nomenclature it can be a bit confusing which "surface" means what)
__________________
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 22, 2016, 11:07 |
|
#3 | |
Member
Arsalan
Join Date: Jul 2014
Posts: 74
Rep Power: 12 |
Dear Bernhard,
Thanks for your straightforward answer, works like a charm. Quote:
You are right and the first question is explained in detail at page "24" of the reference pdf and the time() keyword is defined at the 14th page. So I should read this reference as soon as possible. For now, do you have any idea about post-processing (or could be programming) problem that asked in below thread?! http://www.cfd-online.com/Forums/ope...hase-flow.html I'm very grateful to you for your helps. Best regards, Arsalan. |
||
Tags |
internalfield, surface, swak4foam, swakexpression |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
One more time: wall functions - SST | CellZone | OpenFOAM Pre-Processing | 22 | June 11, 2021 13:27 |
Wall functions - questions about implementation | AlmostSurelyRob | OpenFOAM Programming & Development | 44 | May 6, 2020 10:11 |
Wall functions vs. boundary layers | kandelabr | OpenFOAM Running, Solving & CFD | 3 | June 12, 2017 07:05 |
When I use the wall functions....! | maximus | Main CFD Forum | 7 | January 20, 2003 09:35 |
N-S equations:divergence free functions? | D. Puigjaner | Main CFD Forum | 1 | July 27, 2000 12:43 |