|
[Sponsors] |
how to calculate mass flow rate on patches and summation of that during the run? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 1, 2013, 15:10 |
|
#81 | ||
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
About this discussion from back in April:
Quote:
Quote:
Thing is that it was embarrassingly simple to do... because I only had to remove excess code from execFlowFunctionObjects. Best regards, Bruno
__________________
|
|||
May 13, 2014, 05:37 |
|
#82 |
Member
|
hi all,
I used the same thing as explained by Bruno, but i got the following message Code:
--> FOAM FATAL IO ERROR: Istream not OK for reading dictionary file: fdcMassFlow at line 1. From function dictionary::read(Istream&, bool) in file db/dictionary/dictionaryIO.C at line 91. FOAM exiting Code:
patchIntegrate phi <patch name> I am more interested in average value, so please suggest me the correct way (i am using OpenFOAM version 2.2.2 ) Thanks and Regards, Adarsh |
|
November 25, 2014, 14:16 |
|
#83 |
Member
Lourenço SM
Join Date: Jul 2014
Location: Lisboa, Portugal
Posts: 41
Rep Power: 12 |
Hello Adarsh,
have you tried "patchAverage"? |
|
August 15, 2016, 12:05 |
|
#84 |
Senior Member
Manu Chakkingal
Join Date: Feb 2016
Location: Delft, Netherlands
Posts: 129
Rep Power: 10 |
Hello
I have n issue with snGrad usage with funkydocalc. With swak4foam I gave : functions( NusseltNumber_hot { type patchExpression; outputControl timeStep; outputInterval 1; patches ( w_l ); verbose true; variables ( "Tsat=300.1;" "ln2D=3.065;" //length(.08)/k(.0261) ); expression "ln2D*snGrad(T)/(T-Tsat)"; accumulations ( average ); } ); ------------------------------------------------------ This gave me a Nusselt No. of 56.02 (neglect scaling) . With all data in disk I tried to obtian the same using funkyDoCalc as: NusseltNumber_hot { valueType patch; patchName w_l; variables ( "Tsat=300.1;" "ln2D=3.065;" //length(.08)/k(.0261) ); expression "ln2D*snGrad(T)/(T-Tsat)"; accumulations ( max ); } ----------------------------------------------------------- Which is giving me 0 as output for max/min/average I read in: https://sourceforge.net/p/openfoam-e...2.1_v2.x/tree/ that the snGrad doesnt work when data is in disc and needs to be temporarily loaded. Could anyone explain on what to be done
__________________
Regards Manu |
|
August 17, 2016, 13:01 |
|
#85 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
__________________
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 |
||
August 17, 2016, 13:20 |
|
#86 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
I just checked it with a case here and this gives the same value as snGrad in funkyDoCalc. So I can't reproduce. But one possible issue could be that the boundary condition I did it for was fixedValue. So I'll need a bit more info: - OF-version - swakVersion - the boundary condition of w_l
__________________
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 |
||
August 17, 2016, 13:26 |
|
#87 |
Senior Member
Manu Chakkingal
Join Date: Feb 2016
Location: Delft, Netherlands
Posts: 129
Rep Power: 10 |
Hello
I used the latest swak4foam version and OF 2.3.0. W_l has a B.C of constant wall temp.
__________________
Regards Manu |
|
August 18, 2016, 06:36 |
|
#88 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
With "constant wall temp" you mean "type fixedValue"? (when looking for bugs the physical meaning is irrelevant. The important information is the type. If you set the fixed temperature with a "type mixed" then it is a completely different ball game)
__________________
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 |
|
August 18, 2016, 06:38 |
|
#89 |
Senior Member
Manu Chakkingal
Join Date: Feb 2016
Location: Delft, Netherlands
Posts: 129
Rep Power: 10 |
Hello Bernhard
w_l { type fixedValue; value uniform 300.2; } I have set it fixed value
__________________
Regards Manu |
|
August 18, 2016, 12:21 |
|
#90 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Hmm. That is strange. That boundary condition should be no problem
__________________
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 |
|
August 18, 2016, 12:38 |
|
#91 |
Senior Member
Manu Chakkingal
Join Date: Feb 2016
Location: Delft, Netherlands
Posts: 129
Rep Power: 10 |
Hello Bernhard
Is there anything to do with the mesh as I get the message highlighted in bold manuchakkingal@tud278038:/net/users/manuchakkingal/data/2016/2d_NC_porous_4_by_4_Ra_10_4_coarse> funkyDoCalc system/trialDict -time 60120 --------------------------------------------------------------------------------------------------------- /*---------------------------------------------------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.3.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ Build : 2.3.0-f5222ca19ce6 Exec : funkyDoCalc system/trialDict -time 60120 Date : Aug 18 2016 Time : 17:36:08 Host : "tud278038" PID : 4472 Case : /net/users/manuchakkingal/data/2016/2d_NC_porous_4_by_4_Ra_10_4_coarse nProcs : 1 sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). fileModificationChecking : Monitoring run-time modified files using timeStampMaster allowSystemOperations : Disallowing user-supplied system call operations // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // swakVersion: 0.4.0 (Release date: 2016-07-17) // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Create mesh for time = 60120 No information about foreign meshes in "system/trialDict.NusseltNumber_hot" Time = 60120 NusseltNumber_hot : swak4Foam: Setting default mesh swak4Foam: Allocating new repository for sampledGlobalVariables average=0 End --------------------------------------------------------------------------- My triadict is: /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.3.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ NusseltNumber_hot { valueType patch; patchName w_l; variables ( "Tsat=300.1;" "ln2D=3.065;" //length(.08)/k(.0261) "snGradT=(T-internalField(T))/mag(delta());" ); expression "ln2D*snGradT/(T-Tsat)"; accumulations ( average ); } // ************************************************** *********************** //
__________________
Regards Manu |
|
August 18, 2016, 13:08 |
|
#92 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Anyway. What is the output of Code:
fieldReport -doBoundary T -time 60120
__________________
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 |
||
August 19, 2016, 05:13 |
|
#93 |
Senior Member
Manu Chakkingal
Join Date: Feb 2016
Location: Delft, Netherlands
Posts: 129
Rep Power: 10 |
Dear Berhard,
I got the below: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // swakVersion: 0.4.0 (Release date: 2016-07-17) // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Create mesh for time = 60120 Time = 60120 Reading Field T of type volScalarField Internal field: swak4Foam: Allocating new repository for sampledMeshes swak4Foam: Allocating new repository for sampledGlobalVariables Size | Weight Sum 4554 | 1.17025e-05 Range (min-max) 300 | 300.2 Average | weighted 300.1 | 300.1 Sum | weighted 1.36666e+06 | 0.00351192 Median | weighted 300.101 | 300.101 Patch field: w_l Size | Weight Sum 44 | 0.000181019 Range (min-max) 300.2 | 300.2 Average | weighted 300.2 | 300.2 Sum | weighted 13208.8 | 0.054342 Median | weighted 300.2 | 300.2 Patch field: w_r Size | Weight Sum 44 | 0.000181019 Range (min-max) 300 | 300 Average | weighted 300 | 300 Sum | weighted 13200 | 0.0543058 Median | weighted 300 | 300 Patch field: w_t Size | Weight Sum 44 | 0.000181019 Range (min-max) 300.004 | 300.198 Average | weighted 300.115 | 300.115 Sum | weighted 13205.1 | 0.0543266 Median | weighted 300.122 | 300.122 Patch field: w_b Size | Weight Sum 44 | 0.000181019 Range (min-max) 300.002 | 300.196 Average | weighted 300.085 | 300.085 Sum | weighted 13203.7 | 0.0543212 Median | weighted 300.076 | 300.076 Patch field: cyl Size | Weight Sum 272 | 0.0011309 Range (min-max) 300.003 | 300.197 Average | weighted 300.1 | 300.1 Sum | weighted 81627.2 | 0.339384 Median | weighted 300.101 | 300.101 End
__________________
Regards Manu |
|
August 19, 2016, 07:18 |
|
#94 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Solution: either set the writePrecision to a higher value or set the writeMode from ascii to binary (that will write out the full precision)
__________________
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 |
||
August 19, 2016, 09:14 |
|
#95 |
Senior Member
Manu Chakkingal
Join Date: Feb 2016
Location: Delft, Netherlands
Posts: 129
Rep Power: 10 |
Dear Berhard
I tried setting the write precision to 10 and it worked. Thanks for the support. --------------------------------------------------------------------------------------------- Summary: Initiallly the system control dict had write precision-6 funkydoCalc was used to calculate snGrad(T) and was compared with results with run time postprocessing calculating the same . Result obtained: snGrad(T) with funkydocalc : absurd value (0) snGrad(T) runtime swak4foam --as expected Reason: the write precision was less which treated low values difference in temperature with wall (my case) close to wall temp and thus gave gradient zero. Solution tried: Increased write precision which worked and gave results as expected. -------------------------------------------------------------------------------------
__________________
Regards Manu |
|
December 16, 2016, 08:01 |
swak4foam for multiregion solver
|
#96 |
Senior Member
Manu Chakkingal
Join Date: Feb 2016
Location: Delft, Netherlands
Posts: 129
Rep Power: 10 |
Hello
I would like to have the temperature gradients (normal using snGrad) at the interface of my solid-fluid region (multiregion solver) I used the following: Code:
NusseltNumber_hot { type patchExpressionDistribution; outputControlMode timeStep; outputInterval 1; writeTimeline true; writeDistribution true; verbose true; region plate; patchNames ( "w_l" ); fieldName dTdx ; expression "10*snGrad(T)/(.08)"; distributionBinWidth 1; distributionMaxBinNr 100; } in my control dict which gives me a mean median etc...what I want is the field values of the gradient at every point at the interface. Code:
patchNames ( "plate_to_air" ); is giving warning Code:
--> FOAM Warning : From function patchExpressionDistributionFunctionObject::getDistribution in file patch/patchExpressionDistributionFunctionObject.C at line 131 No drivers/patches specified Could someone support me for the same
__________________
Regards Manu |
|
December 16, 2016, 18:17 |
|
#97 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
At a first glance I don't see a reason why this shouldn't work with mappedWall-patches. Are you 100% sure that the name is spelled correctly? Are there other warnings? Especially one saying "Patch name XXX is not a valid patch" ?
__________________
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 |
||
December 19, 2016, 05:29 |
|
#98 |
Senior Member
Manu Chakkingal
Join Date: Feb 2016
Location: Delft, Netherlands
Posts: 129
Rep Power: 10 |
Dear Bernard
I used the latest swak4foam version and OF 2.3.0. I checked if it was mispelled Code:
plate_to_air { type mappedWall; inGroups 1(wall); nFaces 143; startFace 77521; sampleMode nearestPatchFace; sampleRegion plate; samplePatch air_to_plate; }
__________________
Regards Manu |
|
February 2, 2017, 07:37 |
Error with swakExpression for mass flow
|
#99 |
New Member
Join Date: Aug 2016
Posts: 4
Rep Power: 10 |
Hello All,
I am stuck with error while calculating the velocity and volume for a case in multiphase flow. I am referring to the guide/ tutorial "swak4Foam -Gentle introduction and new developments" by Bernhard F.W. Gschaider ( dated 11. June 2013) . https://openfoamwiki.net/images/6/6d...ining_OFW8.pdf I have added the required libs in the controlDict file. With swakExpression as follows ------------------------------ 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); } --------------------------------------------- I am trying to run case in parallel (8 cores). There is no error till the last step. But after I assign "mpirun -np 8 interFoam -parallel " it gives following error ----------------------------------------- DICPCG: Solving for pcorr, Initial residual = 1, Final residual = 9.7268393e-06, No Iterations 85 time step continuity errors : sum local = 5.5266133e-09, global = 1.1657858e-09, cumulative = 1.1657858e-09 Courant Number mean: 2.9138586 max: 3.8264724 --> FOAM Warning : From function simpleFunctionObject::simpleFunctionObject in file simpleFunctionObject/simpleFunctionObject.C at line 118 'outputControlMode' not found in total Assuming: timeStep --> FOAM Warning : From function timelineFunctionObject::timelineFunctionObject in file timelineFunctionObject/timelineFunctionObject.C at line 88 No entry 'writeStartTime' in "/home/shridhar/OpenFOAM/shridhar-3.0.x/run/Utilities/flowrate_trial14/system/controlDict.functions.total". Assuming 'no' [2] [2] [2] --> FOAM FATAL IO ERROR: [3] [3] [3] --> FOAM FATAL IO ERROR: [3] keyword expression is undefined in dictionary "IOstream.functions.total" [3] [3] file: IOstream.functions.total from line 0 to line 0. [3] [4] [4] [4] --> FOAM FATAL IO ERROR: [4] keyword expression is undefined in dictionary "IOstream.functions.total" [4] [4] file: IOstream.functions.total from line 0 to line 0. [4] [4] From function dictionary::lookupEntry(const word&, bool, bool) const[5] [5] [5] --> FOAM FATAL IO ERROR: [5] keyword expression is undefined in dictionary "IOstream.functions.total" [5] [5] file: IOstream.functions.total from line 0 to line 0. [5] [5] From function dictionary::lookupEntry(const word&, bool, bool) const [5] in file [6] [6] [6] --> FOAM FATAL IO ERROR: [6] keyword expression is undefined in dictionary "IOstream.functions.total" [6] [6] file: IOstream.functions.total from line 0 to line 0. [6] [6] From function dictionary::lookupEntry(const word&, bool, bool) const [6] in file db/dictionary/dictionary.C at line [7] [7] [7] --> FOAM FATAL IO ERROR: [7] keyword expression is undefined in dictionary "IOstream.functions.total" [7] [7] file: IOstream.functions.total from line 0 to line 0. [7] [7] From function dictionary::lookupEntry(const word&, bool, bool) const [7] in file db/dictionary/dictionary.C at line 442. [0] [0] [0] --> FOAM FATAL IO ERROR: [0] keyword expression is undefined in dictionary "/home/shridhar/OpenFOAM/shridhar-3.0.x/run/Utilities/flowrate_trial14/system/controlDict.functions.total" [0] [0] file: /home/shridhar/OpenFOAM/shridhar-3.0.x/run/Utilities/flowrate_trial14/system/controlDict.functions.total from line 22 to line 30. [0] [0] From function dictionary::lookupEntry(const word&, bool, bool) const [0] in file db/dictionary/dictionary.C at line 442[1] [1] [1] --> FOAM FATAL IO ERROR: [1] keyword expression is undefined in dictionary "IOstream.functions.total" [1] [1] file: IOstream.functions.total from line 0 to line 0. [1] [1] From function dictionary::lookupEntry(const word&, bool, bool) const [1] in file db/dictionary/dictionary.C at line 442. [1] FOAM parallel run exiting [1] . [0] FOAM parallel run exiting [0] [2] keyword expression is undefined in dictionary "IOstream.functions.total" [2] [2] file: IOstream.functions.total from line 0 to line 0. [2] [2] From function dictionary::lookupEntry(const word&, bool, bool) const [2] in file db/dictionary/dictionary.C at line 442. [2] FOAM parallel run exiting [3] From function dictionary::lookupEntry(const word&, bool, bool) const [3] in file db/dictionary/dictionary.C at line 442. [3] FOAM parallel run exiting [3] [4] in file db/dictionary/dictionary.C at line 442. [4] FOAM parallel run exiting [4] db/dictionary/dictionary.C at line 442. [5] FOAM parallel run exiting [5] 442. [6] FOAM parallel run exiting [6] -------------------------------------------------------------------------- MPI_ABORT was invoked on rank 1 in communicator MPI_COMM_WORLD with errorcode 1. NOTE: invoking MPI_ABORT causes Open MPI to kill all MPI processes. You may or may not see output from other processes, depending on exactly when Open MPI kills them. -------------------------------------------------------------------------- [7] FOAM parallel run exiting [7] [2] -------------------------------------------------------------------------- mpirun has exited due to process rank 4 with PID 14679 on node shridhar-Precision-T7600 exiting improperly. There are two reasons this could occur: 1. this process did not call "init" before exiting, but others in the job did. This can cause a job to hang indefinitely while it waits for all processes to call "init". By rule, if one process calls "init", then ALL processes must call "init" prior to termination. 2. this process called "init", but exited without calling "finalize". By rule, all processes that call "init" MUST call "finalize" prior to exiting or it will be considered an "abnormal termination" This may have caused other processes in the application to be terminated by signals sent by mpirun (as reported here). -------------------------------------------------------------------------- [shridhar-Precision-T7600:14674] 7 more processes have sent help message help-mpi-api.txt / mpi-abort [shridhar-Precision-T7600:14674] Set MCA parameter "orte_base_help_aggregate" to 0 to see all help / error messages -------------------------------------------------------------------------------- I am stuck with this for a while and browsed through a lot of discussions on forums. Kindly, help me with this. Regards, Shridhar |
|
February 2, 2017, 08:09 |
|
#100 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Also: which OF version and which swak-version?
__________________
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 |
||
|
|