## Forum Replies Created

Viewing 8 posts - 1 through 8 (of 8 total)
• Author
Posts
• in reply to: Extrapolation scheme #5578
jonathan
Participant

Hi Mike,

setWallFunctionBoundaryuses its own implementation for extrapolation in 3D, which is not shared with other BCs for now. If you’re looking for something non-local for the outlet I would suggest setInterpolatedPressureBoundary.

But if you’re specifically after extrapolation, I’m afraid you’d have to implement it yourself.

Best Regards,
Jonathan

in reply to: Strong Vorticity on free-slip surface #5550
jonathan
Participant

Hi Vinh,

try to apply a threshold on geometry first in order to remove the material number 0 (ghost-) layer and the vorticity artifact.

At the top of your channel the highest finite velocity in your simulation at the slip boundary cell has a neighboring cell in the ghost layer with zero velocity. This is part of how OpenLB realizes parallelization and some interfaces and nothing wrong with your setup. ParaView calculates the vorticity based on that huge gradient at the top now resulting in what we can see on your pictures. If you have a look at the geometry field in ParaView you will always see the material 0 layer wrapping the entire domain.

Best,
Jonathan

#5497
jonathan
Participant

Hi Junwei,

@1.d.: Record a ParaView Python macro for the output, clean it up and it won’t be inconvenient for further usage.
This would be the fast, but dirty solution.

I usually avoid AnalyticalFfromSuperF3D when outputting discrete fields if I don’t need the interpolation.
I’m not aware of a standalone class for your purpose, but a long-term solution would be writing your output interface manually.

These are the relevant function calls I would use in a 1D scenario:

T minX = superGeometry.getStatistics().getMinPhysR(2)[0];
T maxX = superGeometry.getStatistics().getMaxPhysR(2)[0];
for(T iX = minX; iX < (maxX + converter.getPhysDeltaX()*0.5); iX+=converter.getPhysDeltaX()){
T pos_tmp[3] = {iX, somey, somez};
superGeometry.getCuboidGeometry().getLatticeR(latticeR, pos_tmp); //get lattice coordinates for wss output
superGeometry.getCuboidGeometry().getPhysR(pos_tmp, latticeR); //convert lattice coordinates into physical coordinates
WSS(output,latticeR);
//write output and pos_tmp to disk with fstream...
}

Add a barrier and some reduceAndBcasts depending on your MPI usage via singleton::mpi()… (maybe thats whats causing 0 outside the plane?)

Best
Jonathan

#5491
jonathan
Participant

I think I misunderstood your question there, sorry. If I now understand correctly you just want it to give you the vector components and not the magnitude. Go to the file I linked above (BlockLatticePhysWallShearStress3D) and look for

WSS[0] = traction[0] - tractionNormalComponent[0];
WSS[1] = traction[1] - tractionNormalComponent[1];
WSS[2] = traction[2] - tractionNormalComponent[2];

Replace WSS with output and remove the line with output[0] = sqrt(…). Then you need to increase the functor dimension of both Super and BlockLatticePhysWallShearStress3D to 3 in order to have 3 output components.

Hope this clarifies, as I originally thought you needed the stress tensor.

Best
Jonathan

#5490
jonathan
Participant

Hi Junwei,

wall shear stress is calculated from the stress tensor taking the wall normal vector into account.
The “general-purpose” stress tensor can be accessed on block level with:

sLattice.getBlockLattice(iC).computeStress(x, y, z, pi);,
To my knowledge there’s no functor implemented for that.
For just having the tensor components exposed to your application, you can iterate over every BlockLattice and use the above expression.

If you plan on using it as a functor a good starting point would be the SuperLatticePhysWallShearStress3D functor. Just copy it and remove anything to do with the normal vector calculation in the constructor of BlockLatticePhysWallShearStress3D and output the stress tensor directly. You will also see the computeStress there. Lastly you have to increase your functors output dimension to 6.

Best,
Jonathan

#4895
jonathan
Participant

Dear behnamandi,

we don’t currently have (partial-)slip treatment for boundaries other than axis-aligned or 45 deg walls – this is not an option for a pipe geometry.
But even with no-slip walls you actually account for some roughness coefficient known as hydraulically smooth.
You can calculate a present coefficient from the wall shear stress in your simulation.
Usually we can neglect additional friction from the material as viscous effects dominate over the entire diameter in the laminar pipe flow.
Therefore, we only have a very small influence of the relative roughness on the pressure drop.
Roughness gains importance in micro-channels or turbulent flow where the viscous sublayer is much smaller.
In such cases we underestimate the dissipation rate in the viscous sublayer and need modelling of friction effects near the wall.

I agree with you that higher gradients due to partial slip boundaries would increase the wall shear stress and the roughness coefficient.
Maybe you can define a velocity on the first fluid layer beyond the no-slip wall to artificially increase the tangential velocity components for a higher wall shear stress.

Hope this helps!

Jonathan

#4541
jonathan
Participant

An even easier way of achieving a static solution would be to just specify the field type inside the physFactor calculation.

_physFactor = -this->_blockLattice.get(input[0]+_overlap,input[1]+_overlap).template getFieldPointer<descriptors::OMEGA>()[0] * descriptors::invCs2<T,DESCRIPTOR>() / dt * this->_converter.getPhysDensity() * this->_converter.getPhysViscosity();

The method described in my first answer is more generic and necessary if you want to have easily swappable descriptors.

Best,
Jonathan

#4538
jonathan
Participant

Dear Junwei Guo,

BlockLatticePhysWallShearStress2D uses a constant relaxation frequency only in _physFactor for unit conversion. Its calculation can just be moved into the operator() for a cell dependant calculation.
AFAIK your descriptor DynOmegaD2Q9 stores omega in the external field and can therefore be accessed by a template variable.

Try changing the source of both Super- and BlockLatticePhysWallShearStress to provide a FIELD template argument. For a generic example see how its done in Super- and BlockLatticeField2D.
Then just replace omega in

_physFactor = -omega * descriptors::invCs2<T,DESCRIPTOR>() / dt * this->_converter.getPhysDensity() * this->_converter.getPhysViscosity();

with the computeField function for your desired external field and move the line to the top of the operator().

Best,
Jonathan

• This reply was modified 5 years ago by jonathan.
• This reply was modified 5 years ago by jonathan.
Viewing 8 posts - 1 through 8 (of 8 total)