Skip to content

Mathis

Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • in reply to: JPEG output of time-averaged fonctor #6547
    Mathis
    Participant

    Dear Stephan,

    Thank you for your answer.
    So I managed to extract components from the instance of SuperLatticeTimeAveragedF3D using the method SuperExtractComponentF3D, which extracts one component at a time. By doing this for each component of the velocity (three in 3D), I managed to generate three distinct outputs for each time-averaged velocity component with the following lines of code before the time loop in the main() function :

    // definition of turbulent statistics objects
    SuperLatticePhysVelocity3D<T, DESCRIPTOR> sVel( sLattice, converter );
    SuperLatticeTimeAveragedF3D<T> sAveragedVel( sVel );
    SuperExtractComponentF3D<T,T> uAvgVel( sAveragedVel, 0);
    SuperExtractComponentF3D<T,T> vAvgVel( sAveragedVel, 1);
    SuperExtractComponentF3D<T,T> wAvgVel( sAveragedVel, 2);
    uAvgVel.getName() = “physVelU”;
    vAvgVel.getName() = “physVelV”;
    wAvgVel.getName() = “physVelW”;
    // x vel component
    BlockReduction3D2D<T> planeReduction_u(uAvgVel, Hyperplane3D<T>().originAt({0,0,3.5}).normalTo({0,0,1}), 0, BlockDataSyncMode::ReduceOnly);
    // y vel component
    BlockReduction3D2D<T> planeReduction_v(vAvgVel, Hyperplane3D<T>().originAt({0,0,3.5}).normalTo({0,0,1}), 0, BlockDataSyncMode::ReduceOnly);
    // z vel component
    BlockReduction3D2D<T> planeReduction_w(wAvgVel, Hyperplane3D<T>().originAt({0,0,3.5}).normalTo({0,0,1}), 0, BlockDataSyncMode::ReduceOnly);

    along with the update lines on the function getResults :

    // Writes the ppm files
    if ( iT%vtkIter==0 ) {
    planeReduction_u.update();
    planeReduction_v.update();
    planeReduction_w.update();
    // write output as JPEG
    heatmap::write(planeReduction_u, iT);
    heatmap::write(planeReduction_v, iT);
    heatmap::write(planeReduction_w, iT);
    }

    In the end I did not use the SuperEukildNorm3D because if I input uAvgVel for instance, it outputs a segmentation error (there is no need to apply a norm to each component separately anyway, but I mention this segFault for your information)

    A more optimal way to proceed would be to find a way to directly create a SuperLatticeF3D functor (with dimension 3) from the SuperLatticeTimeAveragedF3D (which has dimension 6, with 3 time-avg vel components + 3 RMS values) with the components of interest, and to give it to SupeEuklidNorm3D, but I did not find any way to do so.

    If you have any clue, feel free to let me know, I would be interested to use it, although the solution I described above appears to meet my original goal.

    Thank you very much
    Best regards

    Mathis

    in reply to: JPEG output of time-averaged fonctor #6523
    Mathis
    Participant

    POST SCRIPTUM : working on version 1.4

    in reply to: Advection Diffusion D3Q19 Boundary Condition #5638
    Mathis
    Participant

    Dear Stephan,

    Thank you very much for your suggestions! I will have a look at them and see if I can find a solution.

    In my applications, when simulating atmospheric pollutant dispersion, I usually neglect molecular diffusivity compared to turbulent diffusivity, so this could be a problem; additionally, I initially have a source with concentration set to 1 whereas the rest of the domain is 0, which could be seen as a non-smooth initial condition. Maybe a possible improvement would be to smoothely increase the value of the concentration at the source from 0 to 1 ?

    Anyway, I will have a look at your suggestions and also try the ELB collision model to see if I can get something useful out of it.

    Thank you again for your valuable help! I will let you know if I succeed in any way.

    Best,
    Mathis

    in reply to: Advection Diffusion D3Q19 Boundary Condition #5636
    Mathis
    Participant

    Dear Stephan,

    Thank you for your reply. My argumentation is the following.

    – At high Re, using BGK + D3Q7 (+ smagorinsky) for the advection-diffusion appears to violate the positivity of the solver (the scalar field is expected to remain positive but negative values are observed in the domain due to oscillations). Therefore, I need to stabilize the advection-diffusion lattice in some way.
    – From the paper of Junk (2001) “A finite difference interpretation of the Lattice Boltzmann method”, I assume that the D3Q7 lattice is equivalent to centered finite difference scheme, which is known to be unstable at high values of Re (as stated for instance in the book of Versteeg and Malalasekera “An introduction to computational Fluid Dynamics: the finite volume method”, section 5.3).
    – Therefore, a first idea would be to try the D3Q19 on the advection-diffusion lattice. Also, the D3Q19 would allow me to use an entropic collision operator for the advection diffusion in order to guarantee positivity, which would be (I think) a promising stabilization possibility.

    So I tried to add the line “boundaryDynamics.collide(cell, statistics);” between the lines 113 and 114 of advectionDiffusionBoundaries.hh, but it turns out that the results are not better; the oscillations are more pronounced and the scalar field is less physical than before.

    So I guess I will keep the previous version (without the collide), for which there might be a theoretical/practical justification.. by the way, maybe the problems I am facing here are related to something else than the inlet BC.

    Anyway, if you have any general advice as to how to stabilize the advection-diffusion solver for high Re, I would be interested to know.

    Thank you for your time!
    Best regards
    Mathis

Viewing 4 posts - 1 through 4 (of 4 total)