Neumann temperature boundary
OpenLB – Open Source Lattice Boltzmann Code › Forums › on OpenLB › General Topics › Neumann temperature boundary
 This topic has 8 replies, 5 voices, and was last updated 1 month ago by antoniowu.

AuthorPosts

May 6, 2022 at 2:17 pm #6546sahilbhapkar30Participant
Hello,
How can I impose the Neumann boundary condition in AdvectionDiffusion equation?
Is there any example where it does?Thankyou
SahilMay 9, 2022 at 4:52 pm #6558johannaParticipantHello Sahil,
unfortunately there is no example with Neumann boundary conditions for AdvectionDiffusion 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
JohannaMay 12, 2022 at 9:44 am #6561antoniowuParticipantHello 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 nx1 and copy them to the outlet cells at nx?
Best,
AntonioMay 13, 2022 at 10:36 am #6562johannaParticipantHello 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 nx1.
Alternatively you could use a PostProcessor. There you could use for example blockLattice.get(iX1,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,
JohannaMay 18, 2022 at 2:33 pm #6575antoniowuParticipantHello Johanna,
Thank you so much for the suggestions. I’ve created an AnalyticalF with SuperLatticeDensity2D and AnalyticalFfromSuperF2D. Then I extracted the temperature data at nx1 by inputting all the points (nx1, 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 nx1
_c.reserve(ny);for (int iY = 0; iY <= ny; iY++){
point[0] = nx1;
point[1] = iY;
AnalyticalTemp(previoustemp, point); //this calculates the temperature at nx1
_c.push_back(previoustemp[0]);
}
ADlattice.defineRho(…); //got lost hereRegards,
AntonioJune 4, 2022 at 7:16 pm #6618mathiasKeymasterDear Antonio,
for your task, I would rather recomment to write your own postProcessor.
Best
MathiasJune 15, 2022 at 7:49 am #6638antoniowuParticipantDear Mathias,
Thanks for your suggestion. I’ve created a new analytical functor to deal with this and it works now!
Cheers,
AntonioJune 15, 2022 at 11:05 pm #6640ramirofreileParticipantHello 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
July 8, 2022 at 7:56 am #6708antoniowuParticipantHello 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 
AuthorPosts
 You must be logged in to reply to this topic.