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

Converting mass flow rate to mass

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 14, 2016, 13:40
Default Converting mass flow rate to mass
  #1
Member
 
Sandra
Join Date: Oct 2014
Posts: 58
Rep Power: 11
sabago is on a distinguished road
Dear OFers.

I have a mass flowrate BC but I need the mass in the simulation.
So, I have

Code:
O2 = O2fr*runTime.deltaTValue;
where O2 is the mass and O2fr is the mass flow rate set as a volScalarField but I get the following error and I'm stuck

Code:
V=In file included from osofcFoam2.C:91:0:
O2c.H:3:19: note:   cannot convert ‘O2fr’ (type ‘Foam::volScalarField {aka Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>}’) to type ‘const Foam::dimensioned<double>&’
 O2 = O2fr*runTime.deltaTValue;
                   ^
make: *** [Make/linux64GccDPOpt/osofcFoam2.o] Error 1
Best,
Sandra
sabago is offline   Reply With Quote

Old   July 14, 2016, 14:28
Default
  #2
Member
 
Sandra
Join Date: Oct 2014
Posts: 58
Rep Power: 11
sabago is on a distinguished road
Fixed; it was a silly error.
Was missing the () at the end.

Anyway, I'm now getting this error. I'm using OF2.3.0 on ubuntu 14.04
Code:
--> FOAM FATAL IO ERROR: 
Unknown patchField type flowRateInletVelocity for patch type patch

Valid patchField types are :

66
(
advective
calculated
codedFixedValue
codedMixed
cyclic
cyclicACMI
cyclicAMI
cyclicSlip
directionMixed
empty
externalCoupled
fan
fanPressure
fixedFluxPressure
fixedGradient
fixedInternalValue
fixedJump
fixedJumpAMI
fixedMean
fixedPressureCompressibleDensity
fixedValue
freestream
freestreamPressure
groovyBC
groovyBCDirection
groovyBCFixedValue
groovyBCJump
inletOutlet
inletOutletTotalTemperature
mapped
mappedField
mappedFixedInternalValue
mappedFixedPushedInternalValue
mixed
nonuniformTransformCyclic
oscillatingFixedValue
outletInlet
outletMappedUniformInlet
partialSlip
phaseHydrostaticPressure
prghPressure
processor
processorCyclic
rotatingTotalPressure
sliced
slip
symmetry
symmetryPlane
syringePressure
timeVaryingMappedFixedValue
totalPressure
totalTemperature
turbulentInlet
turbulentIntensityKineticEnergyInlet
uniformDensityHydrostaticPressure
uniformFixedGradient
uniformFixedValue
uniformInletOutlet
uniformJump
uniformJumpAMI
uniformTotalPressure
variableHeightFlowRate
waveSurfacePressure
waveTransmissive
wedge
zeroGradient
)


file: /home/sandra/OpenFOAM/sandra-2.3.0/OCVSOFC2/0/O2fr.boundaryField.cathode_inlet from line 26 to line 28.

    From function fvPatchField<Type>::New(const fvPatch&, const DimensionedField<Type, volMesh>&, const dictionary&)
    in file /home/sandra/OpenFOAM/OpenFOAM-2.3.0/src/finiteVolume/lnInclude/fvPatchFieldNew.C at line 143.

FOAM exiting
sabago is offline   Reply With Quote

Old   July 15, 2016, 05:38
Default
  #3
New Member
 
Join Date: Feb 2014
Posts: 17
Rep Power: 12
ChGr is on a distinguished road
Hey Sandra,

it looks like you forgot to include the lib in the controlDict that contains your bc...
ChGr is offline   Reply With Quote

Old   July 15, 2016, 09:20
Default
  #4
Member
 
Sandra
Join Date: Oct 2014
Posts: 58
Rep Power: 11
sabago is on a distinguished road
Hello again,

I assumed that might be the problem but I don't know which library contains that BC. could you please enlighten me.

Sandra
sabago is offline   Reply With Quote

Old   July 15, 2016, 10:06
Default
  #5
New Member
 
Join Date: Feb 2014
Posts: 17
Rep Power: 12
ChGr is on a distinguished road
Hey,

the bottom line of your make-file should look similar to

Code:
LIB = $(FOAM_USER_LIBBIN)/libmyIncompressibleRASModels
or so.

This library has to be included in the controlDict with

Code:
libs
(
    "libmyIncompressibleRASModels.so"
)
ChGr is offline   Reply With Quote

Old   July 19, 2016, 12:23
Default
  #6
Member
 
Sandra
Join Date: Oct 2014
Posts: 58
Rep Power: 11
sabago is on a distinguished road
Hello again

I added "libmyIncompressibleRASModels.so" to my controlDict

and
EXE_INC = \
-I$(LIB_SRC)/turbulenceModels/incompressible/RAS/lnInclude
EXE_LIBS = \
-lincompressibleRASModels

to my Make/options

but I still get the same error.

Sandra
sabago is offline   Reply With Quote

Old   July 20, 2016, 13:02
Default
  #7
Senior Member
 
Mahdi Hosseinali
Join Date: Apr 2009
Location: NB, Canada
Posts: 273
Rep Power: 18
anishtain4 is on a distinguished road
What is in your Make/file?
anishtain4 is offline   Reply With Quote

Old   July 20, 2016, 13:58
Default
  #8
Member
 
Sandra
Join Date: Oct 2014
Posts: 58
Rep Power: 11
sabago is on a distinguished road
Here are my make stuff

Make/files

Code:
osofcFoam2.C

EXE = $(FOAM_USER_APPBIN)/osofcFoam2
I also tried..
Code:
osofcFoam2.C

EXE = $(FOAM_USER_LIBBIN)/osofcFoam2
Make/options

Code:
EXE_INC = \
    -I$(LIB_SRC)/finiteVolume/lnInclude \
    -I$(LIB_SRC)/sampling/lnInclude \
    -I$(LIB_SRC)/lagrangian/basic/lnInclude \
    -I$(LIB_SRC)/meshTools/lnInclude \
    -I$(LIB_SRC)/fileFormats/lnInclude\
    -I$(FOAM_USER_LIBBIN)\
    -I$(LIB_SRC)/turbulenceModels/incompressible/RAS/lnInclude

EXE_LIBS = \
    -lfiniteVolume \
    -lsampling\
    -lfluidThermophysicalModels \
    -lspecie \
    -lcompressibleTurbulenceModel \
    -lcompressibleRASModels \
    -lcompressibleLESModels \
    -lfiniteVolume \
    -lmeshTools \
    -lsampling \
    -lfvOptions\
    -lincompressibleRASModels
sabago is offline   Reply With Quote

Old   July 20, 2016, 15:16
Default
  #9
New Member
 
Join Date: Feb 2014
Posts: 17
Rep Power: 12
ChGr is on a distinguished road
Hey Sandra,

"libmyIncompressibleRASModels" was only a dummy. Your case should work with:

Code:
osofcFoam2.C

EXE = $(FOAM_USER_LIBBIN)/osofcFoam2
The lib that has to be included in your controlDict is

Code:
libs
(
    "libosofcFoam2.so"
)
Does this work?
ChGr is offline   Reply With Quote

Old   July 20, 2016, 16:00
Default
  #10
Member
 
Sandra
Join Date: Oct 2014
Posts: 58
Rep Power: 11
sabago is on a distinguished road
Thanks ChGr
At the end of my controlDict

Code:
libs ( "libOpenFOAM.so" "libgroovyBC.so" "libLEMOS-2.3.0.so" "libosofcFoam2.so" "libIncompressibleRASModels.so")
and changed my make/files to

Code:
osofcFoam2.C

EXE = $(FOAM_USER_LIBBIN)/osofcFoam2
And when I wmake, it says the solver is up to date but same error as before.

Sandra
sabago is offline   Reply With Quote

Reply


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
trying to perform accurate mass flow rate sampling through hot-film probe UTA_ARC ANSYS 0 December 2, 2015 13:20
Calculating mass flow rate at multiphase flows Kuslo187 OpenFOAM Post-Processing 1 August 21, 2015 18:11
mass flow rate in DPM steady tracking Roule FLUENT 4 June 1, 2015 10:44
Mass flow rate sepidecent CFX 0 August 9, 2011 00:15
mass flow rate error Masood FLUENT 0 May 22, 2005 00:32


All times are GMT -4. The time now is 01:21.