CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   Computing wall shear stress with a momentum flux balance (https://www.cfd-online.com/Forums/openfoam-post-processing/80759-computing-wall-shear-stress-momentum-flux-balance.html)

 Pomme-Poire October 5, 2010 17:39

Computing wall shear stress with a momentum flux balance

Good day foamers!

I would like to compute the wall shear stress doing a momentum flux balance on individual cells touching a wall patch. I know there is the utility called "wallShearStress" but I want to make sure that both methods gives about the same values.

My idea was to loop over cells individual faces the momentum fluxes and add them up and eventually substract the pressure gradient. Here's what I tried to begin with:

Code:

```surfaceVectorField momentumFlux = fvc::interpolate(U)*(fvc::interpolate(U) & mesh.Sf()); //fluxes at cell faces const surfaceVectorField::GeometricBoundaryField& patchMomentumFlux = momentumFlux.boundaryField();         forAll(patchMomentumFlux, patchi)     {         if (isType<wallFvPatch>(patchMomentumFlux[patchi]))         {         const labelList& faceCells =  mesh.boundary()[patchi].faceCells(); //getting near wall cells         forAll(faceCells,celli) //looping over near wall cells         {             vector sumMomentumFluxCellI = vector::zero;             forAll(mesh.Sf(),cellfacei)             {                   sumMomentumFluxCellI+=patchMomentumFlux[patchi].internalField()[celli][cellfacei]; //this doesnt work             }         } }```
Someone has any better ideas?

L-E.

 All times are GMT -4. The time now is 06:27.