Difference between revisions of "Contrib/swak4Foam/Example sectionalForces"
From OpenFOAMWiki
(Created page with " To calculate the forces on a selected parts of a patch, insert the following into the "functions" section in controlDict file, <cpp> forcesSectional { type patchExpression...") |
|||
Line 1: | Line 1: | ||
− | To calculate the forces on | + | To calculate the forces on selected parts of a patch, insert the following into the "functions" section in controlDict file, |
<cpp> | <cpp> | ||
forcesSectional | forcesSectional |
Latest revision as of 14:25, 25 March 2013
To calculate the forces on selected parts of a patch, insert the following into the "functions" section in controlDict file,
forcesSectional { type patchExpression; outputControl timeStep; enabled true; outputInterval 10; patches ( cylinder // change to your name or names of patch ); variables ( "position=0;" "rho=1000;" "nu=1.0E-06;" "pressure_force= p*rho*normal()*area();" "viscous_force= -rho*nu*snGrad(U)*area();" "forces= pressure_force+viscous_force;" ); expression "( pos().z > position-3 && pos().z < position+3) ? forces : vector(0,0,0)"; accumulations ( sum ); }
That would sum up the force for all faces which are within the range of -3<z<3 on patch "cylinder".