I tried to use ShanChen model to simulate single component liquid-vapor flow.
I modifed the sample code - segregation2D and tutorial code - permeability.
I defined lattice and geometry as in permeability.
I compiled the code using version 6 and the latest version.
With version 6, it was ok, but with the latest version (I complied on Cygwin),
I’ve got the error message as below:
error: no matching function for call to 'defineDynamics(plb::MultiBlockLattice2D<double, plb::descriptor::ShanChenD2Q9Descriptor>&,
plb::MultiScalarField2D&, plb::BounceBack<double, plb::descriptor::ShanChenD2D9Descriptor>*, int)
Here is my code:
defineDynamics(lattice, geometry, new BounceBack<T, DESCRIPTOR>(65.), 1);
the same error on defineDynamics(lattice, geometry, new NoDynamics<T, DESCRIPTOR>(), 2);
It was complied correctly with permeability.cpp where similar call was used.
Yes, we made a little change it the user’s interface, sorry for that (the change made sense, though, as you will see in the following). As of version 0.7, the geometry argument should no longer be of type MultiScalarField2D, but of type MultiScalarField2D.
Of course, “int” makes more sense than “double,” because “geometry” is a flag matrix. In old versions of Palabos, it was unfortunately not possible to mix data types, which means, it was not possible to bring a MultiBlockLattice2D<T1,Descriptor> in contact with a MultiScalarField2D if T1 is different from T2. The workaround was to have the flag matrix to be of type “double”. This was a bit awkward and has been fixed: from now on flag matrices are simply of type int.
Thanks for correcting the problem. Type works and you’re right – no reason for double type of geometry.
I have one more question related to my current work.
In coming weeks, I plan to update Shan-Chen model by adding fluid-surface forces developed by Martys and Chen (1996).
This method has been already used for many cases and demonstrated well in Sukop and Thorne’s textbook.
I plan to dig out how the current Shan-Chen model is coded and follow the current data processing.
I wonder if you have a good example or some tips for this.
Are you referring to the single-component multi-phase Shan/Chen model in which the interaction potential is psi(rho)=rho? In this case it is already implemented in Palabos. Have a look at the example program codesByTopic/shanChenMultiPhase/segregation2D.cpp (the example is 2D, but the same works in 3D). This example uses the ShanChenSingleComponentProcessor, which takes as one of the arguments a function for the interaction potential. In the example, the chosen potential is interparticlePotential::PsiShanChen94(psi0,rho0). You can replace this by interparticlePotential::PsiIsRho() to have the Martys and Chen model.
Have a look at the file multiPhysics/interparticlePotential.h to get a list of implemented potentials, and to see how to implement new potentials.
Yes, please do share your thoughts and results with us, we are looking forward to gathering more knowledge about these models.
In the Martys and Chen model, there are two potential terms for fluid-fluid and fluid-solid. Since we can assign a density value to the bounce back node, to have the Martys and Chen model, we just need to use two potential fns for fluid nodes without contact with bounceback node and fluid nodes with contact with bounceback nodes in lattice, respectively. I need to study the data process to understand the code structure better.
I’m brand new to Palabos and tried to compile the fullDomainFromSTL.cpp file from the readSTL folder with Palabos v0.7r2 and gcc 4.4.3
I’m getting the following error :
/home/michael/Codes/LBM/palabos-v0.7r2/src/libraryInterfaces/CVMLCPP_fullMultiBlock3D.hh:218: erreur: no matching function for call to ‘defineDynamics(plb::MultiBlockLattice3D<double, plb::descriptors::D3Q19Descriptor>&, plb::MultiScalarField3D<double>&, plb::Dynamics<double, plb::descriptors::D3Q19Descriptor>*&, bool&)’
Is that also comming from the definition? Any idea of what is going wrong? Is that the same problem than the one encountered above? If yes, what would be the file to modify?