CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Difference between specified and calculated mass flow rate

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By mm66

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 13, 2020, 17:52
Question Difference between specified and calculated mass flow rate
  #1
Member
 
Join Date: Mar 2019
Posts: 81
Rep Power: 7
mm66 is on a distinguished road
Hi Foamers,

I am facing a problem with icoReactingMultiphaseInterFoam solver. In U boundary condition, I have specified the inlet mass flow rate as:

Code:
Inlet
    {
        type        	flowRateInletVelocity;
        massFlowRate    constant 0.00785;
        value           $internalField;
    }
But the solver returns:

Code:
Expression patchMassFlow on Inlet:  sum=-6.15397e-06
I have the following in controlDict:

Code:
	patchMassFlow
	{
		type			patchExpression;
		accumulations (
			sum
		);
		patches (
			Inlet
			Outlet
		);
		expression		"phi";
		verbose			true;
		outputControlMode	timeStep;
		outputInterval		1;
		writeStartTime		2;
		allowCoupled		true;
	}
Any ideas? Thanks

Regards,
MJ
HHK_1702 likes this.
mm66 is offline   Reply With Quote

Old   April 13, 2020, 17:58
Default
  #2
Member
 
Join Date: Mar 2019
Posts: 81
Rep Power: 7
mm66 is on a distinguished road
Seems that it is being divided by the density (according to the inlet VOF). But why is the mass flow being divided by density?!!
mm66 is offline   Reply With Quote

Old   April 14, 2020, 17:24
Question
  #3
Member
 
Join Date: Mar 2019
Posts: 81
Rep Power: 7
mm66 is on a distinguished road
Quote:
Originally Posted by mm66 View Post
Seems that it is being divided by the density (according to the inlet VOF). But why is the mass flow being divided by density?!!
Anyone please? So confused here

More info for Gas:

Code:
thermoType
{
    type            heRhoThermo;
    mixture         pureMixture;
    transport       const;
    thermo          hConst;
    equationOfState incompressiblePerfectGas;
    specie          specie;
    energy          sensibleEnthalpy;
}
And for Liquid:
Code:
thermoType
{
    type            heRhoThermo;
    mixture         pureMixture;
    transport       const;
    thermo          hConst;
    equationOfState rhoConst;
    specie          specie;
    energy          sensibleEnthalpy;
}
mm66 is offline   Reply With Quote

Old   April 15, 2020, 09:12
Default
  #4
Senior Member
 
Troy Snyder
Join Date: Jul 2009
Location: Akron, OH
Posts: 219
Rep Power: 18
tas38 is on a distinguished road
I believe you need to add the following to the 'flowRateInletVelocity' bc in order for it to be interpreted as mass flow rather than volumetric flow...

Code:
rho  rho;
tas38 is offline   Reply With Quote

Old   April 15, 2020, 09:19
Question
  #5
Member
 
Join Date: Mar 2019
Posts: 81
Rep Power: 7
mm66 is on a distinguished road
Quote:
Originally Posted by tas38 View Post
I believe you need to add the following to the 'flowRateInletVelocity' bc in order for it to be interpreted as mass flow rather than volumetric flow...

Code:
rho  rho;
Dear Troy,

Thanks a lot for your reply. I tried and specified rho as you mentioned but the solver still returns the same value (ignoring rho?). Don't know what is causing this

Regards,
MJ
mm66 is offline   Reply With Quote

Old   April 15, 2020, 09:30
Default
  #6
Senior Member
 
Troy Snyder
Join Date: Jul 2009
Location: Akron, OH
Posts: 219
Rep Power: 18
tas38 is on a distinguished road
I assume that the 'patchMassFlow' value you have quoted corresponds to the converged solution and not some intermediate step?

What results do you get for the inlet mass flowrate using the postprocessing utility? E.g.

Code:
postProcess -func 'flowRatePatch(name=Inlet)'
tas38 is offline   Reply With Quote

Old   April 15, 2020, 09:41
Question
  #7
Member
 
Join Date: Mar 2019
Posts: 81
Rep Power: 7
mm66 is on a distinguished road
Quote:
Originally Posted by tas38 View Post
I assume that the 'patchMassFlow' value you have quoted corresponds to the converged solution and not some intermediate step?

What results do you get for the inlet mass flowrate using the postprocessing utility? E.g.

Code:
postProcess -func 'flowRatePatch(name=Inlet)'
Thanks Troy. Yes, it is for the converged solution. Here is an example:

Code:
ExecutionTime = 5.3 s  ClockTime = 5 s

Expression patchMassFlow on Inlet:  sum=-5.53761e-05
Expression patchMassFlow on Outlet:  sum=5.53761e-05
fieldAverage fieldAverage1 write:
    Calculating averages

Courant Number mean: 0.00156158 max: 1.5566
Interface Courant Number mean: 1.55945e-05 max: 0.991976
Maximum ddtAlpha : 8.60109e-16
Maximum DiffNum : 0
deltaT = 1.63891e-06
Time = 0.00101337
I also tried postProcess as you mentioned, it returns the same value, for example:

Code:
Time = 0.005

Reading fields:
    surfaceScalarField: phi

Executing functionObjects
surfaceFieldValue flowRatePatch(name=Inlet) write:
    sum(Inlet) of phi = -5.53761e-05
mm66 is offline   Reply With Quote

Old   April 15, 2020, 09:46
Default
  #8
Senior Member
 
Peter Hess
Join Date: Apr 2011
Location: Austria
Posts: 250
Rep Power: 17
peterhess is on a distinguished road
See 1.43:

https://k.kakaocdn.net/dn/cjKN6m/btq...&knm=tfile.pdf

Regards

Peter
peterhess is offline   Reply With Quote

Old   April 15, 2020, 10:40
Question
  #9
Member
 
Join Date: Mar 2019
Posts: 81
Rep Power: 7
mm66 is on a distinguished road
Quote:
Originally Posted by peterhess View Post
Hi Peter,

Thanks for your reply. I updated the U boundary condition accordingly:

Code:
Inlet
    {
        type			flowRateInletVelocity;
        massFlowRate		0.00785;
	extrapolateProfile	yes;
	rho			rho;
        rhoInlet		140.14;
        value			uniform (0 0 0); 
    }
Still getting the same value
mm66 is offline   Reply With Quote

Old   April 15, 2020, 10:45
Default
  #10
Senior Member
 
Troy Snyder
Join Date: Jul 2009
Location: Akron, OH
Posts: 219
Rep Power: 18
tas38 is on a distinguished road
What is being set for the phase fraction (alpha) fields at the inlet? Is it single phase or some mixture of liquid and gas?
tas38 is offline   Reply With Quote

Old   April 15, 2020, 10:49
Default
  #11
Member
 
Join Date: Mar 2019
Posts: 81
Rep Power: 7
mm66 is on a distinguished road
Quote:
Originally Posted by tas38 View Post
What is being set for the phase fraction (alpha) fields at the inlet? Is it single phase or some mixture of liquid and gas?
It is 90% gas:

Code:
    Inlet
    {
        type            fixedValue;
        value           uniform 0.9;
    }
or 10% liquid:

Code:
    Inlet
    {
        type            fixedValue;
        value           uniform 0.1;
    }
mm66 is offline   Reply With Quote

Old   April 15, 2020, 11:04
Default
  #12
Senior Member
 
Troy Snyder
Join Date: Jul 2009
Location: Akron, OH
Posts: 219
Rep Power: 18
tas38 is on a distinguished road
It appears that the behavior of the bc does not change from volume flow to mass flow despite the specification of rho and/or rhoInlet. The simplest solution would then be to specify the desired volumetric flow at the inlet. This is easy enough given that you have prescribed alpha.

It remains unclear, however, why the solver does not interaction with the bc in the manner typical of single phase flows. I have used the 'flowRateInletVelocity' bc previously for single phase simulations (simpleFoam and pimpleFoam) and the behavior most certainly changes following specification of rho.
tas38 is offline   Reply With Quote

Old   April 15, 2020, 11:20
Question
  #13
Member
 
Join Date: Mar 2019
Posts: 81
Rep Power: 7
mm66 is on a distinguished road
Quote:
Originally Posted by tas38 View Post
It appears that the behavior of the bc does not change from volume flow to mass flow despite the specification of rho and/or rhoInlet. The simplest solution would then be to specify the desired volumetric flow at the inlet. This is easy enough given that you have prescribed alpha.

It remains unclear, however, why the solver does not interaction with the bc in the manner typical of single phase flows. I have used the 'flowRateInletVelocity' bc previously for single phase simulations (simpleFoam and pimpleFoam) and the behavior most certainly changes following specification of rho.
Yes, exactly. I have also worked with flowRateInletVelocity several times with no problem but this one looks different.

I have just specified the equivalent volumetricFlowRate the result is almost the same

I have also tried the equivalent velocity (fixedValue) for the boundary. Still getting values at the same order of magnitude (i.e. e-5)!!!
mm66 is offline   Reply With Quote

Old   April 18, 2020, 07:49
Default
  #14
Senior Member
 
Join Date: Sep 2013
Posts: 353
Rep Power: 20
Bloerb will become famous soon enough
icoReactingMultiphaseInterFoam is an incompressible solver. Incompressible solvers are internally using a pressure divided by density for numerical efficiency. Hence phi might be u*A not rho*u*A. Please check the unit inside the phi file in one of your results directories. If that is the case "sum phi" will return the volumetric flow rate not the mass flowrate.
Bloerb is offline   Reply With Quote

Old   April 18, 2020, 08:04
Default
  #15
Senior Member
 
Troy Snyder
Join Date: Jul 2009
Location: Akron, OH
Posts: 219
Rep Power: 18
tas38 is on a distinguished road
Quote:
Originally Posted by Bloerb View Post
icoReactingMultiphaseInterFoam is an incompressible solver. Incompressible solvers are internally using a pressure divided by density for numerical efficiency. Hence phi might be u*A not rho*u*A. Please check the unit inside the phi file in one of your results directories. If that is the case "sum phi" will return the volumetric flow rate not the mass flowrate.
While this is true, I think a bigger issue that the thread originator is having relates to the inlet boundary conditions. Changing the nature of the boundary condition to/from volumetric flowrate, mass flowrate, or prescribed velocity does not seem to illicit the desired response in the simulation. This issue seems to be related to the multiphase solver employed as both myself and the thread originator have successfully applied such inlet bcs for single phase simulations (simpleFoam, pimpleFoam, etc.).
tas38 is offline   Reply With Quote

Old   April 18, 2020, 12:38
Default
  #16
Senior Member
 
Join Date: Sep 2013
Posts: 353
Rep Power: 20
Bloerb will become famous soon enough
i have looked it up. The solver uses two fields, phi, volumetric flux, and rhoPhi mass flux. Hence my assumption is correct that you calculated it wrong with your function object.



the inflow boundary condition does the following to calculate the patch value:
Code:
const scalar avgU = -flowRate_->value(t)/gSum(rho*patch().magSf());
operator==(avgU*n);
  • minus for inlow (negativ n direction is inside)
  • flowRate_->value(t) is the function1 value (value at the current time) of the volumetric flowrate or massflowrate (you can prescribe it as a function or table etc, in your case constant)
  • gSum(rho*patch().magSf()) means sum up all faces density*area values

if a volumetric flow rate is prescribed rho=1 else
Code:
                patch().lookupPatchField<volScalarField, scalar>(rhoName_);            const fvPatchField<scalar>& rhop =
the density name of the solver is rho and rhoName defaults to that, hence i do not see an issue with the boundary condition. You might have to check the rho file. Since it is created by default, it might not list the correct density corresponding to the alpha field at the boundary.


You should however note that is prescribes exactly one value for the entire patch, not a profile and it does not adress the phase distribution.
Bloerb is offline   Reply With Quote

Old   April 18, 2020, 19:46
Question
  #17
Member
 
Join Date: Mar 2019
Posts: 81
Rep Power: 7
mm66 is on a distinguished road
Quote:
Originally Posted by Bloerb View Post
i have looked it up. The solver uses two fields, phi, volumetric flux, and rhoPhi mass flux. Hence my assumption is correct that you calculated it wrong with your function object.



the inflow boundary condition does the following to calculate the patch value:
Code:
const scalar avgU = -flowRate_->value(t)/gSum(rho*patch().magSf());
operator==(avgU*n);
  • minus for inlow (negativ n direction is inside)
  • flowRate_->value(t) is the function1 value (value at the current time) of the volumetric flowrate or massflowrate (you can prescribe it as a function or table etc, in your case constant)
  • gSum(rho*patch().magSf()) means sum up all faces density*area values

if a volumetric flow rate is prescribed rho=1 else
Code:
                patch().lookupPatchField<volScalarField, scalar>(rhoName_);            const fvPatchField<scalar>& rhop =
the density name of the solver is rho and rhoName defaults to that, hence i do not see an issue with the boundary condition. You might have to check the rho file. Since it is created by default, it might not list the correct density corresponding to the alpha field at the boundary.


You should however note that is prescribes exactly one value for the entire patch, not a profile and it does not adress the phase distribution.
Dear Bloerb and Troy,

Thanks a lot for your time and help.
The strange thing is that regardless of the assigned value for the mass flow rate the solver returns the same patch mass flow rate value...

Bloerb, what "rho file" are you referring to?

Last edited by mm66; April 18, 2020 at 21:14.
mm66 is offline   Reply With Quote

Reply

Tags
flowrateinletvelocity, mass flow rate, mass flow rate bc, openfoamv1812


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 06:50.