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

how to calculate mass flow rate on patches and summation of that during the run?

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree23Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 2, 2017, 15:22
Default
  #101
Senior Member
 
Philippose Rajan
Join Date: Mar 2009
Location: Germany
Posts: 552
Rep Power: 25
philippose will become famous soon enough
Hello both of you,
@Bernhard: I think what Sridhar meant by "last step" is that he prepared his case, and setup everything, and as the "last step", started the simulation using the "mpirun ...." command, which then immediately caused the simulation to abort with the error he has shown.

Dont think he meant "last step" as in... last simulation iteration.

@ Bernhard, Sridhar:
I think the error can be found here...:

Code:
veloFlow
{
type swakExpression;
valueType internalField;
verbose true;
outputControl timeStep;
outputInterval 1; 
aliases {alpha alpha.water;} 
variables ("thres=0.60;")
expression "(alpha>thres) ? mag(U) : 0";
accumulations (max weightedAverage);

}


total
{
type swakExpression;
valueType internalField;
verbose true;
outputControl timeStep;
outputInterval 1; 
aliases {alpha alpha.water;} 
expression "vol()*alpha";
accumulations (sum);

}
There are missing ";" (semi-colons) at the end of the lines "aliases" (in both veloFlow and total) and "variables" (in veloFlow).

This is triggering the error.

Regards,
Philippose
philippose is offline   Reply With Quote

Old   February 3, 2017, 00:36
Default
  #102
New Member
 
Join Date: Aug 2016
Posts: 4
Rep Power: 10
shri@ is on a distinguished road
Hello !

@ philippose sir,

Yes the error was in the missing semicolon at the end. I made the changes and it worked.


Thank you very much for reply.



@ Bernhard sir,

Here's the sequence of operations

1. blockMesh >> works fine
2. checkMesh >> "Mesh OK"
3. setFields >> works fine
4. decomposePar >> works fine
5. mpirun -np 8 renumberMesh -overwrite -parallel >> works fine
6. mpirun -np 8 interFoam -parallel >> this prompts the error I quoted above.


As philippose sir suggested the error prompts even before the first timestep is calculated.

I am working with OpenFoam 3.0.x and swak version is 0.4.1 and ubuntu 15.10. (I am able to use other functionalities of swak4Foam with current setup)


Thank you

Shridhar
shri@ is offline   Reply With Quote

Old   February 16, 2021, 09:20
Default
  #103
Member
 
Join Date: Mar 2019
Posts: 31
Rep Power: 7
Andrea23 is on a distinguished road
Hi;

Maybe I am a bit late but I am trying to do something similar I want to calculate the output flow of a scalar, so I want to calculate phi*T (T is the volScalarField)

volFlow
{
type swakExpression;
valueType patch;
patchName OUTLET;
verbose true;

timeEnd 500;
outputControl timeStep;
outputInterval 5;
writeControl timeStep;
writeInterval 5;

expression "phi*T";
accumulation (sum);
}

I have swak4foam installed, I am using openFoam 8 and I loaded these libraries in controlDict

libs (
"libOpenFOAM.so"
"libsimpleSwakFunctionObjects.so"
"libswakFunctionObjects.so"
"libgroovyBC.so"
"fieldFunctionObjects.so"
"libgroovyBC.so"
);

But openfoam does not write the output of this function. Do you know the problem?
"phi*T" is correct? I want the sum for all boundary cell of "outflow facecell phi * cellcenter value of T"

last thing "accumulation (sum)" sum values of all previous timesteps (so in time 3 the value is time1+time2+time3)?
Andrea23 is offline   Reply With Quote

Old   February 16, 2021, 09:31
Default scalar flux only with OpenFOAM
  #104
Member
 
Lourenço SM
Join Date: Jul 2014
Location: Lisboa, Portugal
Posts: 41
Rep Power: 12
lourencosm is on a distinguished road
Hey,
You don't need swak4Foam for this anymore:

Code:
fluxT
{
    type            surfaceFieldValue;
    libs            ("libfieldFunctionObjects.so");

    writeControl      timeStep;
    writeInterval     1;
    writeFields        false;
    writeArea	   false;
    log                   false;
    surfaceFormat   none;

    regionType      patch;
    name             OUTLET;

    operation       weightedSum;
    weightField     T;
    fields             (phi);
    scaleFactor     -1;
}


Quote:
Originally Posted by Andrea23 View Post
Hi;

Maybe I am a bit late but I am trying to do something similar I want to calculate the output flow of a scalar, so I want to calculate phi*T (T is the volScalarField)

volFlow
{
type swakExpression;
valueType patch;
patchName OUTLET;
verbose true;

timeEnd 500;
outputControl timeStep;
outputInterval 5;
writeControl timeStep;
writeInterval 5;

expression "phi*T";
accumulation (sum);
}

I have swak4foam installed, I am using openFoam 8 and I loaded these libraries in controlDict

libs (
"libOpenFOAM.so"
"libsimpleSwakFunctionObjects.so"
"libswakFunctionObjects.so"
"libgroovyBC.so"
"fieldFunctionObjects.so"
"libgroovyBC.so"
);

But openfoam does not write the output of this function. Do you know the problem?
"phi*T" is correct? I want the sum for all boundary cell of "outflow facecell phi * cellcenter value of T"

last thing "accumulation (sum)" sum values of all previous timesteps (so in time 3 the value is time1+time2+time3)?
Andrea23 likes this.
lourencosm is offline   Reply With Quote

Old   February 16, 2021, 09:46
Default
  #105
Member
 
Join Date: Mar 2019
Posts: 31
Rep Power: 7
Andrea23 is on a distinguished road
Quote:
Originally Posted by lourencosm View Post
Hey,
You don't need swak4Foam for this anymore:

Code:
fluxT
{
    type            surfaceFieldValue;
    libs            ("libfieldFunctionObjects.so");

    writeControl      timeStep;
    writeInterval     1;
    writeFields        false;
    writeArea	   false;
    log                   false;
    surfaceFormat   none;

    regionType      patch;
    name             OUTLET;

    operation       weightedSum;
    weightField     T;
    fields             (phi);
    scaleFactor     -1;
}
Thanks a lot, it works
lourencosm likes this.
Andrea23 is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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



All times are GMT -4. The time now is 12:33.