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 15 posts - 1 through 15 (of 19 total)
  • Author
    Posts
  • #6656
    Fany
    Participant

    Hello everyone,

    I am running my case by OpenLB 1.5 on the cluster in MPI. The code can work in OpenLB1.4, but always occurred segmentation fault in OpenLB1.5. Have you encountered the similar problems? Is there any ways to solve this problem? Problem code is as following.
    Thanks for your attention.

    [prepareLattice] Prepare Lattice …
    [csk061:125137] *** Process received signal ***
    [csk061:125137] Signal: Segmentation fault (11)
    [csk061:125137] Signal code: Address not mapped (1)
    [csk061:125137] Failing at address: (nil)
    [csk061:125137] [ 0] /usr/lib64/libpthread.so.0(+0xf630)[0x2aaaabab7630]
    [csk061:125137] [ 1] ./test3d[0x488650]
    [csk061:125137] [ 2] ./test3d[0x4b91ce]
    [csk061:125137] [ 3] ./test3d[0x4b933a]
    [csk061:125137] [ 4] ./test3d[0x41f259]
    [csk061:125137] [ 5] ./test3d[0x40acc7]
    [csk061:125137] [ 6] /usr/lib64/libc.so.6(__libc_start_main+0xf5)[0x2aaaabce6555]
    [csk061:125137] [ 7] ./test3d[0x40b14d]
    [csk061:125137] *** End of error message ***

    #6657
    Fany
    Participant

    Here is parts of my code:

    #include “olb3D.h”
    #include “olb3D.hh”

    // #ifndef OLB_PRECOMPILED // Unless precompiled version is used,
    // #include “olb3D.hh” // include full template code;
    // #endif
    #include <vector>
    #include <cmath>
    #include <iostream>
    #include <fstream>

    using namespace olb;
    using namespace olb::descriptors;
    using namespace olb::graphics;
    using namespace olb::util;
    using namespace std;

    typedef double T;

    typedef D3Q19<FORCE> NSDESCRIPTOR;
    typedef D3Q7<VELOCITY> TDESCRIPTOR;

    //simulation parameters
    const int N = 35; // resolution of the model
    const int M = 100; // time discretization refinement
    const bool bouzidiOn = false; // choice of boundary condition
    const T maxPhysT = 50.; // max. simulation time in s, SI unit

    // === 2nd Step: Prepare Geometry ===

    // Instantiation of the STLreader class
    // file name, voxel size in meter, stl unit in meter, outer voxel no., inner voxel no.
    STLreader<T> stlReader( “test3d.stl”, converter.getConversionFactorLength(), 0.001, 0, true );
    IndicatorLayer3D<T> extendedDomain( stlReader, converter.getConversionFactorLength() );

    // Instantiation of a cuboidGeometry with weights
    #ifdef PARALLEL_MODE_MPI
    const int noOfCuboids =std::min( 16*N,2*singleton::mpi().getSize() ) ; //2*singleton::mpi().getSize()
    #else
    const int noOfCuboids = 2;
    #endif
    CuboidGeometry3D<T> cuboidGeometry( extendedDomain, converter.getConversionFactorLength(), noOfCuboids );

    // Instantiation of a loadBalancer
    HeuristicLoadBalancer<T> loadBalancer( cuboidGeometry );

    // Instantiation of a superGeometry
    SuperGeometry<T,3> superGeometry( cuboidGeometry, loadBalancer, 2);

    prepareGeometry( converter, extendedDomain, stlReader, superGeometry );

    // === 3rd Step: Prepare Lattice ===
    SuperLattice<T, TDESCRIPTOR> ADlattice(superGeometry);
    SuperLattice<T, NSDESCRIPTOR> NSlattice(superGeometry);

    // ForcedBGKdynamics<T, NSDESCRIPTOR> NSbulkDynamics(
    // converter.getLatticeRelaxationFrequency(),
    // instances::getBulkMomenta<T,NSDESCRIPTOR>());

    // AdvectionDiffusionBGKdynamics<T, TDESCRIPTOR> TbulkDynamics (
    // converter.getLatticeThermalRelaxationFrequency(),
    // instances::getAdvectionDiffusionBulkMomenta<T,TDESCRIPTOR>());

    // std::vector<T> dir{0.0, 1.0, 0.0};

    // T boussinesqForcePrefactor = 9.81 / converter.getConversionFactorVelocity() * converter.getConversionFactorTime() *
    // converter.getCharPhysTemperatureDifference() * converter.getPhysThermalExpansionCoefficient();

    ///T boussinesqForcePrefactor=0;

    //NavierStokesAdvectionDiffusionCouplingGenerator3D<T,NSDESCRIPTOR> coupling(0, converter.getLatticeLength(0.2388403+0.0058006 ), 0, converter.getLatticeLength(0.249987+0.0112342),
    //0, converter.getLatticeLength(0.02246+0.0054686), boussinesqForcePrefactor, converter.getLatticeTemperature(Tcold), 1., dir);

    //NSlattice.addLatticeCoupling(coupling, ADlattice);

    Timer<T> timer1( converter.getLatticeTime( maxPhysT ), superGeometry.getStatistics().getNvoxel() );
    timer1.start();

    prepareLattice(converter,
    NSlattice, ADlattice,

    stlReader,
    superGeometry );

    timer1.stop();
    timer1.printSummary();

    // === 4th Step: Main Loop with Timer ===
    clout << “starting simulation…” << std::endl;
    Timer<T> timer( converter.getLatticeTime( maxPhysT ), superGeometry.getStatistics().getNvoxel() );
    timer.start();

    for ( std::size_t iT = 0; iT <= converter.getLatticeTime( maxPhysT ); iT++ ) {

    // === 5th Step: Definition of Initial and Boundary Conditions ===
    setBoundaryValues(converter, NSlattice, ADlattice, iT, superGeometry);

    // === 6th Step: Collide and Stream Execution ===

    NSlattice.collideAndStream();
    ADlattice.collideAndStream();

    //NSlattice.executeCoupling();

    // === 7th Step: Computation and Output of the Results ===
    getResults( converter, NSlattice, ADlattice, iT, superGeometry, timer, stlReader);

    }

    timer.stop();
    timer.printSummary();
    }

    #6658
    Adrian
    Keymaster

    It is hard to tell what the problem is in this case without a full listing or at least a backtrace with debug symbols enabled. So the following is just guesswork:

    As the code worked in 1.4 and fails in 1.5 I suspect that the issue is in the refactoring of the old dynamics definition to the new style. e.g. the replacement of your commented out

    
    ForcedBGKdynamics<T, NSDESCRIPTOR> NSbulkDynamics(
      converter.getLatticeRelaxationFrequency(),
      instances::getBulkMomenta<T,NSDESCRIPTOR>());
    
    AdvectionDiffusionBGKdynamics<T, TDESCRIPTOR> TbulkDynamics (
      converter.getLatticeThermalRelaxationFrequency(),
      instances::getAdvectionDiffusionBulkMomenta<T,TDESCRIPTOR>());
    
    // (NS,AD)lattice.defineDynamics(...) in prepareLattice
    

    in the prepareLattice function. Can you provide the relevant section / a full listing of prepareLattice?

    It should look similar to:

    
    NSlattice.defineDynamics<ForcedBGKdynamics>(...);
    NSlattice.setParameter<descriptors::OMEGA>(converter.getLatticeRelaxationFrequency());
    

    respectively

    
    ADlattice.defineDynamics<AdvectionDiffusionBGKdynamics>(...);
    ADlattice.setParameter<descriptors::OMEGA>(converter.getLatticeThermalRelaxationFrequency());
    

    I hope this helps.

    #6659
    Fany
    Participant

    Hi Adrian,
    Many thanks for your recommendation. I changed it, but there was a problem (MPI mode) as following:
    [prepareGeometry] Prepare Geometry …
    mlx5: csk060.cluster: got completion with error:
    00000000 00000000 00000000 00000000
    00000000 00000000 00000000 00000000
    00000000 00000000 00000000 00000000
    00000000 1f006802 0a009a4b 002ffcd2

    What’s more, when I ran it by serial mode (MPI mode off), there was still a problem:
    [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 26350 on node csk060 exited on signal 11 (Segmentation fault).
    ————————————————————————–

    Here is my code of prepareGeometry, prepareLattice and setboundary:

    void prepareGeometry( ThermalUnitConverter<T, NSDESCRIPTOR, TDESCRIPTOR> &converter, IndicatorF3D<T>& indicator,
    STLreader<T>& stlReader, SuperGeometry<T,3>& superGeometry )
    {

    OstreamManager clout( std::cout,”prepareGeometry” );
    clout << “Prepare Geometry …” << std::endl;

    superGeometry.rename( 0,2,indicator );

    superGeometry.rename( 2,1,stlReader );
    superGeometry.clean();

    // Set material number for inflow
    IndicatorCircle3D<T> inflow( 0.218125,0.249987,0.0234818, 0., 1.,0., 0.0112342 );
    IndicatorCylinder3D<T> layerInflow( inflow, 2.*converter.getConversionFactorLength() );
    superGeometry.rename( 2,3,1,layerInflow );

    // Set material number for outflow0
    //IndicatorCircle3D<T> outflow0(0.2053696,0.0900099,0.0346537, 2.5522,5.0294,-1.5237, 0.0054686 );
    IndicatorCircle3D<T> outflow0( 0.2053696,0.0900099,0.0346537, 0.,-1.,0., 0.0054686 );
    IndicatorCylinder3D<T> layerOutflow0( outflow0, 2.*converter.getConversionFactorLength() );
    superGeometry.rename( 2,4,1,layerOutflow0 );

    // Set material number for outflow1
    //IndicatorCircle3D<T> outflow1(0.2388403,0.0900099,0.0343228, -1.5129,5.1039,-2.8431, 0.0058006 );
    IndicatorCircle3D<T> outflow1( 0.2388403,0.0900099,0.0343228, 0.,-1.,0., 0.0058006 );
    IndicatorCylinder3D<T> layerOutflow1( outflow1, 2.*converter.getConversionFactorLength() );
    superGeometry.rename( 2,5,1,layerOutflow1 );

    // Removes all not needed boundary voxels outside the surface
    superGeometry.clean();
    // Removes all not needed boundary voxels inside the surface
    superGeometry.innerClean( 3 );

    superGeometry.checkForErrors();

    superGeometry.print();
    clout << “Prepare Geometry … OK” << std::endl;
    }

    // Set up the geometry of the simulation
    void prepareLattice( ThermalUnitConverter<T, NSDESCRIPTOR, TDESCRIPTOR> &converter,
    SuperLattice<T, NSDESCRIPTOR>& NSlattice,
    SuperLattice<T, TDESCRIPTOR>& ADlattice,

    STLreader<T>& stlReader,
    SuperGeometry<T,3>& superGeometry )
    {
    OstreamManager clout( std::cout,”prepareLattice” );
    clout << “Prepare Lattice …” << std::endl;

    T omega = converter.getLatticeRelaxationFrequency();
    T Tomega = converter.getLatticeThermalRelaxationFrequency();

    // material=0 –> do nothing
    ADlattice.defineDynamics<NoDynamics>(superGeometry, 0);
    NSlattice.defineDynamics<NoDynamics>(superGeometry, 0);

    // material=1 –> bulk dynamics
    //lattice.defineDynamics( superGeometry,1,&bulkDynamics );
    ADlattice.defineDynamics<AdvectionDiffusionBGKdynamics>(superGeometry, 1);
    NSlattice.defineDynamics<ForcedBGKdynamics>(superGeometry, 1);

    if ( bouzidiOn ) {
    // // material=2 –> no dynamics + bouzidi zero velocity
    ADlattice.defineDynamics<AdvectionDiffusionBGKdynamics>(superGeometry, 2);
    setAdvectionDiffusionTemperatureBoundary<T,TDESCRIPTOR>(ADlattice, Tomega, superGeometry, 2);

    NSlattice.defineDynamics<NoDynamics>(superGeometry, 2);
    setBouzidiZeroVelocityBoundary<T,NSDESCRIPTOR>(NSlattice, superGeometry, 2, stlReader);

    // // material=3 –> no dynamics + bouzidi velocity (inflow)
    ADlattice.defineDynamics<AdvectionDiffusionBGKdynamics>( superGeometry, 3);
    NSlattice.defineDynamics<NoDynamics>( superGeometry, 3);
    setBouzidiVelocityBoundary<T,NSDESCRIPTOR>(NSlattice, superGeometry, 3, stlReader);

    }
    else {
    // material=2 –> bounceBack dynamics
    ADlattice.defineDynamics<AdvectionDiffusionBGKdynamics>(superGeometry, 2);
    setAdvectionDiffusionTemperatureBoundary<T,TDESCRIPTOR>(ADlattice, Tomega, superGeometry, 2);
    NSlattice.defineDynamics<BounceBack>(superGeometry, 2);
    // setLocalVelocityBoundary<T,NSDESCRIPTOR>(NSlattice, omega, superGeometry, 2);

    // material=3 –> bulk dynamics + velocity (inflow)
    ADlattice.defineDynamics<AdvectionDiffusionBGKdynamics>( superGeometry, 3);
    NSlattice.defineDynamics<ForcedBGKdynamics>( superGeometry, 3);
    setLocalVelocityBoundary<T,NSDESCRIPTOR>(NSlattice, omega, superGeometry, 3);

    }

    // material=4,5 –> bulk dynamics + pressure (outflow)
    ADlattice.defineDynamics<AdvectionDiffusionBGKdynamics>( superGeometry.getMaterialIndicator({4, 5}));
    NSlattice.defineDynamics<ForcedBGKdynamics>( superGeometry.getMaterialIndicator({4, 5}));

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

    // AnalyticalConst3D<T,T> rhoF( 1 );
    // std::vector<T> velocity( 3,T() );
    // AnalyticalConst3D<T,T> uF( velocity );

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

    clout << “Prepare Lattice … OK” << std::endl;
    }

    void setBoundaryValues(ThermalUnitConverter<T, NSDESCRIPTOR, TDESCRIPTOR> &converter,
    SuperLattice<T, NSDESCRIPTOR>& NSlattice,
    SuperLattice<T, TDESCRIPTOR>& ADlattice,
    int iT, SuperGeometry<T,3>& superGeometry)
    {

    if (iT == 0) {

    // T u_Re = converter.getLatticeVelocity( Re * converter.getPhysViscosity() / converter.getCharPhysLength() );

    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 );

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

    }

    }

    #6660
    Fany
    Participant

    Here is the whole error log of MPI mode

    [prepareGeometry] Prepare Geometry … OK
    mlx5: csk062.cluster: got completion with error:
    00000000 00000000 00000000 00000000
    00000000 00000000 00000000 00000000
    00000000 00000000 00000000 00000000
    00000000 1f006802 0a00db26 096ddcd3
    mlx5: csk062.cluster: got completion with error:
    00000000 00000000 00000000 00000000
    00000000 00000000 00000000 00000000
    00000000 00000000 00000000 00000000
    00000000 1f006802 0a00db24 098809d3
    [csk062:07276] *** An error occurred in MPI_Wait
    [csk062:07276] *** reported by process [815464449,5]
    [csk062:07276] *** on communicator MPI COMMUNICATOR 7 DUP FROM 0
    [csk062:07276] *** MPI_ERR_INTERN: internal error
    [csk062:07276] *** MPI_ERRORS_ARE_FATAL (processes in this communicator will now abort,
    [csk062:07276] *** and potentially your MPI job)
    [csk062.cluster:07267] 5 more processes have sent help message help-mpi-errors.txt / mpi_errors_are_fatal
    [csk062.cluster:07267] Set MCA parameter “orte_base_help_aggregate” to 0 to see all help / error messages

    #6684
    Adrian
    Keymaster

    What’s more, when I ran it by serial mode (MPI mode off), there was still a problem:
    [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 26350 on node csk060 exited on signal 11 (Segmentation fault).
    ————————————————————————–

    So you ran the sequential mode in MPI here?

    Can you recompile the failing non-MPI case in debug mode and post the backtrace? (start e.g. in gdb and print the backtrace from there using bt).

    #6738
    Fany
    Participant

    Hi Adrian,

    I ran the code example aorta3d in the OpenLB v1.5 by mpi code. The error occurred as following.
    The sequential mode was fine. I would ask what problem it could be. Many thanks.

    ”’
    [main] starting simulation…
    mlx5: csk090.cluster: got completion with error:
    00000000 00000000 00000000 00000000
    00000000 00000000 00000000 00000000
    00000000 00000000 00000000 00000000
    00000000 1f006802 0a008778 123c0bd3
    mlx5: csk090.cluster: got completion with error:
    00000000 00000000 00000000 00000000
    00000000 00000000 00000000 00000000
    00000000 00000000 00000000 00000000
    00000000 1f006802 0a008775 0c44a0d2
    mlx5: csk090.cluster: got completion with error:
    00000000 00000000 00000000 00000000
    00000000 00000000 00000000 00000000
    00000000 00000000 00000000 00000000
    00000000 1f006802 0a00bbdc 0d1d45d2
    mlx5: csk090.cluster: got completion with error:
    00000000 00000000 00000000 00000000
    00000000 00000000 00000000 00000000
    00000000 00000000 00000000 00000000
    00000000 1f006802 0a008776 109fcfd2
    ”’
    Here is my setup on cluster:
    #!/bin/bash
    #SBATCH –time=2:00:00
    #SBATCH –nodes=1
    #SBATCH –ntasks=8
    module load gcc/9.2.0
    module load paraview
    module load openmpi
    module load make
    module load gnuplot
    make clean
    make cleanbuild
    make
    mpiexec ./aorta3d # mpiexec

    #6739
    Adrian
    Keymaster

    Sadly I can’t tell you anything from this output. You will need to compile it with debug symbols enabled and ideally run it in a debugger to obtain backtrace information.

    Does the example run in MPI mode on your local computer? Can you confirm whether other MPI-based applications work using the exact same approach on this cluster, using the same nodes?
    Do other OpenLB examples work with MPI?

    For me, the example works without issues both locally and on the clusters that I have access to.
    Of course there can still be problems with the code but we will need more details to find the reason.

    What did you configure in config.mk? (In order to avoid confusion: It is not enough to load the modules, the compiler and parallel mode still has to be configured in the config.mk file)

    #6740
    Fany
    Participant

    Hi Adrian,
    Thanks for your reply. The example rayleighBenard3d in OpenLB v1.5 can run on this cluster. I am checking the problem.

    #6761
    Fany
    Participant

    Hi Adrian,

    The examples “aorta3d” and “rayleighBenard3d” worked in our cluster.
    I was wanting to added the heat transfer into the case “aorta3d” (forced convective heat transfer). The new code can run in the OpenLB 1.4 but not 1.5.
    The Segmentation fault always occurred in the step “preparelattice” as following:
    ”’
    [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 1 with PID 43519 on node fluid028 exited on signal 11 (Segmentation fault).
    ————————————————————————–
    2 total processes killed (some possibly by mpiexec during cleanup)
    ”’

    Here is my preparelattice code:
    void prepareLattice( ThermalUnitConverter<T, NSDESCRIPTOR, TDESCRIPTOR> const& converter,
    SuperLattice<T, NSDESCRIPTOR>& NSlattice,
    SuperLattice<T, TDESCRIPTOR>& ADlattice,
    STLreader<T>& stlReader,
    SuperGeometry<T,3>& superGeometry )
    {
    OstreamManager clout( std::cout,”prepareLattice” );
    clout << “Prepare Lattice …” << std::endl;

    T omega = converter.getLatticeRelaxationFrequency();
    T Tomega = converter.getLatticeThermalRelaxationFrequency();

    // material=0 –> do nothing
    ADlattice.defineDynamics<NoDynamics>(superGeometry, 0);
    NSlattice.defineDynamics<NoDynamics>(superGeometry, 0);

    // material=1 –> bulk dynamics
    //lattice.defineDynamics( superGeometry,1,&bulkDynamics );
    ADlattice.defineDynamics<AdvectionDiffusionBGKdynamics>(superGeometry, 1);
    NSlattice.defineDynamics<ForcedBGKdynamics>(superGeometry, 1);

    // material=2 –> bounceBack dynamics
    ADlattice.defineDynamics<AdvectionDiffusionBGKdynamics>(superGeometry, 2);
    setAdvectionDiffusionTemperatureBoundary<T,TDESCRIPTOR>(ADlattice, Tomega, superGeometry, 2);
    NSlattice.defineDynamics<BounceBack>(superGeometry, 2);
    // setLocalVelocityBoundary<T,NSDESCRIPTOR>(NSlattice, omega, superGeometry, 2);

    // material=3 –> bulk dynamics + velocity (inflow)
    ADlattice.defineDynamics<AdvectionDiffusionBGKdynamics>( superGeometry, 3);
    NSlattice.defineDynamics<ForcedBGKdynamics>( superGeometry, 3);
    setLocalVelocityBoundary<T,NSDESCRIPTOR>(NSlattice, omega, superGeometry, 3);

    // material=4,5 –> bulk dynamics + pressure (outflow)
    ADlattice.defineDynamics<AdvectionDiffusionBGKdynamics>( superGeometry.getMaterialIndicator({4, 5}));
    NSlattice.defineDynamics<ForcedBGKdynamics>( superGeometry.getMaterialIndicator({4, 5}));

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

    // AnalyticalConst3D<T,T> rhoF( 1 );
    // std::vector<T> velocity( 3,T() );
    // AnalyticalConst3D<T,T> uF( velocity );

    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();

    clout << “Prepare Lattice … OK” << std::endl;
    }

    I would like to know if the new version transfer the “BulkDynamics” in NSDESCRIPTOR to DESCRIPTOR. In last version, I can use this function from NSDESCRIPTOR. but in version 1.5, there is just ForcedBGKdynamics in NSDESCRIPTOR.

    Best regards,
    Fany

    #6762
    FBukreev
    Keymaster

    Hi Fany,

    there is no difference how to call the Descriptor or how You choose the BulkDynamics, the mein point is to keep these names consistent through Your whole Setup. You can set BulkDynamics to ForcedBGK or some other dynamics, it should work without problems. I don’t see the ADE boundary conditions except the TempreatureBC on the wall. What happens on other BCs?

    Best regards,
    Fedor

    #6763
    Fany
    Participant

    Hi Fedor,

    Thanks for your reply. There were BC of inlet velocity and outlet pressure, as the above mentioned code:
    ”’
    setLocalVelocityBoundary<T,NSDESCRIPTOR>(NSlattice, omega, superGeometry, 3);
    setInterpolatedPressureBoundary<T,NSDESCRIPTOR>(NSlattice, omega, superGeometry.getMaterialIndicator({4, 5}));
    NSlattice.defineU( superGeometry, 3, uF ); # initial conditions
    ”’
    By the way, the difference of my code between V1.4 (BulkDynamics) and v1.5 (ForcedBGKdynamics) was just different Dynamics. I am not know if there are any changes in the new version. The new guidance do not present it.

    Best regards,
    Fany

    #6764
    FBukreev
    Keymaster

    Hi Fany,

    I mean BCs for the Temperature lattice.
    There is no difference if you write BulkDynamics = ForcedBGKdynamics and then use BulkDynamics by prepareLattice or if you type directly ForcedBGKdynamics in the defineDynamics commands.

    Greetings
    Fedor

    #6765
    Fany
    Participant

    Hi Fedor,

    Many thanks for your reply. I referred to the examples “aorta3d” and “rayleighBenard3d” . It seems that there was just “setAdvectionDiffusionTemperatureBoundary” for heating source needing to be consider. Other materials are just needing to set the initial conditions based on the setup. What BC functions are needed for the Temperature lattice in my case (forced convective heat transfer)?

    Best regards,
    Fany

    #6766
    FBukreev
    Keymaster

    Hi Fany,

    in the rayleighBernard3d example there are periodic baoundaries, so there is an endless cube in two directions. In the aorta case You should first decide what type of temperature BCs You want to have at the walls, inlet and outlets.

    Greetings
    Fedor

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