CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Post-Processing

average multiplicatii, on

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 3, 2023, 13:59
Default average multiplicatii, on
  #1
Member
 
Andy
Join Date: Jul 2017
Posts: 58
Rep Power: 8
Starcatcher is on a distinguished road
Hi
during the simulation i want to store the outlet water flow.


Therfore i want to make the following entry to the controlDict:


outletflux
{
type surfaceFieldValue;
libs ("libfieldFunctionObjects.so");
writeControl timeStep;
log true;
// Output field values as well
writeFields false;
regionType faceZone;
name outlet;
operation sum;
// Parameter
fields
(
phi*alpha.water
);
}




As you see i tried to get the summation of all cells of the product of phi and alpha. Obviouly this kind of product needs the right syntaxt. can sombidy tell me how to write phi*alpha.water correctly here?


thanks
Starcatcher is offline   Reply With Quote

Old   June 4, 2023, 09:12
Default
  #2
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,066
Rep Power: 26
Yann will become famous soon enough
Hello,

Quote:
Originally Posted by Starcatcher View Post
can sombidy tell me how to write phi*alpha.water correctly here?
Short answer: you can't. It's not possible to define operation between variables here. You would have to use another function object to create your field, then use surfaceFieldValue to compute the flowrate.

But a simpler way would be to use alpha.water as weightField when summing phi.

Code:
surfaceFieldValue_weightField
    {
        type            surfaceFieldValue;
        libs            ("libfieldFunctionObjects.so");
        log             true;
        writeControl    timeStep;
        writeFields     false;
        surfaceFormat   none;
        regionType      patch;
        name            outlet;
        operation       sum;
        weightField     alpha.water;
        fields
        (
            phi
        );
    }
Or this should also work, assuming you are running interFoam, you should have a alphaPhi0.water variable which is already the alpha.water weighted flux:

Code:
surfaceFieldValue_weightField
    {
        type            surfaceFieldValue;
        libs            ("libfieldFunctionObjects.so");
        log             true;
        writeControl    timeStep;
        writeFields     false;
        surfaceFormat   none;
        regionType      patch;
        name            outlet;
        operation       sum;
        fields
        (
            alphaPhi0.water
        );
    }
Both should give the same result.

Cheers,
Yann
Yann is offline   Reply With Quote

Old   June 4, 2023, 09:39
Default
  #3
Member
 
Andy
Join Date: Jul 2017
Posts: 58
Rep Power: 8
Starcatcher is on a distinguished road
Hi Yann,
thank you very much. Yes, i use interFoam. the functions worked, however the sum of my outlets in terms of water flow is bigger than at my inlet.
I think it's because the wightening with alpha is not the best way to calculate the water flux.



Would any body have a better idea?
thanks
Starcatcher is offline   Reply With Quote

Old   June 4, 2023, 11:56
Default
  #4
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,066
Rep Power: 26
Yann will become famous soon enough
It should correspond to the water flux.

What case are you simulating ? Did you reach steady state in your simulation ?

Yann
Yann is offline   Reply With Quote

Old   June 5, 2023, 05:03
Default
  #5
Member
 
Andy
Join Date: Jul 2017
Posts: 58
Rep Power: 8
Starcatcher is on a distinguished road
Hi Yann,
now i reached the steady state. Some of the measurements seem to work.
The case is a simple Y-channel with one inlet and two outlets. the inlet water flow in 0.75m³/s


I run 3 outlet measurement strategees:
1.
Code:
flow_outlet11
    {
        type            surfaceFieldValue;
        libs            ("libfieldFunctionObjects.so");
        log             true;
        writeControl    writeTime;
        writeFields     false;
        surfaceFormat   none;
        regionType      patch;
        name            outlet1;
        operation       sum;
        weightField     alpha.water;
        fields
        (
            phi
        );
    }

2.
Code:
flow_outlet12
    {
        type            surfaceFieldValue;
        libs            ("libfieldFunctionObjects.so");
        log             true;
        writeControl    writeTime;
        writeFields     false;
        surfaceFormat   none;
        regionType      patch;
        name            outlet1;
        operation       sum;
        fields
        (
            alphaPhi0.water
        );
    }
3.

paraview load case->calculator("alpha.water"*U)->temperal integrator (over converged times steps) -> interpolate variables




Results:
1. strategy:

outlet1: 6.7

outlet2: 4.3
No idea what these values mean.



2. strategy:
oulet1: 0.48
outlet2: 0.24
Looks good, the sum is not quite 0.75m³/s, but close





3. strategy
outlet1: 0.516
outlet2: 0.28
The sum is bigger than 0.75m³/s


So strategy 2 is ok, strategy 3 could be improved maybe.
Thank you for you feedback Yann.

Last edited by Starcatcher; June 5, 2023 at 07:22.
Starcatcher is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Converging Diverging Nozzle with dbnsTurbFoam Saleh Abuhanieh OpenFOAM Running, Solving & CFD 4 December 13, 2019 10:26
[solids4Foam] How to calculate drag coeff when using solids4Foam amuzeshi OpenFOAM CC Toolkits for Fluid-Structure Interaction 15 November 7, 2019 12:50
Internal Flow Instability with layers Zephiro88 OpenFOAM Running, Solving & CFD 1 June 20, 2019 04:20
How to obtain turbulent kinetic energy data from LES model of Ansys CFX? rsin CFX 19 December 29, 2018 04:43
Near wall treatment in k-omega SST Arnoldinho OpenFOAM Running, Solving & CFD 38 March 8, 2017 13:48


All times are GMT -4. The time now is 21:04.