Skip to content

Neumann temperature boundary

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #6546
    sahilbhapkar30
    Participant

    Hello,

    How can I impose the Neumann boundary condition in Advection-Diffusion equation?
    Is there any example where it does?

    Thank-you
    Sahil

    #6558
    johanna
    Participant

    Hello Sahil,

    unfortunately there is no example with Neumann boundary conditions for Advection-Diffusion equations.
    But you can simply use a difference quotient to transform your Neumann boundary into a Dirichlet boundary (fixed temperature boundary) and update it every timestep with a setBoundaryValues method.

    Best
    Johanna

    #6561
    antoniowu
    Participant

    Hello Johanna,

    I am also trying to implement the Neumann boundary condition for ADE. Can you please suggest how we can exact temperature data from the previous cells at nx-1 and copy them to the outlet cells at nx?

    Best,
    Antonio

    #6562
    johanna
    Participant

    Hello Antonio,

    you can access the temperature data via SuperLatticeDensity and then you could also convert it into an analytical functor with AnalyticalFfromSuperF…D if you have the physical coordinates for nx-1.
    Alternatively you could use a PostProcessor. There you could use for example blockLattice.get(iX-1,iY).computeRho().
    To set the boundary condition use in your App a setBoundaryValues method and the advectionDiffusionTemperatureBoundaries and set your value in every time step with LatticeName.defineRho(…)

    Best,
    Johanna

    #6575
    antoniowu
    Participant

    Hello Johanna,

    Thank you so much for the suggestions. I’ve created an AnalyticalF with SuperLatticeDensity2D and AnalyticalFfromSuperF2D. Then I extracted the temperature data at nx-1 by inputting all the points (nx-1, iY) into the analytical functor. However, I am not quite sure how to use LatticeName.defineRho(…) to set DIFFERENT boundary values. I usually use LatticeName.defineRho(SuperGeometry, MaterialNumber, AnalyticalConst2D) which sets all the boundary cells at the same value. Can you please further suggest on this?

    Code snippet:
    SuperLatticeDensity2D<T, TDESCRIPTOR> temperature(ADlattice);
    AnalyticalFfromSuperF2D<T> AnalyticalTemp(temperature);
    T point[2];
    T previoustemp[1];
    std::vector<T> _c; //initiate a vector to store all the temperature data at nx-1
    _c.reserve(ny);

    for (int iY = 0; iY <= ny; iY++){
    point[0] = nx-1;
    point[1] = iY;
    AnalyticalTemp(previoustemp, point); //this calculates the temperature at nx-1
    _c.push_back(previoustemp[0]);
    }
    ADlattice.defineRho(…); //got lost here

    Regards,
    Antonio

    #6618
    mathias
    Keymaster

    Dear Antonio,

    for your task, I would rather recomment to write your own postProcessor.

    Best
    Mathias

    #6638
    antoniowu
    Participant

    Dear Mathias,

    Thanks for your suggestion. I’ve created a new analytical functor to deal with this and it works now!

    Cheers,
    Antonio

    #6640
    ramirofreile
    Participant

    Hello Antonio,

    I have been trying to implement a Neumann boundary condition for the AD equation as well. Is there any chance you could share your way of implementing it to have it as a benchmark?
    I would greatly appreciate it,

    Thank you,

    Ramiro

    #6708
    antoniowu
    Participant

    Hello Ramiro,

    You can just follow Johanna’s advice, which is what I did. Besides, I wrote an analytical functor to deal with boundary values at the layer before the outlet.

    Regards,
    Antonio

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