Skip to content

Couple LES-Boussinesq

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #5932
    POSThu
    Participant

    Dear all,

    I am trying to simulate a non-isothermal turbulent airflow field, and refering to the paper “OpenLB—Open source lattice Boltzmann code”, I think the couple of LES model with Boussinesq assumption can be achieved by the class “SmagorinskyBoussinesqCouplingGenerator3D”. And refering to the official thermal example case “squareCavity2d”, I wrote the code like this:

    
      SuperLattice3D<T, NSDESCRIPTOR> NSLattice( superGeometry_room );
      SuperLattice3D<T, TDESCRIPTOR> ADLattice( superGeometry_room );
    
    #ifdef TauEffLES
      ExternalTauEffLESForcedBGKdynamics<T, NSDESCRIPTOR> bulkDynamics(
        converter.getLatticeRelaxationFrequency(),
        instances::getBulkMomenta<T,NSDESCRIPTOR>(), 0.1);
    
      ExternalTauEffLESBGKdynamics<T, TDESCRIPTOR> TbulkDynamics(
        converter.getLatticeThermalRelaxationFrequency(),
        instances::getAdvectionDiffusionBulkMomenta<T,TDESCRIPTOR>(), 0.1);
    
    #elif defined(SMAGORINSKY)
      SmagorinskyForcedBGKdynamics<T, NSDESCRIPTOR> bulkDynamics(
        converter.getLatticeRelaxationFrequency(),
        instances::getBulkMomenta<T, NSDESCRIPTOR>(),0.1);
    
      SmagorinskyBGKdynamics<T, TDESCRIPTOR> TbulkDynamics(
        converter.getLatticeThermalRelaxationFrequency(),
        instances::getAdvectionDiffusionBulkMomenta<T,TDESCRIPTOR>(), 0.1);
    #else
      ForcedBGKdynamics<T, NSDESCRIPTOR> bulkDynamics(
        converter.getLatticeRelaxationFrequency(),
        instances::getBulkMomenta<T,NSDESCRIPTOR>());
    
      AdvectionDiffusionBGKdynamics<T, TDESCRIPTOR> TbulkDynamics(
        converter.getLatticeThermalRelaxationFrequency(),
        instances::getAdvectionDiffusionBulkMomenta<T,TDESCRIPTOR>());
    #endif
    
      std::vector<T> dir{0.0, 0.0, 1.0};
    
      T boussinesqForcePrefactor = 9.81 / converter.getConversionFactorVelocity() * converter.getConversionFactorTime() *
                                   converter.getCharPhysTemperatureDifference() * converter.getPhysThermalExpansionCoefficient();
    
    #if defined(TauEffLES)
      SmagorinskyBoussinesqCouplingGenerator3D<T, NSDESCRIPTOR>
      coupling(converter.getLatticeLength(-2-2*converter.getConversionFactorLength()), converter.getLatticeLength(2+2*converter.getConversionFactorLength()),
               converter.getLatticeLength(-2-2*converter.getConversionFactorLength()), converter.getLatticeLength(2+2*converter.getConversionFactorLength()),
               converter.getLatticeLength(-2*converter.getConversionFactorLength()), converter.getLatticeLength(4+2*converter.getConversionFactorLength()),
               boussinesqForcePrefactor, converter.getLatticeTemperature(Tinlet), 1., dir, 0.85, bulkDynamics.getPreFactor());
    #elif defined(SMAGORINSKY)
      SmagorinskyBoussinesqCouplingGenerator3D<T, NSDESCRIPTOR>
      coupling(converter.getLatticeLength(-2-2*converter.getConversionFactorLength()), converter.getLatticeLength(2+2*converter.getConversionFactorLength()),
               converter.getLatticeLength(-2-2*converter.getConversionFactorLength()), converter.getLatticeLength(2+2*converter.getConversionFactorLength()),
               converter.getLatticeLength(-2*converter.getConversionFactorLength()), converter.getLatticeLength(4+2*converter.getConversionFactorLength()),
               boussinesqForcePrefactor, converter.getLatticeTemperature(Tinlet), 1., dir, 0.85, bulkDynamics.getPreFactor());
    #else
      NavierStokesAdvectionDiffusionCouplingGenerator3D<T,NSDESCRIPTOR>
      coupling(converter.getLatticeLength(-2-2*converter.getConversionFactorLength()), converter.getLatticeLength(2+2*converter.getConversionFactorLength()),
               converter.getLatticeLength(-2-2*converter.getConversionFactorLength()), converter.getLatticeLength(2+2*converter.getConversionFactorLength()),
               converter.getLatticeLength(-2*converter.getConversionFactorLength()), converter.getLatticeLength(4+2*converter.getConversionFactorLength()),
               boussinesqForcePrefactor, converter.getLatticeTemperature(Tcold), 1., dir);
    #endif
    
      NSLattice.addLatticeCoupling(superGeometry_room, 1, coupling, ADLattice);
    

    After compiled the code, I tried to use different turbulent model by defining TauEffLES or SMAGORINSKY. When I defined TauEffLES, the program can output some results, and it seems that the two distribution functions have been coupled. However, when I defined SMAGORINSKY, the program can not be excuted and some errors have been outputed in the console, like this:

    
    ==== backtrace (tid:  12187) ====
     0 0x000000000004cb95 ucs_debug_print_backtrace()  ???:0
     1 0x000000000042f1f3 olb::SmagorinskyBoussinesqCouplingPostProcessor3D<double, olb::descriptors::D3Q19<olb::descriptors::FORCE> >::processSubDomain()  ???:0
     2 0x0000000000427404 olb::SmagorinskyBoussinesqCouplingPostProcessor3D<double, olb::descriptors::D3Q19<olb::descriptors::FORCE> >::process()  ???:0
     3 0x000000000040ed3c main()  ???:0
     4 0x0000000000022555 __libc_start_main()  ???:0
     5 0x000000000040f7df _start()  ???:0
    =================================
    [n1902:12187] *** Process received signal ***
    [n1902:12187] Signal: Segmentation fault (11)
    [n1902:12187] Signal code:  (-6)
    [n1902:12187] Failing at address: 0x86e00002f9b
    ==== backtrace (tid:  12140) ====
     0 0x000000000004cb95 ucs_debug_print_backtrace()  ???:0
     1 0x000000000042f1f3 olb::SmagorinskyBoussinesqCouplingPostProcessor3D<double, olb::descriptors::D3Q19<olb::descriptors::FORCE> >::processSubDomain()  ???:0
     2 0x0000000000427404 olb::SmagorinskyBoussinesqCouplingPostProcessor3D<double, olb::descriptors::D3Q19<olb::descriptors::FORCE> >::process()  ???:0
     3 0x000000000040ed3c main()  ???:0
     4 0x0000000000022555 __libc_start_main()  ???:0
     5 0x000000000040f7df _start()  ???:0
    

    I have tried some measures but the problem is still here. I hope someone can give me some advices. Thank you.

    Best Regards,
    Mengqiang

    #5969
    Adrian
    Keymaster

    If you post your full code I’d be happy to take a closer look.
    Did you already try running the code in unoptimized debug mode and checking the backtrace there?

    For a starting point the actual types of NSDESCRIPTOR and TDESCRIPTOR would be of interest.

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