|
[Sponsors] |
how to calculate mass flow rate on patches and summation of that during the run? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
February 2, 2017, 15:22 |
|
#101 |
Senior Member
Philippose Rajan
Join Date: Mar 2009
Location: Germany
Posts: 552
Rep Power: 25 |
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); } This is triggering the error. Regards, Philippose |
|
February 3, 2017, 00:36 |
|
#102 |
New Member
Join Date: Aug 2016
Posts: 4
Rep Power: 10 |
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 |
|
February 16, 2021, 09:20 |
|
#103 |
Member
Join Date: Mar 2019
Posts: 31
Rep Power: 7 |
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)? |
|
February 16, 2021, 09:31 |
scalar flux only with OpenFOAM
|
#104 | |
Member
Lourenço SM
Join Date: Jul 2014
Location: Lisboa, Portugal
Posts: 41
Rep Power: 12 |
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:
|
||
February 16, 2021, 09:46 |
|
#105 | |
Member
Join Date: Mar 2019
Posts: 31
Rep Power: 7 |
Quote:
|
||
|
|