Skip to content

Compatibility of setZeroGradientBoundary with D2Q5<VELOCITY, SOU

OpenLB – Open Source Lattice Boltzmann Code Forums on OpenLB General Topics Compatibility of setZeroGradientBoundary with D2Q5<VELOCITY, SOU

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #9452
    taki
    Participant

    Hello everyone!

    I’m trying to understand if setZeroGradientBoundary<T, TDESCRIPTOR> can be used with D2Q5<VELOCITY, SOURCE>.

    I’ve noticed that setAdvectionDiffusionTemperatureBoundary<T, TDESCRIPTOR> works fine, but I’m curious why setZeroGradientBoundary might not.

    Could someone clarify this for me?

    Thank you very much!

    • This topic was modified 6 days, 3 hours ago by taki.
    #9457
    Adrian
    Keymaster

    Did you take a look yourself and test the same way you tested the ADE temperature boundary?

    Without knowing more details one can not tell you whether any BC works for your specific application or not.

    #9458
    taki
    Participant

    I have tested the ADE temperature boundary condition.
    I would like to set the outflow to Neumann.
    I’m getting the error: ‘setZeroGradientBoundary’ was not declared in this scope. I’d like some advice on how to resolve this.

    void prepareLattice(SuperLattice<T, TDESCRIPTOR>& ADlattice, SuperGeometry<T, 2>& superGeometry, T rho, AdeUnitConverter<T, TDESCRIPTOR> converter) {
      OstreamManager clout(std::cout, "prepareLattice");
      clout << "Prepare Lattice ..." << std::endl;
    
      const T omega = converter.getLatticeAdeRelaxationFrequency();
    
      ADlattice.defineDynamics<SourcedAdvectionDiffusionBGKdynamics>(superGeometry, 1);
    
      AnalyticalConst2D<T, T> u(converter.getLatticeVelocity(flow_rate), converter.getLatticeVelocity(0.0));
      AnalyticalConst2D<T, T> rho0_(converter.getLatticeDensity(rho));
    
      // Setting of the boundary conditions, inflow, and outflow with Dirichlet condition
      setAdvectionDiffusionTemperatureBoundary<T, TDESCRIPTOR>(ADlattice, superGeometry.getMaterialIndicator(3));
      <strong>setZeroGradientBoundary<T, TDESCRIPTOR>(ADlattice, superGeometry.getMaterialIndicator({4}));</strong>
      
      //setAdvectionDiffusionTemperatureBoundary<T, TDESCRIPTOR>(ADlattice, superGeometry.getMaterialIndicator(4));
    
      ADlattice.setParameter<descriptors::OMEGA>(omega);
    
      auto bulkIndicator = superGeometry.getMaterialIndicator(1);
      auto everywhere = superGeometry.getMaterialIndicator({1, 2, 3, 4});
    
      // Setting flowrate inside reactor, as well as initial concentrations
      ADlattice.defineField<descriptors::VELOCITY>(everywhere, u);
      ADlattice.defineField<descriptors::SOURCE>(bulkIndicator, rho0_);
      ADlattice.defineRho(bulkIndicator, rho0_);
      ADlattice.iniEquilibrium(superGeometry, 1, rho0_, u);
    
      // Setting actual values for the boundary
      ADlattice.defineRho(superGeometry, 3, rho0_);
      ADlattice.iniEquilibrium(superGeometry, 3, rho0_, u);
      ADlattice.defineRho(superGeometry, 4, rho0_);
      ADlattice.iniEquilibrium(superGeometry, 4, rho0_, u);
    
      // Make the lattice ready for simulation
      ADlattice.initialize();
    
      clout << "Prepare Lattice ... OK" << std::endl;
    }
    
    #9463
    taki
    Participant

    I haven’t been able to solve it yet, so I would appreciate it if someone could answer.
    Thanks!

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