Example does not compile

Dear all,

I am currently trying to get into the Smagorinsky model implemented in Palabos. For this, I wanted to compile the file


examples/codesByTopic/smagorinskyModel/smagorinskyCavity3D.cpp

however, the compilation breaks with the lines for BGK dynamics and follow-up instantiation of the Smagorinsky model.



    MultiBlockLattice3D<T, DESCRIPTOR> lattice (
            parameters.getNx(), parameters.getNy(), parameters.getNz(),
            //new SmagorinskyBGKdynamics<T,DESCRIPTOR>(parameters.getOmega(), cSmago) );
            //new SmagorinskyRegularizedDynamics<T,DESCRIPTOR>(parameters.getOmega(), cSmago) );
            new BGKdynamics<T,DESCRIPTOR>(parameters.getOmega()) );

    // Uncomment the following line to instantiate the Smagorinsky LES model,
    //   if the background-dynamics (i.e. the dynamics given to "lattice" in
    //   the constructor) is BGKdynamics instead of SmagorinskyBGKdynamics.
    
    instantiateStaticSmagorinsky(lattice, lattice.getBoundingBox(), cSmago);

compiler output:


make
python ../../../scons/scons.py -f ../../../SConstruct palabosRoot=../../.. projectFiles="smagorinskyCavity3D.cpp" optimize=true debug=false profile=false MPIparallel=false SMPparallel=false usePOSIX=true useCVMLCPP=false serialCXX=g++ parallelCXX=mpicxx compileFlags="" linkFlags="" optimFlags="-O3" debugFlags="-g" profileFlags="-pg" libraryPaths="" includePaths="../include" libraries=""
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
g++ -o smagorinskyCavity3D.o -c -O3 -DPLB_USE_POSIX -I/home/seil/fluidmech/palabos-v0.7r3/src -I/home/seil/fluidmech/palabos-v0.7r3/externalLibraries -I/home/seil/fluidmech/palabos-v0.7r3/examples/codesByTopic/include smagorinskyCavity3D.cpp
In file included from /home/seil/fluidmech/palabos-v0.7r3/src/complexDynamics/smagorinskyDynamics3D.h:45,
                 from /home/seil/fluidmech/palabos-v0.7r3/src/complexDynamics/headers3D.h:34,
                 from /home/seil/fluidmech/palabos-v0.7r3/src/palabos3D.h:27,
                 from smagorinskyCavity3D.cpp:21:
/home/seil/fluidmech/palabos-v0.7r3/src/complexDynamics/smagorinskyGenerics3D.h: In member function ‘void plb::StaticSmagorinskyFunctional3D<T, Descriptor, SmagoFunction>::process(plb::Box3D, plb::BlockLattice3D<T, Descriptor>&) [with T = double, Descriptor = plb::descriptors::D3Q19Descriptor, SmagoFunction = double (*)(long int, long int, long int, double)]’:
smagorinskyCavity3D.cpp:177:   instantiated from here
/home/seil/fluidmech/palabos-v0.7r3/src/complexDynamics/smagorinskyGenerics3D.h:46: error: ‘class plb::Cell<double, plb::descriptors::D3Q19Descriptor>’ has no member named ‘getOmega’
scons: *** [smagorinskyCavity3D.o] Error 1
scons: building terminated because of errors.
make: *** [compile] Fehler 2


I am using Palabos 0.7r3

regards,
Philippe

changing line 79 and line 84 of smagorinskyGenerics3D.h to



    instantiateStaticSmagorinsky(lattice, domain, constOmegaFromOmega0<T>, cSmago);

resolves the problem. The same bug can be found in smagorinskyGenerics2D.h

Philippe

An additional comment on this: line 46 in the same file should probably be


T omega0 = lattice.get(iX,iY,iZ).getDynamics().getOmega();

instead of


T omega0 = lattice.get(iX,iY,iZ).getOmega();

But still the use of instantiateStaticSmagorinsky() does not result in a working Smagorinsky model… there is still something wrong, but I cannot dig that far into Palabos at the time…

it would be nice if anyone of the more active developers could give a comment on this - whether this fix makes sense or not and maybe where to look for the solution of the problem…

Philippe Wrote:

changing line 79 and line 84 of
smagorinskyGenerics3D.h to

instantiateStaticSmagorinsky(lattice, domain,

constOmegaFromOmega0, cSmago);

resolves the problem. The same bug can be found in
smagorinskyGenerics2D.h

Philippe
Hi, Philippe.
I encountered the same question.
I check line 79 and 84 in smagorinskyGenerics2D.h as you say, but thay are the same with you advice us to change to.
Line 79 and 84 in smagorinskyGenerics2D.h are just


instantiateStaticSmagorinsky(lattice, domain, constOmegaFromOmega0<T>, cSmago);

Are there anything diffierent? Or something wrong about my understanding with your resolve method?

Good regards.

hello
i am not able to plot the results. i am able to compile and run exe file in command window for bstep2d example.
but not able to plot vorticity results.

is there we have to write some code for it. as given in user manual i have tried using image writer but i am getting error

// CODE 5.1: Produce a GIF image from 2D data
// <…> Create and initialize a variable lattice
//
of type BlockLattice2D<T,D2Q9Descriptor>
DataAnalysisBase2D<T,D2Q9Descriptor> const& analysis
= lattice.getDataAnalysis();
// Prepare for creation of an image with the colormap “earth”
ImageWriter imageWriter(“earth”);
imageWriter.writeScaledGif(“vorticity”, analysis.getVorticity, 200, 200);

THE ERROR IS AS FOLLOW
imagep.cpp:4: error: expected constructor, destructor, or type conversion before ‘<’ token
imagep.cpp:6: error: expected constructor, destructor, or type conversion before ‘<’ token
imagep.cpp:7: error: expected constructor, destructor, or type conversion before ‘.’ token

if any one help please let me know , my email id is nikul@iitgn.ac.in

Dear Philippe,

You are right. getOmega() should be replaced by getDynamics().getOmega(). Thank you for this! It will be corrected in the next Palabos release.

Best,
Dimitris