Skip to content

Printing the relaxation time of each lattice to vtk files

OpenLB – Open Source Lattice Boltzmann Code Forums on OpenLB General Topics Printing the relaxation time of each lattice to vtk files

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #4508
    guojuw
    Participant

    Hi,

    I know the way to print the velocity of each lattice to vtk files:

    SuperLatticePhysVelocity2D<T, DESCRIPTOR> velocity(sLattice, converter);
    vtkWriter.addFunctor(velocity);

    Since I am dealing with non-Newtonian fluids, can I print the lattice relaxation time to vtk files in a similar way?

    Junwei Guo

    #4511
    Nicolas
    Participant

    Dear Junwei Guo,

    you can print any analytical functor via SuperLatticeFfromAnalyticalF2D. In case a constant value needs to be written an AnalyticalConst2D can be used to provide the respective functor. Even though you are probably not interested in writing a constant lattice relaxation time to every cell, this could be achieved by the following snippet:

    AnalyticalConst2D<T, T> anaConstTau( converter.getLatticeRelaxationTime() );
    SuperLatticeFfromAnalyticalF2D<T, DESCRIPTOR> tau( anaConstTau, sLattice );
    vtmWriter.addFunctor( tau );

    Best,
    Nicolas

    • This reply was modified 5 years, 1 month ago by Nicolas.
    #4516
    guojuw
    Participant

    Hi Nicolas,

    I mean printing the non-constant relaxation time from non-Newtonian modeling, for example, the power-law case in $openlbRoot/examples/laminar/powerLaw2d.

    In other words, I just want to see the relaxation time from each cell at any time step if I am using the DynOmegaD2Q9Descriptor.

    Regards,
    Junwei Guo

    #4522
    Aurelio H
    Participant

    Hi Guo,

    The descriptor that you are using stores omega in an external field. You may see it in file src/dynamics/dynOmegaLatticeDescriptors.h, where DynOmegaD2Q9Descriptor is defined.

    I would suggest using:

    SuperLatticeField3D<T,DESCRIPTOR,OMEGA> omegaLB (sLattice);
    vtkWriter.addFunctor(omegaLB);

    This would print the relaxation frequency (omega) in lattice units to the VTK file. Is this what you are looking for?

    Cheers,
    Aurelio

    #4523
    guojuw
    Participant

    Dear Aurelio,

    Great! Thanks a lot. It helps me.

    Regard,
    Junwei Guo

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