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

Calculating liquid volume in interFoam

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By clapointe
  • 1 Post By clapointe

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 22, 2020, 14:47
Default Calculating liquid volume in interFoam
  #1
Senior Member
 
Josh McCraney
Join Date: Jun 2018
Posts: 220
Rep Power: 8
joshmccraney is on a distinguished road
Hi FOAMers!

A tank partially filled with liquid has a hole at the bottom where liquid drains. In searching for how to do this, I found this thread. Specifically, post #13, which states to post this code

Code:
dimensionedScalar totalLiquidVolume = sum(mesh.V()*gamma);

Info << "Total Liquid Volume, Value: "
<< totalLiquidVolume.value() << ", Dimensions = " << totalLiquidVolume.dimensions() << endl;
into your main solver before

runTime.write();

and recompile your solver. The post also says to check it first on a single processor because you might need to change sum() with gSum().


Before I ask if this works, I don't know how to recompile my solver. Is it as simple as backing up a few folders to /applications and then executing ./Allwmake ?
joshmccraney is offline   Reply With Quote

Old   March 22, 2020, 18:08
Default
  #2
Senior Member
 
Join Date: Aug 2015
Posts: 494
Rep Power: 14
clapointe is on a distinguished road
You can recompile interFoam by running "wclean" then "wmake" in the folder after editing. As for the code, alpha is used now (instead of gamma) in the VoF solvers. gSum is likely the safer option as it should work for single and multiple processor cases.

Caelan
clapointe is offline   Reply With Quote

Old   March 23, 2020, 13:05
Default
  #3
Senior Member
 
Josh McCraney
Join Date: Jun 2018
Posts: 220
Rep Power: 8
joshmccraney is on a distinguished road
Quote:
Originally Posted by clapointe View Post
You can recompile interFoam by running "wclean" then "wmake" in the folder after editing. As for the code, alpha is used now (instead of gamma) in the VoF solvers. gSum is likely the safer option as it should work for single and multiple processor cases.

Caelan
I tried "wclean" and I get the error "Command 'wclean' not found". Files in this directory are
Code:
alphaSuSp.H  correctPhi.H  createFields.H  initCorrectPhi.H  interFoam.C  interMixingFoam  Make  pEqn.H  rhofs.H  UEqn.H
where I am editing interFoam.C. The directory location is /opt/openfoam6/applications/solvers/multiphase if that's helpful.

Any idea how to proceed?
joshmccraney is offline   Reply With Quote

Old   March 23, 2020, 13:08
Default
  #4
Senior Member
 
Join Date: Aug 2015
Posts: 494
Rep Power: 14
clapointe is on a distinguished road
If "wclean" is not found, that suggests you have not sourced OpenFOAM correctly.

Caelan
clapointe is offline   Reply With Quote

Old   March 23, 2020, 13:17
Default
  #5
Senior Member
 
Josh McCraney
Join Date: Jun 2018
Posts: 220
Rep Power: 8
joshmccraney is on a distinguished road
Quote:
Originally Posted by clapointe View Post
If "wclean" is not found, that suggests you have not sourced OpenFOAM correctly.

Caelan
Are you sure? I can run tutorials, my own simulations, can import meshes from 3rd party meshes, and run swak4foam.

Is there a way to check that it's sourced correctly?

How can I fix this issue?

EDIT: so i was running as root, because without root "wclean" runs fine (I think, as there are no outputs in the terminal) but when I run "wmake" I get the following error:

Code:
mkdir: cannot create directory ‘/opt/openfoam6/platforms/linux64GccDPInt32Opt/applications’: Permission denied
/bin/sh: 1: cannot create /opt/openfoam6/platforms/linux64GccDPInt32Opt/applications/solvers/multiphase/interFoam/options: Directory nonexistent
make: *** No rule to make target '/opt/openfoam6/platforms/linux64GccDPInt32Opt/applications/solvers/multiphase/interFoam/options'.  Stop.
/bin/sh: 1: cannot create /opt/openfoam6/platforms/linux64GccDPInt32Opt/applications/solvers/multiphase/interFoam/options: Directory nonexistent
make: *** No rule to make target '/opt/openfoam6/platforms/linux64GccDPInt32Opt/applications/solvers/multiphase/interFoam/options', needed by 'all'.  Stop.
wmake error: file '/opt/openfoam6/platforms/linux64GccDPInt32Opt/applications/solvers/multiphase/interFoam/sourceFiles' could not be created in /opt/openfoam6/applications/solvers/multiphase/interFoam
joshmccraney is offline   Reply With Quote

Old   March 23, 2020, 13:35
Default
  #6
Senior Member
 
Join Date: Aug 2015
Posts: 494
Rep Power: 14
clapointe is on a distinguished road
I've never installed openfoam in /opt and not sure how that impacts everything (and also not sure which flavor of openfoam you're using nor how you installed it) but not recognizing a compilation command is fishy. Since you're having trouble with that why not just post process with e.g. paraview to compute the quantity you're after? You would just need to find a way (e.g. with a function object) to write cell volumes in a way paraview could read them.

Caelan
clapointe is offline   Reply With Quote

Old   March 23, 2020, 13:44
Default
  #7
Senior Member
 
Josh McCraney
Join Date: Jun 2018
Posts: 220
Rep Power: 8
joshmccraney is on a distinguished road
Quote:
Originally Posted by clapointe View Post
I've never installed openfoam in /opt and not sure how that impacts everything (and also not sure which flavor of openfoam you're using nor how you installed it) but not recognizing a compilation command is fishy. Since you're having trouble with that why not just post process with e.g. paraview to compute the quantity you're after? You would just need to find a way (e.g. with a function object) to write cell volumes in a way paraview could read them.

Caelan
I appreciate your help! I think I need to address this issue though. But again, thank you very much!
joshmccraney is offline   Reply With Quote

Old   March 24, 2020, 11:09
Default
  #8
Senior Member
 
Josh McCraney
Join Date: Jun 2018
Posts: 220
Rep Power: 8
joshmccraney is on a distinguished road
Hi Caelan

Someone was able to help we run the wmake command. However, when I run it I get the error

Code:
Making dependency list for source file interFoam.C
g++ -std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3  -DNoRepository -ftemplate-depth-100 -I../VoF -I/opt/openfoam6/src/transportModels/twoPhaseMixture/lnInclude -I/opt/openfoam6/src/transportModels -I/opt/openfoam6/src/transportModels/incompressible/lnInclude -I/opt/openfoam6/src/transportModels/interfaceProperties/lnInclude -I/opt/openfoam6/src/TurbulenceModels/turbulenceModels/lnInclude -I/opt/openfoam6/src/TurbulenceModels/incompressible/lnInclude -I/opt/openfoam6/src/transportModels/immiscibleIncompressibleTwoPhaseMixture/lnInclude -I/opt/openfoam6/src/finiteVolume/lnInclude -I/opt/openfoam6/src/dynamicFvMesh/lnInclude -I/opt/openfoam6/src/meshTools/lnInclude -I/opt/openfoam6/src/sampling/lnInclude -IlnInclude -I. -I/opt/openfoam6/src/OpenFOAM/lnInclude -I/opt/openfoam6/src/OSspecific/POSIX/lnInclude   -fPIC -c interFoam.C -o /opt/openfoam6/platforms/linux64GccDPInt32Opt/applications/solvers/multiphase/interFoam/interFoam.o
interFoam.C: In function ‘int main(int, char**)’:
interFoam.C:157:54: error: ‘alpha’ was not declared in this scope
  dimensionedScalar totalLiquidVolume = gsum(mesh.V()*alpha);
                                                      ^~~~~
interFoam.C:157:54: note: suggested alternative:
In file included from /opt/openfoam6/src/OpenFOAM/lnInclude/constants.H:46:0,
                 from /opt/openfoam6/src/finiteVolume/lnInclude/fvCFD.H:23,
                 from interFoam.C:35:
/opt/openfoam6/src/OpenFOAM/lnInclude/atomicConstants.H:52:36: note:   ‘Foam::constant::atomic::alpha’
     extern const dimensionedScalar alpha;
                                    ^~~~~
interFoam.C:157:40: error: ‘gsum’ was not declared in this scope
  dimensionedScalar totalLiquidVolume = gsum(mesh.V()*alpha);
                                        ^~~~
interFoam.C:157:40: note: suggested alternative: ‘enum’
  dimensionedScalar totalLiquidVolume = gsum(mesh.V()*alpha);
                                        ^~~~
                                        enum
/opt/openfoam6/wmake/rules/General/transform:25: recipe for target '/opt/openfoam6/platforms/linux64GccDPInt32Opt/applications/solvers/multiphase/interFoam/interFoam.o' failed
make: *** [/opt/openfoam6/platforms/linux64GccDPInt32Opt/applications/solvers/multiphase/interFoam/interFoam.o] Error 1
The lines I added to interFoam.C are

Code:
	dimensionedScalar totalLiquidVolume = gsum(mesh.V()*alpha);
	Info << "Total Liquid Volume, Value: "<< totalLiquidVolume.value() << ", Dimensions = " << totalLiquidVolume.dimensions() << endl;
While you can't see color here, the terminal colors "alpha" in red. This and the fact that "'alpha' was not declared in this scope" makes me think there is something else I need to do. Do you have any insight here?
joshmccraney is offline   Reply With Quote

Old   March 24, 2020, 11:19
Default
  #9
Senior Member
 
Join Date: Aug 2015
Posts: 494
Rep Power: 14
clapointe is on a distinguished road
Newer openfoam versions use alpha to represent volume fraction; older ones may have used gamma. I do not know what version of openfoam you are using, but you can check your source code (probably createFields) to see. As for the second error, it is gSum (not gsum).

Caelan
joshmccraney likes this.
clapointe is offline   Reply With Quote

Old   March 24, 2020, 11:32
Default
  #10
Senior Member
 
Josh McCraney
Join Date: Jun 2018
Posts: 220
Rep Power: 8
joshmccraney is on a distinguished road
Quote:
Originally Posted by clapointe View Post
Newer openfoam versions use alpha to represent volume fraction; older ones may have used gamma. I do not know what version of openfoam you are using, but you can check your source code (probably createFields) to see. As for the second error, it is gSum (not gsum).

Caelan
Thanks! I'm using OpenFOAM 6. I definitely use alpha, so I'm not sure why the error regarding alpha is here. When I check creatFields.H, there are variables "alpha1" and "alpha2". Should I be using one of these instead of just "alpha"?
joshmccraney is offline   Reply With Quote

Old   March 24, 2020, 11:50
Default
  #11
Senior Member
 
Join Date: Aug 2015
Posts: 494
Rep Power: 14
clapointe is on a distinguished road
In that case try alpha1 -- it will either be what you're looking for, or the volume of "not" fluid (and you'll thus want alpha2).

Caelan
clapointe is offline   Reply With Quote

Old   March 24, 2020, 11:51
Default
  #12
Senior Member
 
Josh McCraney
Join Date: Jun 2018
Posts: 220
Rep Power: 8
joshmccraney is on a distinguished road
Quote:
Originally Posted by clapointe View Post
In that case try alpha1 -- it will either be what you're looking for, or the volume of "not" fluid (and you'll thus want alpha2).

Caelan
I have liquid and air: are you saying alpha1 is the liquid, and alpha2 is the air? If so, not that I doubt you, but how can I tell which is which?
joshmccraney is offline   Reply With Quote

Old   March 24, 2020, 11:56
Default
  #13
Senior Member
 
Join Date: Aug 2015
Posts: 494
Rep Power: 14
clapointe is on a distinguished road
I don't know how you set up your simulation, so I can't tell you. But if you compare your computed liquid volume to what you set for the simulation (e.g. initially, with setFields) you should be able to figure it out.

Caelan
joshmccraney likes this.
clapointe is offline   Reply With Quote

Old   March 24, 2020, 12:26
Default
  #14
Senior Member
 
Josh McCraney
Join Date: Jun 2018
Posts: 220
Rep Power: 8
joshmccraney is on a distinguished road
I changed alpha to alpha1 but now I get the error

Code:
interFoam.C:157:60: error: no matching function for call to ‘gSum(Foam::tmp<Foam::DimensionedField<double, Foam::volMesh> >)’
  dimensionedScalar totalLiquidVolume = gSum(mesh.V()*alpha1);
where "interFoam.C:157:60" is the first line I added:

Code:
	dimensionedScalar totalLiquidVolume = gSum(mesh.V()*alpha1);
specifically the last parenthesis. The entire terminal output from wmake is below. Any idea how to proceed?

Code:
Making dependency list for source file interFoam.C
g++ -std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3  -DNoRepository -ftemplate-depth-100 -I../VoF -I/opt/openfoam6/src/transportModels/twoPhaseMixture/lnInclude -I/opt/openfoam6/src/transportModels -I/opt/openfoam6/src/transportModels/incompressible/lnInclude -I/opt/openfoam6/src/transportModels/interfaceProperties/lnInclude -I/opt/openfoam6/src/TurbulenceModels/turbulenceModels/lnInclude -I/opt/openfoam6/src/TurbulenceModels/incompressible/lnInclude -I/opt/openfoam6/src/transportModels/immiscibleIncompressibleTwoPhaseMixture/lnInclude -I/opt/openfoam6/src/finiteVolume/lnInclude -I/opt/openfoam6/src/dynamicFvMesh/lnInclude -I/opt/openfoam6/src/meshTools/lnInclude -I/opt/openfoam6/src/sampling/lnInclude -IlnInclude -I. -I/opt/openfoam6/src/OpenFOAM/lnInclude -I/opt/openfoam6/src/OSspecific/POSIX/lnInclude   -fPIC -c interFoam.C -o /opt/openfoam6/platforms/linux64GccDPInt32Opt/applications/solvers/multiphase/interFoam/interFoam.o
interFoam.C: In function ‘int main(int, char**)’:
interFoam.C:157:60: error: no matching function for call to ‘gSum(Foam::tmp<Foam::DimensionedField<double, Foam::volMesh> >)’
  dimensionedScalar totalLiquidVolume = gSum(mesh.V()*alpha1);
                                                            ^
In file included from /opt/openfoam6/src/OpenFOAM/lnInclude/Field.C:877:0,
                 from /opt/openfoam6/src/OpenFOAM/lnInclude/Field.H:408,
                 from /opt/openfoam6/src/OpenFOAM/lnInclude/scalarField.H:38,
                 from /opt/openfoam6/src/OpenFOAM/lnInclude/dimensionSet.H:46,
                 from /opt/openfoam6/src/OpenFOAM/lnInclude/dimensionedType.H:40,
                 from /opt/openfoam6/src/OpenFOAM/lnInclude/dimensionedScalar.H:38,
                 from /opt/openfoam6/src/OpenFOAM/lnInclude/TimeState.H:38,
                 from /opt/openfoam6/src/OpenFOAM/lnInclude/Time.H:47,
                 from /opt/openfoam6/src/finiteVolume/lnInclude/fvCFD.H:6,
                 from interFoam.C:35:
/opt/openfoam6/src/OpenFOAM/lnInclude/FieldFunctions.C:543:24: note: candidate: template<class Type> Type Foam::gSum(const Foam::UList<T>&, Foam::label)
 G_UNARY_FUNCTION(Type, gSum, sum, sum)
                        ^
/opt/openfoam6/src/OpenFOAM/lnInclude/FieldFunctions.C:533:12: note: in definition of macro ‘G_UNARY_FUNCTION’
 ReturnType gFunc(const UList<Type>& f, const label comm)                       \
            ^~~~~
/opt/openfoam6/src/OpenFOAM/lnInclude/FieldFunctions.C:543:24: note:   template argument deduction/substitution failed:
 G_UNARY_FUNCTION(Type, gSum, sum, sum)
                        ^
/opt/openfoam6/src/OpenFOAM/lnInclude/FieldFunctions.C:533:12: note: in definition of macro ‘G_UNARY_FUNCTION’
 ReturnType gFunc(const UList<Type>& f, const label comm)                       \
            ^~~~~
interFoam.C:157:60: note:   ‘Foam::tmp<Foam::DimensionedField<double, Foam::volMesh> >’ is not derived from ‘const Foam::UList<T>’
  dimensionedScalar totalLiquidVolume = gSum(mesh.V()*alpha1);
                                                            ^
In file included from /opt/openfoam6/src/OpenFOAM/lnInclude/Field.C:877:0,
                 from /opt/openfoam6/src/OpenFOAM/lnInclude/Field.H:408,
                 from /opt/openfoam6/src/OpenFOAM/lnInclude/scalarField.H:38,
                 from /opt/openfoam6/src/OpenFOAM/lnInclude/dimensionSet.H:46,
                 from /opt/openfoam6/src/OpenFOAM/lnInclude/dimensionedType.H:40,
                 from /opt/openfoam6/src/OpenFOAM/lnInclude/dimensionedScalar.H:38,
                 from /opt/openfoam6/src/OpenFOAM/lnInclude/TimeState.H:38,
                 from /opt/openfoam6/src/OpenFOAM/lnInclude/Time.H:47,
                 from /opt/openfoam6/src/finiteVolume/lnInclude/fvCFD.H:6,
                 from interFoam.C:35:
/opt/openfoam6/src/OpenFOAM/lnInclude/FieldFunctions.C:543:24: note: candidate: template<class Type> Type Foam::gSum(const Foam::tmp<Foam::Field<Type> >&)
 G_UNARY_FUNCTION(Type, gSum, sum, sum)
                        ^
/opt/openfoam6/src/OpenFOAM/lnInclude/FieldFunctions.C:303:12: note: in definition of macro ‘TMP_UNARY_FUNCTION’
 ReturnType Func(const tmp<Field<Type>>& tf1)                                   \
            ^~~~
/opt/openfoam6/src/OpenFOAM/lnInclude/FieldFunctions.C:543:1: note: in expansion of macro ‘G_UNARY_FUNCTION’
 G_UNARY_FUNCTION(Type, gSum, sum, sum)
 ^~~~~~~~~~~~~~~~
/opt/openfoam6/src/OpenFOAM/lnInclude/FieldFunctions.C:543:24: note:   template argument deduction/substitution failed:
 G_UNARY_FUNCTION(Type, gSum, sum, sum)
                        ^
/opt/openfoam6/src/OpenFOAM/lnInclude/FieldFunctions.C:303:12: note: in definition of macro ‘TMP_UNARY_FUNCTION’
 ReturnType Func(const tmp<Field<Type>>& tf1)                                   \
            ^~~~
/opt/openfoam6/src/OpenFOAM/lnInclude/FieldFunctions.C:543:1: note: in expansion of macro ‘G_UNARY_FUNCTION’
 G_UNARY_FUNCTION(Type, gSum, sum, sum)
 ^~~~~~~~~~~~~~~~
interFoam.C:157:60: note:   mismatched types ‘Foam::Field<Type>’ and ‘Foam::DimensionedField<double, Foam::volMesh>’
  dimensionedScalar totalLiquidVolume = gSum(mesh.V()*alpha1);
                                                            ^
In file included from /opt/openfoam6/src/OpenFOAM/lnInclude/FieldField.C:390:0,
                 from /opt/openfoam6/src/OpenFOAM/lnInclude/FieldField.H:198,
                 from /opt/openfoam6/src/OpenFOAM/lnInclude/GeometricField.H:45,
                 from /opt/openfoam6/src/OpenFOAM/lnInclude/GeometricScalarField.H:38,
                 from /opt/openfoam6/src/OpenFOAM/lnInclude/GeometricFields.H:34,
                 from /opt/openfoam6/src/finiteVolume/lnInclude/volFields.H:37,
                 from /opt/openfoam6/src/finiteVolume/lnInclude/surfaceInterpolationScheme.C:27,
                 from /opt/openfoam6/src/finiteVolume/lnInclude/surfaceInterpolationScheme.H:307,
                 from /opt/openfoam6/src/finiteVolume/lnInclude/surfaceInterpolate.H:41,
                 from /opt/openfoam6/src/finiteVolume/lnInclude/fvc.H:39,
                 from /opt/openfoam6/src/finiteVolume/lnInclude/fvCFD.H:8,
                 from interFoam.C:35:
/opt/openfoam6/src/OpenFOAM/lnInclude/FieldFieldFunctions.C:559:24: note: candidate: template<template<class> class Field, class Type> Type Foam::gSum(const Foam::FieldField<Field, Type>&)
 G_UNARY_FUNCTION(Type, gSum, sum, sum)
                        ^
/opt/openfoam6/src/OpenFOAM/lnInclude/FieldFieldFunctions.C:549:12: note: in definition of macro ‘G_UNARY_FUNCTION’
 returnType gFunc(const FieldField<Field, Type>& f)                             \
            ^~~~~
/opt/openfoam6/src/OpenFOAM/lnInclude/FieldFieldFunctions.C:559:24: note:   template argument deduction/substitution failed:
 G_UNARY_FUNCTION(Type, gSum, sum, sum)
                        ^
/opt/openfoam6/src/OpenFOAM/lnInclude/FieldFieldFunctions.C:549:12: note: in definition of macro ‘G_UNARY_FUNCTION’
 returnType gFunc(const FieldField<Field, Type>& f)                             \
            ^~~~~
interFoam.C:157:60: note:   ‘Foam::tmp<Foam::DimensionedField<double, Foam::volMesh> >’ is not derived from ‘const Foam::FieldField<Field, Type>’
  dimensionedScalar totalLiquidVolume = gSum(mesh.V()*alpha1);
                                                            ^
In file included from /opt/openfoam6/src/OpenFOAM/lnInclude/FieldField.C:390:0,
                 from /opt/openfoam6/src/OpenFOAM/lnInclude/FieldField.H:198,
                 from /opt/openfoam6/src/OpenFOAM/lnInclude/GeometricField.H:45,
                 from /opt/openfoam6/src/OpenFOAM/lnInclude/GeometricScalarField.H:38,
                 from /opt/openfoam6/src/OpenFOAM/lnInclude/GeometricFields.H:34,
                 from /opt/openfoam6/src/finiteVolume/lnInclude/volFields.H:37,
                 from /opt/openfoam6/src/finiteVolume/lnInclude/surfaceInterpolationScheme.C:27,
                 from /opt/openfoam6/src/finiteVolume/lnInclude/surfaceInterpolationScheme.H:307,
                 from /opt/openfoam6/src/finiteVolume/lnInclude/surfaceInterpolate.H:41,
                 from /opt/openfoam6/src/finiteVolume/lnInclude/fvc.H:39,
                 from /opt/openfoam6/src/finiteVolume/lnInclude/fvCFD.H:8,
                 from interFoam.C:35:
/opt/openfoam6/src/OpenFOAM/lnInclude/FieldFieldFunctions.C:559:24: note: candidate: template<template<class> class Field, class Type> Type Foam::gSum(const Foam::tmp<Foam::FieldField<Field, Type> >&)
 G_UNARY_FUNCTION(Type, gSum, sum, sum)
                        ^
/opt/openfoam6/src/OpenFOAM/lnInclude/FieldFieldFunctions.C:400:12: note: in definition of macro ‘TMP_UNARY_FUNCTION’
 returnType func(const tmp<FieldField<Field, Type>>& tf1)                       \
            ^~~~
/opt/openfoam6/src/OpenFOAM/lnInclude/FieldFieldFunctions.C:559:1: note: in expansion of macro ‘G_UNARY_FUNCTION’
 G_UNARY_FUNCTION(Type, gSum, sum, sum)
 ^~~~~~~~~~~~~~~~
/opt/openfoam6/src/OpenFOAM/lnInclude/FieldFieldFunctions.C:559:24: note:   template argument deduction/substitution failed:
 G_UNARY_FUNCTION(Type, gSum, sum, sum)
                        ^
/opt/openfoam6/src/OpenFOAM/lnInclude/FieldFieldFunctions.C:400:12: note: in definition of macro ‘TMP_UNARY_FUNCTION’
 returnType func(const tmp<FieldField<Field, Type>>& tf1)                       \
            ^~~~
/opt/openfoam6/src/OpenFOAM/lnInclude/FieldFieldFunctions.C:559:1: note: in expansion of macro ‘G_UNARY_FUNCTION’
 G_UNARY_FUNCTION(Type, gSum, sum, sum)
 ^~~~~~~~~~~~~~~~
interFoam.C:157:60: note:   mismatched types ‘Foam::FieldField<Field, Type>’ and ‘Foam::DimensionedField<double, Foam::volMesh>’
  dimensionedScalar totalLiquidVolume = gSum(mesh.V()*alpha1);
                                                            ^
/opt/openfoam6/wmake/rules/General/transform:25: recipe for target '/opt/openfoam6/platforms/linux64GccDPInt32Opt/applications/solvers/multiphase/interFoam/interFoam.o' failed
make: *** [/opt/openfoam6/platforms/linux64GccDPInt32Opt/applications/solvers/multiphase/interFoam/interFoam.o] Error 1
where I think this may all stem from the
joshmccraney is offline   Reply With Quote

Old   March 24, 2020, 12:38
Default
  #15
Senior Member
 
Join Date: Aug 2015
Posts: 494
Rep Power: 14
clapointe is on a distinguished road
The product inside gSum() is clearly not going to work. I vaguely recall using something like mesh.V().value() before. But using gSum may take some more work.... fvc::volumeIntegrate is another option.

Caelan
clapointe is offline   Reply With Quote

Old   March 24, 2020, 14:16
Default
  #16
Senior Member
 
Josh McCraney
Join Date: Jun 2018
Posts: 220
Rep Power: 8
joshmccraney is on a distinguished road
Quote:
Originally Posted by clapointe View Post
The product inside gSum() is clearly not going to work. I vaguely recall using something like mesh.V().value() before. But using gSum may take some more work.... fvc::volumeIntegrate is another option.

Caelan
Shoot! Well thanks for your help on all this! I kept digging and think I found a simpler option here, post 2. I checked it on 16 cores in parallel and it works!

Again, thanks for your time Caelan!
joshmccraney 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
How to use "translation" in solidBodyMotionFunction in OpenFOAM rupesh_w OpenFOAM Running, Solving & CFD 5 August 16, 2016 04:27
multiphase turbulance case floating error harsha_kulkarni OpenFOAM Running, Solving & CFD 3 February 18, 2016 05:06
How to calculate liquid volume as the interface moves for interFoam Solver asaha OpenFOAM Running, Solving & CFD 25 October 21, 2009 04:34
Calculating volume of Phase Pavan FLUENT 2 March 5, 2008 10:04
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 11:55


All times are GMT -4. The time now is 02:09.