CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Calculate the viscous forces on a patch (https://www.cfd-online.com/Forums/openfoam-programming-development/234541-calculate-viscous-forces-patch.html)

Su JH March 10, 2021 03:53

Calculate the viscous forces on a patch
 
Hello!

I am using foam-extend-3.2.
I want to obtain the forces and moments acting on a spherical particle in the channel flow. The forces and moments will be used to adjust the slip velocity on the particle surface. The forces are calculated by the script below and show to be different from the forces output by the libforces.so.


totalForce
{
type patchExpression;
outputControlMode timeStep;
enabled true;
outputInterval 1;
patches (
sphere_region0
// change to your name or names of patch
);
verbose true;
variables (
"position=0;"
"rho=1;"
"mu=1.0;"
"pressure_forces= rho*p*normal()*area();"
"viscous_forces= -mu*snGrad(U)*area();"
"forces=pressure_forces+viscous_forces;"
);
expression "forces";
accumulations ( sum );
}


Thank you in advance.

Su


All times are GMT -4. The time now is 08:20.