Skip to content

Inverted axis on cavity2d/3d examples

OpenLB – Open Source Lattice Boltzmann Code Forums on OpenLB General Topics Inverted axis on cavity2d/3d examples

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #2003
    jr_waine
    Member

    Hello,

    I ploted the results of the cavity2d and cavity3d examples on ParaView and the graphics axis appeared to be inverted. In the 2d example, the velocity profile indicates that the right wall is moving upwards, instead of the top wall moving to the right. And in the 3d example, the profile indicates that the wall is moving in the z axis direction, instead of the x axis.
    Is this caused by the difference between the way that the openLB code stores the values and how the paraView software reads it, or is it some “misconfiguration” on my ParaView?

    Best regards, Waine

    #2951
    Markus Mohrhard
    Participant

    Hey,

    thanks for the report. We had already fixed this issue in our development branch.

    Find below the fix that is necessary to fix the VTK export:

    Code:
    diff –git a/src/io/blockVtkWriter2D.hh b/src/io/blockVtkWriter2D.hh
    index ea92f0d34..6c8634a3e 100644
    — a/src/io/blockVtkWriter2D.hh
    +++ b/src/io/blockVtkWriter2D.hh
    @@ -189,8 +189,8 @@ void BlockVTKwriter2D<T>::writeRawData(const std::string& fullNameVti, BlockF2D<
    for (int iDim = 0; iDim < f.getTargetDim(); ++iDim) {
    evaluated[iDim] = T();
    }
    – for (i[0] = 0; i[0] < ny+1; ++i[0]) {
    – for (i[1] = 0; i[1] < nx+1; ++i[1]) {
    + for (i[1] = 0; i[1] < ny+1; ++i[1]) {
    + for (i[0] = 0; i[0] < nx+1; ++i[0]) {
    f(evaluated,i);
    for (int iDim = 0; iDim < f.getTargetDim(); ++iDim) {
    if (singleton::mpi().getRank()==0) {
    @@ -251,8 +251,8 @@ void BlockVTKwriter2D<T>::writeRawDataBinary(const std::string& fullNameVti,
    for (int iDim = 0; iDim < f.getTargetDim(); ++iDim) {
    evaluated[iDim] = T();
    }
    – for (i[0] = 0; i[0] < ny+1; ++i[0]) {
    – for (i[1] = 0; i[1] < nx+1; ++i[1]) {
    + for (i[1] = 0; i[1] < ny+1; ++i[1]) {
    + for (i[0] = 0; i[0] < nx+1; ++i[0]) {
    f(evaluated,i);
    for (int iDim = 0; iDim < f.getTargetDim(); ++iDim) {
    if (singleton::mpi().getRank()==0) {

    Kind regards,
    Markus

    #2953
    LaurentDelaon
    Participant

    HI

    how did we dorealise the fix correction ?

    regard’s.
    Laurent.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.