Skip to content

Reply To: Temperature blow up in NS-ADE coupling

Due to recent bot attacks we have chanced the sign-up process. If you want to participate in our forum, first register on this website and then send a message via our contact form.

Forums on OpenLB General Topics Temperature blow up in NS-ADE coupling Reply To: Temperature blow up in NS-ADE coupling

#10477
Anonymous
Inactive

Hi,

Thanks for replying.

I did try the following modification, but hasn’t led to any improvement.

Appreciate your help.

Best, P Shenai


void prepareLattice( SuperLattice<T, NSDESCRIPTOR>& NSlattice,
                    SuperLattice<T, TDESCRIPTOR>& ADlattice,
                     ThermalUnitConverter<T, NSDESCRIPTOR, TDESCRIPTOR> &converter,
                     STLreader<T>& stlReader,
                     SuperGeometry<T,3>& superGeometry )
{
  OstreamManager clout( std::cout,"prepareLattice" );
  clout << "Prepare Lattice ..." << std::endl;

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

  // Material=1 -->bulk dynamics
  auto bulkIndicator = superGeometry.getMaterialIndicator({1});
  NSlattice.defineDynamics<BGKdynamics>(bulkIndicator);

  // Material=2 -->bounce back
  boundary::set<boundary::BounceBack>(NSlattice, superGeometry, 2);

  // Setting of the boundary conditions

  // if local boundary conditions are chosen
  //boundary::set<boundary::LocalVelocity>(sLattice, superGeometry, 3);
  //boundary::set<boundary::LocalPressure>(sLattice, superGeometry, 4);

  //if interpolated boundary conditions are chosen
  boundary::set<boundary::InterpolatedVelocity>(NSlattice, superGeometry, 3);
  boundary::set<boundary::InterpolatedPressure>(NSlattice, superGeometry, 4);

  // Material=5 -->bouzidi / bounce back
  //#ifdef BOUZIDI
  setBouzidiBoundary<T,NSDESCRIPTOR>(NSlattice, superGeometry, 5, stlReader);
  //#else
  //boundary::set<boundary::BounceBack>(NSlattice, superGeometry, 5);
  //#endif

  ADlattice.defineDynamics<AdvectionDiffusionBGKdynamics>(superGeometry, 1);
  ADlattice.defineDynamics<AdvectionDiffusionBGKdynamics>(superGeometry, 2);
  //ADlattice.defineDynamics<AdvectionDiffusionBGKdynamics>(superGeometry, 3);
  setZeroGradientBoundary<T,TDESCRIPTOR>(ADlattice, superGeometry, 3);
  //ADlattice.defineDynamics<AdvectionDiffusionBGKdynamics>(superGeometry, 4);
  setZeroGradientBoundary<T,TDESCRIPTOR>(ADlattice, superGeometry, 4);
  ADlattice.defineDynamics<AdvectionDiffusionBGKdynamics>(superGeometry, 5);

  setBouzidiBoundary<T,TDESCRIPTOR,BouzidiAdeDirichletPostProcessor>(ADlattice, superGeometry, 5, stlReader);

  // Initial conditions
  AnalyticalConst3D<T,T> rhoF(converter.getLatticeDensity(density));
  AnalyticalConst3D<T,T> uF(0, 0);
  AnalyticalConst3D<T,T> T_wall(converter.getLatticeTemperature(Twall));
  AnalyticalConst3D<T,T> T_fluid(converter.getLatticeTemperature(Tfluid));

  // Initialize all values of distribution functions to their local equilibrium
  NSlattice.defineRhoU(superGeometry, 1, rhoF, uF);
  NSlattice.iniEquilibrium(superGeometry, 1, rhoF, uF);

  ADlattice.defineRho(superGeometry, 1, T_fluid);
  ADlattice.iniEquilibrium(superGeometry, 1, T_fluid, uF);
  ADlattice.defineRho(superGeometry, 2, T_fluid);
  ADlattice.iniEquilibrium(superGeometry, 2, T_fluid, uF);
  //ADlattice.defineRho(superGeometry, 3, T_fluid);
  //ADlattice.iniEquilibrium(superGeometry, 3, T_fluid, uF);
  //ADlattice.defineRho(superGeometry, 4, T_fluid);
  //ADlattice.iniEquilibrium(superGeometry, 4, T_fluid, uF);
  ADlattice.defineRho(superGeometry, 5, T_wall);
  ADlattice.iniEquilibrium(superGeometry, 5, T_wall, uF);
  setBouzidiAdeDirichlet(ADlattice, superGeometry, 5, T_wall);

  NSlattice.setParameter<descriptors::OMEGA>(omega);
  ADlattice.setParameter<descriptors::OMEGA>(Tomega);

  // Make the lattice ready for simulation
  ADlattice.initialize();
  ADlattice.initialize();

  clout << "Prepare Lattice ... OK" << std::endl;
}