Skip to content

Heat transfer liquid-solid and heat conduction in solids

OpenLB – Open Source Lattice Boltzmann Code Forums on OpenLB General Topics Heat transfer liquid-solid and heat conduction in solids

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #6823
    Matthias
    Participant

    Hey all,

    I want to simulate the surface temperature of a pipe that is cooled by a gas/fluid inside.
    To do this, I need the heat exchange of the fluid with the inside of the pipe and also the heat conduction within the pipe material.
    The exchange of the outside of the pipe with the environment is defined by the heat transfer coefficient.
    Can OpenLB simulate this or can the code be adapted for this?
    I would be very happy if someone can assess this, share experience or even give advice.

    With kind regards
    Matthias

    #6840
    FBukreev
    Keymaster

    Hello Matthias,

    it would be possible, if You take a larger calculation region for the pipe wall and perform there the temperature ADE with the wall material temperature conductivity -> other relaxation time. The velocity in the pipe must be set to 0. The heat flux to the environment must be defined as a source term, but possibly there must be written some new boundary condition.

    Kind regards,
    Fedor

    #7194
    Henderson_C
    Participant

    Dear FBukreev,

    Regarding the source term, how can I access and modify the source code? For example, I tried to look for the source term in the galliummelting2d example. But I was not able to locate it. Please guide me on how can I add the heat flux source term.

    Thanks,

    #7198
    FBukreev
    Keymaster

    Hello,

    the source term is an external field defined in the Descriptor like:
    using TDESCRIPTOR = D2Q5<VELOCITY,TEMPERATURE>;

    You can accesss this field from the setup in 2 ways:
    ADlattice.defineField<descriptors::VELOCITY>(superGeometry.getMaterialIndicator({1, 2, 3}), u0);
    The u0 is an AnalyticalFunctor then.

    The second way is if you want calculate some source term in each cell separately, then you need to write a method inside of the setup with the following scheme:

    template<typename T>
    void setTemperature(SuperLattice<T, DESCRIPTOR>& sLattice){
        for (int iC = 0; iC < sLattice.getLoadBalancer().size(); iC++) {
    
          int nx = sLattice.getBlock(iC).getNx();
          int ny = sLattice.getBlock(iC).getNy();
          int nz = sLattice.getBlock(iC).getNz();
    
          for (int iX = 0; iX < nx; ++iX) {
            for (int iY = 0; iY < ny; ++iY) {
              for (int iZ = 0; iZ < nz; ++iZ) {
    
                //calculation
                T scalar = someValue;
                sLatticeAD.getBlock(iC).get(iX,iY,iZ).template  setField<descriptors::TEMPERATURE>(scalar);
              }
            }
          }
        }
    }

    Greetings
    Fedor

    • This reply was modified 3 months, 2 weeks ago by FBukreev.
    • This reply was modified 3 months, 2 weeks ago by FBukreev.
    • This reply was modified 3 months, 2 weeks ago by FBukreev.
    • This reply was modified 3 months, 2 weeks ago by FBukreev.
    #7204
    Henderson_C
    Participant

    Dear Fedor,

    Thank you for our prompt reply. Instead of calculating or obtaining the velocity or temperature in a certain material number, I want to impose a heat source at certain space and time during the streaming and collision steps. However I am not sure if this is done through a source term.

    Best regards,

    #7205
    FBukreev
    Keymaster

    if you have the heat source then you need to use advection diffusion lbm for heat and then calculate tempreature fom it. But the sourtce term is anyway programmed on the way how I mentioned it above.

    Regards,
    Fedor

    #7208
    Henderson_C
    Participant

    Dear Fedor,

    I have modified the function to include a certain temperature at certain location, but the problem is that I do not see the temperature change when I visualize it in Paraview. What I understand from the above code, is that for a certain cell I can change the “Temperature” of a cell to a certain value.

    Regards,

    #7209
    FBukreev
    Keymaster

    Hello,

    yes, this is the way to change some value per cell.
    There are many reasons why the temperature does not change. You need to display the temperature value after each operation with ADE equation to find the reason.

    Regards
    Fedor

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