GithubHelp home page GithubHelp logo

floquation / of-kva_interfaceproperties Goto Github PK

View Code? Open in Web Editor NEW
21.0 6.0 15.0 440 KB

Extension of OpenFOAM's "interfaceProperties" library. A run-time selection mechanism was implemented to select the model for calculating the surface tension force & curvature. These models can reduce spurious currents.

Home Page: https://www.cfd-online.com/Forums/openfoam-programming-development/189211-attempt-decrease-spurious-currents-vof.html#post653522

License: GNU General Public License v3.0

C 47.93% C++ 35.31% Shell 16.76%
openfoam multiphase surface-tension spurious-currents interfoam curvature vofsmooth

of-kva_interfaceproperties's People

Contributors

floquation avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

of-kva_interfaceproperties's Issues

recompilation of solvers fails in OF6

cross-post from https://www.cfd-online.com/Forums/openfoam-verification-validation/124363-interfoam-validation-bubble-droplet-flows-microfluidics-3.html#post721524, in case you prefer it as an issue here.

I was able to build and run in OF5. For uniformity with other simulations of mine, though, I was looking to use OF6. Blindly trying on OF6, according to the instructions on the README:

  • . /opt/openfoam6/etc/bashrc
  • wmake runs fine
  • cd recompile_solvers
  • $FOAM_SOLVERS/multiphase/interFoam; kva_interFoam in list_of_solvers
  • ./Allget ok
  • ./Allwmake fails with this error:
$ ./Allwmake
Making dependency list for source file interFoam.C
*** Error in `/opt/openfoam6/wmake/platforms/linux64Gcc/wmkdep': free(): invalid next size (fast): 0x00000000015a3670 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f07786267e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7f077862f37a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f077863353c]
/opt/openfoam6/wmake/platforms/linux64Gcc/wmkdep[0x401023]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f07785cf830]
/opt/openfoam6/wmake/platforms/linux64Gcc/wmkdep[0x401199]
======= Memory map: ========
00400000-00405000 r-xp 00000000 08:01 3043213                            /opt/openfoam6/wmake/platforms/linux64Gcc/wmkdep
00604000-00605000 r--p 00004000 08:01 3043213                            /opt/openfoam6/wmake/platforms/linux64Gcc/wmkdep
00605000-00606000 rw-p 00005000 08:01 3043213                            /opt/openfoam6/wmake/platforms/linux64Gcc/wmkdep
00606000-00607000 rw-p 00000000 00:00 0 
015a3000-015e5000 rw-p 00000000 00:00 0                                  [heap]
7f0774000000-7f0774021000 rw-p 00000000 00:00 0 
7f0774021000-7f0778000000 ---p 00000000 00:00 0 
7f0778399000-7f07783af000 r-xp 00000000 08:01 6034606                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7f07783af000-7f07785ae000 ---p 00016000 08:01 6034606                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7f07785ae000-7f07785af000 rw-p 00015000 08:01 6034606                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7f07785af000-7f077876f000 r-xp 00000000 08:01 6034654                    /lib/x86_64-linux-gnu/libc-2.23.so
7f077876f000-7f077896f000 ---p 001c0000 08:01 6034654                    /lib/x86_64-linux-gnu/libc-2.23.so
7f077896f000-7f0778973000 r--p 001c0000 08:01 6034654                    /lib/x86_64-linux-gnu/libc-2.23.so
7f0778973000-7f0778975000 rw-p 001c4000 08:01 6034654                    /lib/x86_64-linux-gnu/libc-2.23.so
7f0778975000-7f0778979000 rw-p 00000000 00:00 0 
7f0778979000-7f077899f000 r-xp 00000000 08:01 6034650                    /lib/x86_64-linux-gnu/ld-2.23.so
7f0778b59000-7f0778b5c000 rw-p 00000000 00:00 0 
7f0778b9c000-7f0778b9e000 rw-p 00000000 00:00 0 
7f0778b9e000-7f0778b9f000 r--p 00025000 08:01 6034650                    /lib/x86_64-linux-gnu/ld-2.23.so
7f0778b9f000-7f0778ba0000 rw-p 00026000 08:01 6034650                    /lib/x86_64-linux-gnu/ld-2.23.so
7f0778ba0000-7f0778ba1000 rw-p 00000000 00:00 0 
7ffe4ffab000-7ffe4ffce000 rw-p 00000000 00:00 0                          [stack]
7ffe4ffd1000-7ffe4ffd4000 r--p 00000000 00:00 0                          [vvar]
7ffe4ffd4000-7ffe4ffd6000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
make: *** Deleting file 'Make/linux64GccDPInt32Opt//opt/openfoam6/applications/solvers/multiphase/interFoam/interFoam.C.dep'
make: *** No rule to make target 'Make/linux64GccDPInt32Opt//opt/openfoam6/applications/solvers/multiphase/interFoam/interFoam.C.dep', needed by 'Make/linux64GccDPInt32Opt//opt/openfoam6/applications/solvers/multiphase/interFoam/interFoam.o'.  Stop.

Error when running interFoam

for a stationary bubble case with interFoam I am trying to use the interfaceproperties. I believe I have it compiled already and ready to use, since running
ldd $(which interFoam) | grep "interfaceProperties
gives the report
libinterfaceProperties.so => /home//OpenFOAM/platforms/linux64GccDPInt32Opt/lib/libinterfaceProperties.so (0x00007f7711a00000)

By the way, when running interFoam I get the error

PIMPLE: Operating solver in PISO mode

Reading field p_rgh

Reading field U

Reading/calculating face flux field phi

Reading transportProperties

Selecting incompressible transport model Newtonian
Selecting incompressible transport model Newtonian
Selecting curvatureModel normal
kva: curvatureModel::read(normal);
#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::sigSegv::sigHandler(int) at ??:?
#2  ? in "/lib/x86_64-linux-gnu/libc.so.6"
Segmentation fault (core dumped)

What is wrong that it is not working?
I have just added

curvatureModel normal; // normal;
vofsmoothCoeffs
{
numSmoothingIterations 2; // default: 2
}

to the transport properties.

fatal error: alphaContactAngleFvPatchScalarField.H: No such file or directory

Dear foamers,
I have been trying to install the vofsmooth on foam-extend 4.0, but I receive errors when executing wmake command. The fatal error I received is "fatal error: alphaContactAngleFvPatchScalarField.H: No such file or directory". I would appreciate it if you could help me resolve the issue.

Here is the output:

interfaceProperties.C:27:49: fatal error: alphaContactAngleFvPatchScalarField.H: No such file or directory
compilation terminated.
make: *** [interfaceProperties.dep:521: Make/linux64GccDPOpt/interfaceProperties.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from curvatureModel/curvatureModel.H:42:0,
                 from curvatureModel/curvatureModel.C:26:
lnInclude/interfaceProperties.H:81:30: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
      bool densityWeighted_ = false; // KVA
                              ^
lnInclude/interfaceProperties.H:110:33: error: ‘Foam::surfaceVectorField<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh>::Boundary’ has not been declared
             surfaceVectorField::Boundary& nHat,
                                 ^
lnInclude/interfaceProperties.H:111:39: error: ‘Boundary’ in ‘Foam::surfaceVectorField {aka class Foam::GeometricField<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh>}’ does not name a type
             const surfaceVectorField::Boundary& gradAlphaf
                                       ^
In file included from curvatureModel/curvatureModel.C:26:0:
curvatureModel/curvatureModel.H:78:33: error: ‘Foam::surfaceVectorField<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh>::Boundary’ has not been declared
             surfaceVectorField::Boundary& nHat,
                                 ^
curvatureModel/curvatureModel.H:79:39: error: ‘Boundary’ in ‘Foam::surfaceVectorField {aka class Foam::GeometricField<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh>}’ does not name a type
             const surfaceVectorField::Boundary& gradAlphaf
                                       ^
curvatureModel/curvatureModel.C:48:22: error: variable or field ‘correctContactAngle’ declared void
  surfaceVectorField::Boundary& nHat,
                      ^
curvatureModel/curvatureModel.C:48:2: error: ‘Boundary’ is not a member of ‘Foam::surfaceVectorField {aka Foam::GeometricField<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh>}’
  surfaceVectorField::Boundary& nHat,
  ^
curvatureModel/curvatureModel.C:48:32: error: ‘nHat’ was not declared in this scope
  surfaceVectorField::Boundary& nHat,
                                ^
curvatureModel/curvatureModel.C:49:2: error: expected primary-expression before ‘const’
  const surfaceVectorField::Boundary& gradAlphaf
  ^
curvatureModel/curvatureModel.C: In static member function ‘static Foam::autoPtr<Foam::curvatureModel> Foam::curvatureModel::New(const Foam::word&, const Foam::interfaceProperties&)’:
curvatureModel/curvatureModel.C:87:3: error: ‘WarningInFunction’ was not declared in this scope
   WarningInFunction
   ^
curvatureModel/curvatureModel.C:94:9: error: ‘FatalErrorInFunction’ was not declared in this scope
         FatalErrorInFunction
         ^
curvatureModel/curvatureModel.C:108:9: error: ‘FatalErrorInFunction’ was not declared in this scope
         FatalErrorInFunction
         ^
In file included from lnInclude/curvatureModel.H:42:0,
                 from curvatureModel/normal/normal.H:38,
                 from curvatureModel/normal/normal.C:26:
lnInclude/interfaceProperties.H:81:30: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
      bool densityWeighted_ = false; // KVA
                              ^
lnInclude/interfaceProperties.H:110:33: error: ‘Foam::surfaceVectorField<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh>::Boundary’ has not been declared
             surfaceVectorField::Boundary& nHat,
                                 ^
lnInclude/interfaceProperties.H:111:39: error: ‘Boundary’ in ‘Foam::surfaceVectorField {aka class Foam::GeometricField<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh>}’ does not name a type
             const surfaceVectorField::Boundary& gradAlphaf
                                       ^
In file included from curvatureModel/normal/normal.H:38:0,
                 from curvatureModel/normal/normal.C:26:
lnInclude/curvatureModel.H:78:33: error: ‘Foam::surfaceVectorField<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh>::Boundary’ has not been declared
             surfaceVectorField::Boundary& nHat,
                                 ^
lnInclude/curvatureModel.H:79:39: error: ‘Boundary’ in ‘Foam::surfaceVectorField {aka class Foam::GeometricField<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh>}’ does not name a type
             const surfaceVectorField::Boundary& gradAlphaf
                                       ^
In file included from lnInclude/curvatureModel.H:42:0,
                 from curvatureModel/vofsmooth/vofsmooth.H:38,
                 from curvatureModel/vofsmooth/vofsmooth.C:26:
lnInclude/interfaceProperties.H:81:30: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
      bool densityWeighted_ = false; // KVA
                              ^
lnInclude/interfaceProperties.H:110:33: error: ‘Foam::surfaceVectorField<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh>::Boundary’ has not been declared
             surfaceVectorField::Boundary& nHat,
                                 ^
lnInclude/interfaceProperties.H:111:39: error: ‘Boundary’ in ‘Foam::surfaceVectorField {aka class Foam::GeometricField<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh>}’ does not name a type
             const surfaceVectorField::Boundary& gradAlphaf
                                       ^
In file included from curvatureModel/vofsmooth/vofsmooth.H:38:0,
                 from curvatureModel/vofsmooth/vofsmooth.C:26:
lnInclude/curvatureModel.H:78:33: error: ‘Foam::surfaceVectorField<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh>::Boundary’ has not been declared
             surfaceVectorField::Boundary& nHat,
                                 ^
lnInclude/curvatureModel.H:79:39: error: ‘Boundary’ in ‘Foam::surfaceVectorField {aka class Foam::GeometricField<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh>}’ does not name a type
             const surfaceVectorField::Boundary& gradAlphaf
                                       ^
make: *** [curvatureModel/curvatureModel.dep:512: Make/linux64GccDPOpt/curvatureModel.o] Error 1
curvatureModel/normal/normal.C: In member function ‘virtual void Foam::curvatureModels::normal::calculateK(Foam::volScalarField&, Foam::surfaceScalarField&) const’:
curvatureModel/normal/normal.C:91:29: error: ‘Foam::surfaceVectorField {aka class Foam::GeometricField<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh>}’ has no member named ‘boundaryFieldRef’
  correctContactAngle(nHatfv.boundaryFieldRef(), gradAlphaf.boundaryField());
                             ^
curvatureModel/vofsmooth/vofsmooth.C: In member function ‘virtual void Foam::curvatureModels::vofsmooth::calculateK(Foam::volScalarField&, Foam::surfaceScalarField&) const’:
curvatureModel/vofsmooth/vofsmooth.C:152:29: error: ‘Foam::surfaceVectorField {aka class Foam::GeometricField<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh>}’ has no member named ‘boundaryFieldRef’
  correctContactAngle(nHatfv.boundaryFieldRef(), gradAlphaf.boundaryField());
                             ^
curvatureModel/vofsmooth/vofsmooth.C: In member function ‘virtual bool Foam::curvatureModels::vofsmooth::read()’:
curvatureModel/vofsmooth/vofsmooth.C:189:3: error: ‘WarningInFunction’ was not declared in this scope
   WarningInFunction
   ^
curvatureModel/vofsmooth/vofsmooth.C:197:4: error: ‘WarningInFunction’ was not declared in this scope
    WarningInFunction
    ^
curvatureModel/vofsmooth/vofsmooth.C:202:4: error: ‘WarningInFunction’ was not declared in this scope
    WarningInFunction
    ^
make: *** [curvatureModel/normal/normal.dep:624: Make/linux64GccDPOpt/normal.o] Error 1

stange error when compiling for compressibleInterFoam with OF v5

Hi Kevin,

Sorry to cross-post, but I've read in another post you might not check the cfd-online posts too often.

I am having some trouble in getting this to work with compressibleInterFoam in OF v5. The error is as follows:

 --> FOAM FATAL ERROR: 
different mesh for fields interfaceProperties:K and -div(nHatf) during operatrion =

    From function void Foam::GeometricField<Type, PatchField, GeoMesh>::operator=(const Foam::tmp<Foam::GeometricField<Type, PatchField, GeoMesh>> &) [with Type = double, PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh]
    in file /desktop/2018/software/MPI/intel/2018.1.163-GCC-6.4.0-2.28/impi/2018.1.163/OpenFOAM/5.0-20180108/OpenFOAM-5.0-20180108/src/OpenFOAM/lnInclude/GeometricField.C at line 1201.

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::error::abort() at ??:?
#2  Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::operator=(Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > const&) at ??:?
#3  Foam::curvatureModels::vofsmooth::calculateK(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>&) const at ??:?
#4  Foam::twoPhaseMixtureThermo::correct() at ??:?
#5  ? at ??:?
#6  __libc_start_main in "/lib64/libc.so.6"
#7  ? at ??:?  

More details on here: https://www.cfd-online.com/Forums/openfoam-verification-validation/124363-interfoam-validation-bubble-droplet-flows-microfluidics-3.html#post735107

A few other things:

  • Since I am using compressibleInterFoam, I manage to compile this by inserting the absolute path to twoPhaseMixtureThermo.H. I have tried implementing the changes you suggested to eliminate the reading of rho1 and rho2 from thermophysicalProperties. Unfortunately this does not seem to solve the issue, so I still have to specify the phases in thermophysicalProperties despite 'hacking' your code. It would be useful to know whether anyone else has tried it and worked, I wouldn't be surprised to find I am missing something. I did recompile and hash the solver once compilation was complete.

  • Also, with regards to the interfaceCompression scheme - turns out that I am also using this scheme (tbh, surprised to hear it is not really in use anymore!). How difficult is it to implement the functionality of this scheme for use with your dynamic library and compressibleInterFoam? Could you perhaps provide some guidance? I have some experience in OpenFOAM but it is my first time trying to tweak a solver, so any help is appreciated

Thanks in advance for your help on this.

Kind regards,

Jacky

Issue with make

I tried wmake, but I got an error about missing of labelSpecific.H
So one needs to first do wclean then wmake, because on OF 4.1 seems that that headerfile does not anymore exist :)

Compatibility with OF CFD version

Hi Floquation,
I read your explanation regarding the parasitic currents prevailing at the interface, and I liked the idea of using the smoothened alpha field to calculate the curvature. I was planning to use the code and run a couple of cases. But unfortunately, I am using the OF CFD version (1812). Any suggestion on how to compile it the CFD version if you have tried?

Thank you in advance

compiling OF-kva_interfaceProperties in OF4x when I use "./Allget && ./Allwmake"

Dear Kevin
This is cross-post both in CFD online and here;
https://www.cfd-online.com/Forums/openfoam-verification-validation/124363-interfoam-validation-bubble-droplet-flows-microfluidics-3.html#post844381

I have installed OpenFoam4x in order to use your "kva_interfaceProperties", and I tested and Openfoam4x works fine. When I want to compile the, below sections works fine and generates a folder named "farzad-4.x", and I have it here;
[CODE]OpenFOAM/farzad-4.x/libraries/kva_interfaceProperties[/CODE]

So your commands worked up to here;

of40
mkdir -p $FOAM_RUN/../libraries
cd $FOAM_RUN/../libraries
---------------------------------------------------
git clone https://github.com/floquation/OF-kva_interfaceProperties
mv OF-kva_interfaceProperties kva_interfaceProperties
cd kva_interfaceProperties
---------------------------------------------------
git checkout of40
---------------------------------------------------
wmake
---------------------------------------------------

Now I want to recompile my solver and as you suggested, I did this;

cd recompileSolvers 

//And I used your original suggestion;

# FULL_PATH_to_solver; optional_new_solver_name
$FOAM_SOLVERS/multiphase/interFoam; kva_interFoam
$FOAM_SOLVERS/multiphase/interFoam/interDyMFoam; kva_interDyMFoam

but here, below code does not work;

./Allget && ./Allwmake

which gives below error;

bash: ./Allget: /usr/bin/sh: bad interpreter: No such file or directory

why? and what should I do?
just as a reminder, For openfoam4x I have these 3 main folders;

farzad-4.x OpenFOAM-4.x  ThirdParty-4.x

Thanks,
Farzad

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.