|
[Sponsors] |
May 31, 2020, 10:26 |
integrate multiplication of fields
|
#1 |
New Member
Nikita
Join Date: Oct 2019
Posts: 20
Rep Power: 7 |
Hi foamers,
I'm doing a multhiphase task with 3 phases using multiphaseInterFoam and i want to get volume integral of the some variables and of their multiplication, for example, mass of one phase. in the controlDict file, I want to use a function to calculate the integral for the quantity ( rho*alpha.water) during the whole calculation. I has found this topic - integrate several fields , but in last version OpenFOAM some functions of swak4foam was included in the OpenFOAM. I want use smth like this (code from link above) Code:
functions { makeMagU { type expressionField; functionObjectLibs ( "libswakFunctionObjects.so" ); autowrite false; fieldName magU; expression "mag(U)"; } temp_average { type volumeAverage; functionObjectLibs ( "libsimpleFunctionObjects.so" ); verbose true; fields (magU); } } |
|
May 31, 2020, 17:47 |
|
#2 |
New Member
Nikita
Join Date: Oct 2019
Posts: 20
Rep Power: 7 |
Update:
I saw this topic : New Documentation: OpenFOAM Expressions (reImpl of swak4Foam of Bernhard Gschaider) But don't know how to use this documentation. And further. saw this code to determine the field: Code:
compute_ptot { type expressionField; outputControl timeStep; outputInterval 1; fieldName ptot; expression "p + 0.5*magSqr(U)"; autowrite false; } |
|
June 2, 2020, 05:13 |
|
#3 |
Senior Member
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13 |
Hi,
If you need to compute the above expression only, OpenFOAM has derivedFields function object with which you can compute "pTotal". Hope this helps.
__________________
The OpenFOAM community is the biggest contributor to OpenFOAM: User guide/Wiki-1/Wiki-2/Code guide/Code Wiki/Journal Nilsson/Guerrero/Holzinger/Holzmann/Nagy/Santos/Nozaki/Jasak/Primer Governance Bugs/Features: OpenFOAM (ESI-OpenCFD-Trademark) Bugs/Features: FOAM-Extend (Wikki-FSB) Bugs: OpenFOAM.org How to create a MWE New: Forkable OpenFOAM mirror |
|
June 2, 2020, 06:20 |
|
#4 |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40 |
This is indeed one of the open points but the emphasis would actually be more on supporting expressions for surfaceFieldValue since this is where people might need to define some "weird" definition to evaluate. However, one of the constraints would is access to arbitrary fields. For patch types this is reasonably straight-forward, for faceZones it can mostly work, but also gets a bit hit-and-miss due to the face orientations, for sampled surfaces and registered surfaces it seems to be out-of-scope since it is just trying to do far too much.
For simple volume field generation, using one of the predefined one (as another poster suggested), or whip up a tiny coded function object to do the same probably makes the most sense. |
|
June 2, 2020, 10:35 |
|
#5 |
New Member
Nikita
Join Date: Oct 2019
Posts: 20
Rep Power: 7 |
thanks for replies!!! I found answers in this thread - integrate multiplication of fields
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
surface and volume fields multiplication | Zato_Ichi | OpenFOAM Programming & Development | 9 | May 27, 2022 03:48 |
integrate multiplication of fields | Chikiton | OpenFOAM Programming & Development | 16 | April 15, 2022 03:48 |
a reconstructPar issue | immortality | OpenFOAM Post-Processing | 8 | June 16, 2013 12:25 |
an odd(at least for me!) reconstructPar error on a field | immortality | OpenFOAM Running, Solving & CFD | 3 | June 3, 2013 23:36 |
PostChannel | maka | OpenFOAM Post-Processing | 5 | July 22, 2009 10:15 |