jb
Forum Replies Created
-
AuthorPosts
-
jbMember
Ok, great! Thanks for the update with the improved fix.
jbMemberIn certain locations I want to apply a drag force to the flow. I implemented it with forced dynamics and by modifying the external field. (Which is, if i’m correct, very similar to how the fringe region works?) I guess I was just confused at first because as a beginner with (Open)LB I thought a certain descriptor is defined for all lattice points, so I had SmagorinskyLinearVelocityForcedBGKdynamics for the whole domain. Now I have defined my own descriptor with external field and applied it to those locations with a drag force.
jbMemberDear OLB team,
I have a question about the implementation of body forces.
What would be the most efficient way to implement a drag force (based on a drag coefficient) to certain lattice points? I think the problem is that I cannot use a linear force model, as the drag force is quadratic. What would you suggest is the most efficient way of implementing a drag force?edit: I fixed it by making a new SmagorinskyQuadraticVelocityForcedBGKdynamics, by copying the original SmagorinskyLinearVelocityForcedBGKdynamics code and changing:
Code:force[iDim] += v[jDim + iDim*nDim + nDim]*u[jDim][b]* std::abs(u[jDim])[/b];Thank you very much for your help,
JuliaanjbMemberCool, i got the fringe region to work. Using the Fringe2D function with SmagorinskyLinearVelocityForcedBGKdynamics is definitely the best option, no speed reduction!
jbMemberThanks for the help! My implementation works now! (although it definitely slows down the simulation)
Albert,
If I understand correctly, the Fringe2D function in OpenLB returns the coefficients to be used with a ‘linear velocity force model’. Is it then correct that the coefficients need to be used with SmagorinskyLinearVelocityForcedBGKdynamics ?Thanks for your help,
JuliaanjbMemberOh ok, stupid of me! I didn’t know!
Ok I found it on the developers guide.
Thanks!jbMembersmall correction/addition:
– The code works fine without MPI, also for multiple Cuboids. The problem only arises with MPI.
– The fringe region sets the inflow, I don’t add any other external force to the fluid voxels.
– I am working this out first in 2D. Later I will go to 3D.jbMemberHi Albert,
Thanks again.
Except for a small difference on the line “int mult = 2 / (d…” I didn’t find anything wrong. I actually think the problem is not with the slip-free bc, but potentially with the pressure outlet.Because I want to run high Reynolds number cases I have opted for a pressure driven + periodic domain approach and I have implemented a fringe region to set the inflow.
However, I have two questions:
1. when i try to run my simulations with MPI they fail over the following line of code (that I use to initialize the fringe region). For a simulation on 2 processors, the code fails when iCloc = 1.
Code:for (int iCloc = 0; iCloc < noOfCuboids; iCloc++) {
BlockGeometryStructure2D<T>& tmp = superGeometry.getBlockGeometry(iCloc);
dom_origin = tmp.getOrigin();
…
}Something goes wrong when I ask for the origin. Any suggestion what could be wrong here?
2.
I have tried to make the code as fast as possible by calculating as much as possible for the fringe region only once in the initialization phase. However, depending on the number of lattices included in the fringe region, the code has a slow down of 40-50%. I use the following function in the file superLattice2D.hh. Any suggestion on how I can reduce the computational cost for the fringe region?Code:template< typename T, template<typename U> class Lattice>
void SuperLattice2D<T,Lattice>::defineFringe( int* fringe_iCloc, int* fringe_iX, int* fringe_iY, T* fringe_weight, int fieldBeginsAt, int sizeOfField, T velocity, int fringe_N)
{
T fringeF[1];
T output[2];
for (int iR = 0; iR < fringe_N ; ++iR){
_extendedBlockLattices[ fringe_iCloc[iR] ].get( fringe_iX[iR] , fringe_iY[iR]).computeU(output);
fringeF[0] = fringe_weight[iR]*(output[0]-velocity);
_extendedBlockLattices[ fringe_iCloc[iR] ].get( fringe_iX[iR] , fringe_iY[iR]).defineExternalField (
fieldBeginsAt, sizeOfField, fringeF);
}Thanks a lot, your help is really appreciated,
JuliaanjbMemberHi Albert,
Ok, that is good to know. Do you have an idea when the fixed slip boundary will become available? Is this fix something I can already implement?
(I should mention that when I used the slip boundary I manually set the normals.)The results with a bounce-back look correct to me: https://ibb.co/gfwgMm
I think that the effects in the left corners are a logical result of using two different prescribed velocities in those edges (inlet and no-slip). I guess I should either use a pressure driven inlet/outlet (With a simple try this seemed to work at first, although eventually the simulation crashed, I will look more into it.) or prescribe a Poisseuile velocity profile like in the provided example ‘Cylinder3D’.Thanks for your help,
JuliaanjbMemberDear Albert,
Thank you very much for the reply.Good idea!
I just tried it, and this is the result: https://ibb.co/fYwtz6
(as a reference the material numbers: https://ibb.co/kkA8XR )It seems like this did not solve the problem. Actually it now also has a problem in the top left corner.
Do you have any other suggestions?Thanks,
Juliaan -
AuthorPosts