Skip to content

Segmentation fault for OpenLB 1.5

OpenLB – Open Source Lattice Boltzmann Code Forums on OpenLB General Topics Segmentation fault for OpenLB 1.5

Viewing 4 posts - 16 through 19 (of 19 total)
  • Author
    Posts
  • #6767
    Fany
    Participant

    Hi Fedor,

    I am sorry that I did not see the periodic baoundaries in the rayleighBernard3d.

    In my case, I need to simulate the temperature and velocity distribution when the water flows the aorta structure (heating wall). The material 1 is water flowing from inlet to outlet as cooling source. The material 3 is inlet, and 4, 5 are the outlets.

    So I have just set the BC of wall (heating source) at constant temperature by the following functor:
    ”’
    setAdvectionDiffusionTemperatureBoundary<T,TDESCRIPTOR>(ADlattice, Tomega, superGeometry, 2)
    ”’
    I did not set the temperature BC for the inlet and outlet.

    and set the BC of inlet velocity and outlet pressure :
    ”’
    setLocalVelocityBoundary<T,NSDESCRIPTOR>(NSlattice, omega, superGeometry, 3);
    setInterpolatedPressureBoundary<T,NSDESCRIPTOR>(NSlattice, omega, superGeometry.getMaterialIndicator({4, 5}));
    ”’

    and then set the initial conditions:
    ”’
    AnalyticalConst3D<T,T> rhoF(1.);
    AnalyticalConst3D<T,T> uF( 0.0, converter.getLatticeVelocity(Re * converter.getPhysViscosity() / converter.getCharPhysLength()), 0.0);
    AnalyticalConst3D<T,T> u0(0.0, 0.0, 0.0);
    AnalyticalConst3D<T,T> T_cold(converter.getLatticeTemperature(Tcold));
    AnalyticalConst3D<T,T> T_hot(converter.getLatticeTemperature(Thot));

    // Initialize all values of distribution functions to their local equilibrium
    NSlattice.defineRhoU(superGeometry, 3, rhoF, uF);
    NSlattice.iniEquilibrium(superGeometry, 3, rhoF, uF);
    NSlattice.defineRhoU( superGeometry.getMaterialIndicator({1, 4, 5}),rhoF, u0 );
    NSlattice.iniEquilibrium( superGeometry.getMaterialIndicator({1, 4, 5}),rhoF, u0 );

    ADlattice.defineRho(superGeometry, 1, T_cold);
    ADlattice.iniEquilibrium(superGeometry, 1, T_cold, u0);
    ADlattice.defineRho(superGeometry, 2, T_hot);
    ADlattice.iniEquilibrium(superGeometry, 2, T_hot, u0);
    ADlattice.defineRho(superGeometry.getMaterialIndicator({ 4, 5}), T_cold);
    ADlattice.iniEquilibrium(superGeometry.getMaterialIndicator({ 4, 5}), T_cold, u0);
    ADlattice.defineRho(superGeometry, 3, T_cold);
    ADlattice.iniEquilibrium(superGeometry, 3, T_cold, u0);

    NSlattice.defineU( superGeometry, 3, uF );
    ”’

    All above BC settings can make my case work well in the OpenLB V1.4 but fail in V1.5.

    I am not sure if you mean I need to set the Temperature BC at one inlet and two outlets.

    BR,
    Fany

    #6768
    FBukreev
    Keymaster

    Hi Fany,

    for the wall the temperature BC is correct, for inlet and outlets You shuold take the setAdvectionDiffusionConvectionBoundary in Your case. This is the zero gradient BC.

    BR,
    Fedor

    #6769
    Fany
    Participant

    Hi Fedor,

    Many thanks for your help. I added
    “setAdvectionDiffusionConvectionBoundary<T,TDESCRIPTOR>(ADlattice, superGeometry.getMaterialIndicator({3, 4, 5}))”.

    but there was still the segmentation fault:
    ”’
    [prepareGeometry] Prepare Geometry … OK
    [prepareLattice] Prepare Lattice …
    [prepareLattice] Prepare Lattice …
    [prepareLattice] Prepare Lattice …
    [prepareLattice] Prepare Lattice …
    [prepareLattice] Prepare Lattice …
    [prepareLattice] Prepare Lattice …
    [prepareLattice] Prepare Lattice …
    [prepareLattice] Prepare Lattice …
    ————————————————————————–
    Primary job terminated normally, but 1 process returned
    a non-zero exit code. Per user-direction, the job has been aborted.
    ————————————————————————–
    ————————————————————————–
    mpiexec noticed that process rank 0 with PID 55086 on node chem001 exited on signal 11 (Segmentation fault).
    ”’

    Do I need to set other BCs except the following BCs in my case?
    ”’
    // Boundary condition
    setAdvectionDiffusionTemperatureBoundary<T,TDESCRIPTOR>(ADlattice, Tomega, superGeometry, 2);
    setLocalVelocityBoundary<T,NSDESCRIPTOR>(NSlattice, omega, superGeometry, 2);

    setLocalVelocityBoundary<T,NSDESCRIPTOR>(NSlattice, omega, superGeometry, 3);
    setInterpolatedPressureBoundary<T,NSDESCRIPTOR>(NSlattice, omega, superGeometry.getMaterialIndicator({4, 5}));

    setAdvectionDiffusionConvectionBoundary<T,TDESCRIPTOR>(ADlattice, superGeometry.getMaterialIndicator({3, 4, 5}));

    AnalyticalConst3D<T,T> rhoF(1.);
    AnalyticalConst3D<T,T> uF( 0.0, converter.getLatticeVelocity(Re * converter.getPhysViscosity() / converter.getCharPhysLength()), 0.0);
    AnalyticalConst3D<T,T> u0(0.0, 0.0, 0.0);
    AnalyticalConst3D<T,T> T_cold(converter.getLatticeTemperature(Tcold));
    AnalyticalConst3D<T,T> T_hot(converter.getLatticeTemperature(Thot));

    // Initialize all values of distribution functions to their local equilibrium
    NSlattice.defineRhoU(superGeometry, 3, rhoF, uF);
    NSlattice.iniEquilibrium(superGeometry, 3, rhoF, uF);
    NSlattice.defineRhoU( superGeometry.getMaterialIndicator({1, 4, 5}),rhoF, u0 );
    NSlattice.iniEquilibrium( superGeometry.getMaterialIndicator({1, 4, 5}),rhoF, u0 );

    ADlattice.defineRho(superGeometry, 1, T_cold);
    ADlattice.iniEquilibrium(superGeometry, 1, T_cold, u0);
    ADlattice.defineRho(superGeometry, 2, T_hot);
    ADlattice.iniEquilibrium(superGeometry, 2, T_hot, u0);
    ADlattice.defineRho(superGeometry.getMaterialIndicator({ 4, 5}), T_cold);
    ADlattice.iniEquilibrium(superGeometry.getMaterialIndicator({ 4, 5}), T_cold, u0);
    ADlattice.defineRho(superGeometry, 3, T_cold);
    ADlattice.iniEquilibrium(superGeometry, 3, T_cold, u0);

    NSlattice.defineU( superGeometry, 3, uF );

    ADlattice.setParameter<descriptors::OMEGA>(converter.getLatticeThermalRelaxationFrequency());
    NSlattice.setParameter<descriptors::OMEGA>(converter.getLatticeRelaxationFrequency());

    // Lattice initialize
    NSlattice.initialize();
    ADlattice.initialize();

    ”’

    BR,
    Fan

    #6770
    mathias
    Keymaster

    Dear Fany,

    that is more than we can help in the forum. In the framework of a common project, we can help.

    Best
    Mathias

Viewing 4 posts - 16 through 19 (of 19 total)
  • You must be logged in to reply to this topic.