Skip to content

Regarding unit conversion in “cylinder2d” example.

OpenLB – Open Source Lattice Boltzmann Code Forums on Lattice Boltzmann Methods General Topics Regarding unit conversion in “cylinder2d” example.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #8109
    avrachan1
    Participant

    Dear Community,

    In the example file “cylinder2d.cpp”, in the beginning the following variables are defined.

    // Parameters for the simulation setup
    const int N = 10; // resolution of the model
    const T Re = 20.; // Reynolds number
    const T maxPhysT = 16; // max. simulation time in s, SI unit
    const T L = 0.1/N; // latticeL

    const T radiusCylinder = 0.05;

    The variable L is used in
    CuboidGeometry2D<T> cuboidGeometry( cuboid, L, noOfCuboids );
    making L -> physDeltaX (what one lattice unit corresponds to in physical length)

    In the unitconverter,

    312 UnitConverterFromResolutionAndRelaxationTime<T, DESCRIPTOR> const converter(
    313 int {N}, // resolution: number of voxels per charPhysL
    314 (T) 0.56, // latticeRelaxationTime: relaxation time, have to be greater than 0.5!
    315 (T) 2.0*radiusCylinder, // charPhysLength: reference length of simulation geometry
    316 (T) 0.2, // charPhysVelocity: maximal/highest expected velocity during simulation in __m / s__
    317 (T) 0.2*2.*radiusCylinder/Re, // physViscosity: physical kinematic viscosity in __m^2 / s__
    318 (T) 1.0 // physDensity: physical density in __kg / m^3__
    319 );

    we provide N and charPhysLength (=2.0*radiusCylinder), which means physDeltaX = charPhysLength/N (am I correct?).

    In this example L = 0.1/N = 2.*radiusCylinder/N, however if I change L, then converter.getphysDeltaX() -neq L. While in the rest of the code we use L as physDeltaX.

    If my understanding is correct, then somewhere we should define L=converter.getphysDeltaX() and not define L explicitly to make things consistent.

    Thanks and regards!

    #8115
    Adrian
    Keymaster

    Yes, you are correct. This is an artifact of back when OpenLB did not have a unit converter (cylinder2d is one of the oldest example cases).

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