CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > 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 Tree21Likes

Reply
 
LinkBack Thread Tools Display Modes
Old   September 1, 2013, 14:10
Default
  #81
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 9,931
Blog Entries: 39
Rep Power: 108
wyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of light
About this discussion from back in April:
Quote:
Originally Posted by gschaider View Post
As I said above: there's a bit of ballast involved with having functionObjects.

Thing is that EFFO preloads certain fields for functionObjects that need them. The problem with using swak-functionObjects is the same: they assume that fields are already in memory (but that is a solvable problem)
Quote:
Originally Posted by wyldckat View Post
And as I said (er, wrote), I'm interested in doing #3 myself... a funkyDoFunctionObjects seems to be a very interesting topic I'll try to look into it in my next vacation...
I've finally done it today: http://www.cfd-online.com/Forums/ope...s-utility.html
Thing is that it was embarrassingly simple to do... because I only had to remove excess code from execFlowFunctionObjects.

Best regards,
Bruno
immortality likes this.
__________________
wyldckat is offline   Reply With Quote

Old   May 13, 2014, 04:37
Default
  #82
Member
 
adarsh tiwari's Avatar
 
adarsh tiwari
Join Date: Feb 2014
Location: Bangalore
Posts: 42
Blog Entries: 5
Rep Power: 5
adarsh tiwari is on a distinguished road
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
Also, one more thing I would like to ask, I read so many threads dedicated to mass flow one i found interesting which says simply by using
Code:
patchIntegrate phi <patch name>
will give the mass flow rate, but as per my observations it is giving the integrated values

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
adarsh tiwari is offline   Reply With Quote

Old   November 25, 2014, 14:16
Default
  #83
New Member
 
Lourenšo SM
Join Date: Jul 2014
Location: Lisboa, Portugal
Posts: 25
Rep Power: 4
lourencosm is on a distinguished road
Hello Adarsh,

have you tried "patchAverage"?
lourencosm is offline   Reply With Quote

Old   August 15, 2016, 11:05
Default
  #84
Senior Member
 
Manu Chakkingal
Join Date: Feb 2016
Location: Delft, Netherlands
Posts: 105
Rep Power: 3
manuc is on a distinguished road
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
manuc is offline   Reply With Quote

Old   August 17, 2016, 12:01
Default
  #85
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,997
Rep Power: 42
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by manuc View Post
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
Hmm. Looks like a problem in the code. I'll have a look. What MIGHT help is using a variable "snGradT=(T-internalField())/mag(delta())" as a variable. Emphasis on MIGHT as I haven't tried it and even then the sign might be wrong
__________________
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
gschaider is offline   Reply With Quote

Old   August 17, 2016, 12:20
Default
  #86
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,997
Rep Power: 42
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by gschaider View Post
Hmm. Looks like a problem in the code. I'll have a look. What MIGHT help is using a variable "snGradT=(T-internalField())/mag(delta())" as a variable. Emphasis on MIGHT as I haven't tried it and even then the sign might be wrong
Should be "(T-internalField(T))/mag(delta())".

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
gschaider is offline   Reply With Quote

Old   August 17, 2016, 12:26
Default
  #87
Senior Member
 
Manu Chakkingal
Join Date: Feb 2016
Location: Delft, Netherlands
Posts: 105
Rep Power: 3
manuc is on a distinguished road
Hello

I used the latest swak4foam version and OF 2.3.0. W_l has a B.C of constant wall temp.
__________________
Regards
Manu
manuc is offline   Reply With Quote

Old   August 18, 2016, 05:36
Default
  #88
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,997
Rep Power: 42
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by manuc View Post
Hello

I used the latest swak4foam version and OF 2.3.0. W_l has a B.C of constant wall temp.
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
gschaider is offline   Reply With Quote

Old   August 18, 2016, 05:38
Default
  #89
Senior Member
 
Manu Chakkingal
Join Date: Feb 2016
Location: Delft, Netherlands
Posts: 105
Rep Power: 3
manuc is on a distinguished road
Hello Bernhard

w_l
{
type fixedValue;
value uniform 300.2;
}



I have set it fixed value
__________________
Regards
Manu
manuc is offline   Reply With Quote

Old   August 18, 2016, 11:21
Default
  #90
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,997
Rep Power: 42
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by manuc View Post
Hello Bernhard

w_l
{
type fixedValue;
value uniform 300.2;
}



I have set it fixed value
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
gschaider is offline   Reply With Quote

Old   August 18, 2016, 11:38
Default
  #91
Senior Member
 
Manu Chakkingal
Join Date: Feb 2016
Location: Delft, Netherlands
Posts: 105
Rep Power: 3
manuc is on a distinguished road
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
manuc is offline   Reply With Quote

Old   August 18, 2016, 12:08
Default
  #92
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,997
Rep Power: 42
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by manuc View Post
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
);
}



// ************************************************** *********************** //
The message in bold is only relevant if you had a mcase with two meshes (for instance a cht-case).

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
gschaider is offline   Reply With Quote

Old   August 19, 2016, 04:13
Default
  #93
Senior Member
 
Manu Chakkingal
Join Date: Feb 2016
Location: Delft, Netherlands
Posts: 105
Rep Power: 3
manuc is on a distinguished road
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
manuc is offline   Reply With Quote

Old   August 19, 2016, 06:18
Default
  #94
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,997
Rep Power: 42
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by manuc View Post
Dear Berhard,

I got the below:

Code:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
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
OK. At first I was a bit amazed by the small range of the temperature in your simulation (0.2 degrees). But I guess that is OK. And probably your problem. My guess is that the cells near your boundary are VERY similar to the boundary temperature. Something like 300.2001 . As long as this happens in memory everything is OK. But when it gets written to disk the writePrecision kicks in. This is usually 6 digits. So the value becomes 300.2 and that is all that funkyDoCalc gets to see. And it says: "same as on boundary. snGrad is 0"

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
gschaider is offline   Reply With Quote

Old   August 19, 2016, 08:14
Default
  #95
Senior Member
 
Manu Chakkingal
Join Date: Feb 2016
Location: Delft, Netherlands
Posts: 105
Rep Power: 3
manuc is on a distinguished road
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
manuc is offline   Reply With Quote

Old   December 16, 2016, 08:01
Default swak4foam for multiregion solver
  #96
Senior Member
 
Manu Chakkingal
Join Date: Feb 2016
Location: Delft, Netherlands
Posts: 105
Rep Power: 3
manuc is on a distinguished road
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; 
   }
(works for the wall patch but not the mappedwall at the interface...see below)
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"
                       );
where plate_to_air is the name of the mappedwall of the interface
is giving warning
Code:
--> FOAM Warning : 
    From function patchExpressionDistributionFunctionObject::getDistribution
    in file patch/patchExpressionDistributionFunctionObject.C at line 131
    No drivers/patches specified
and creating an empty folder corresponding to it.

Could someone support me for the same
__________________
Regards
Manu
manuc is offline   Reply With Quote

Old   December 16, 2016, 18:17
Default
  #97
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,997
Rep Power: 42
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by manuc View Post
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; 
   }
(works for the wall patch but not the mappedwall at the interface...see below)
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"
                       );
where plate_to_air is the name of the mappedwall of the interface
is giving warning
Code:
--> FOAM Warning : 
    From function patchExpressionDistributionFunctionObject::getDistribution
    in file patch/patchExpressionDistributionFunctionObject.C at line 131
    No drivers/patches specified
and creating an empty folder corresponding to it.

Could someone support me for the same
At first: in such cases it is most helpful if you state which OF-version and which swak-version you use.

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
gschaider is offline   Reply With Quote

Old   December 19, 2016, 05:29
Default
  #98
Senior Member
 
Manu Chakkingal
Join Date: Feb 2016
Location: Delft, Netherlands
Posts: 105
Rep Power: 3
manuc is on a distinguished road
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;
}
I think the naming is fine
__________________
Regards
Manu
manuc is offline   Reply With Quote

Old   February 2, 2017, 07:37
Default Error with swakExpression for mass flow
  #99
New Member
 
Join Date: Aug 2016
Posts: 4
Rep Power: 2
shri@ is on a distinguished road
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
shri@ is offline   Reply With Quote

Old   February 2, 2017, 08:09
Default
  #100
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,997
Rep Power: 42
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by shri@ View Post
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]
<snip>

[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
That is strange. What I don't understand: the problem you're having is after the last timestep or at the end of your parallel simulation.

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
gschaider is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 11:03.