# forces functionObject with interFoam and dynamic pressure

 Register Blogs Members List Search Today's Posts Mark Forums Read

 October 26, 2018, 05:43 forces functionObject with interFoam and dynamic pressure #1 Member   Anna Feichtner Join Date: Dec 2016 Location: Cornwall (UK) Posts: 36 Rep Power: 8 Hello everybody I have two questions regarding the forces functionObject when using it with interFoam. Sometimes I confuse myself so I would like to clarify some things. 1. When using it with interFoam, I am using "forcesCompressible" and the input for "rho" is "rho" (and not "rhoInf"), as interFoam uses the the rho field because of being a multiphase solver - unlike other incompressible solvers, where rho is constant. Am I right with this? 2. As far as I understand, the force functionObject uses the p field, which is the static pressure, and does not include the dynamic pressure 0.5*rho*U^2 ? So I thought I can get the total pressure, as in total(p)= p + 0.5*rho*U^2, and use it as the input field "totalp" for the forces calculation. But this doesn't work and I get the error "Could not find U, totalp". Maybe I misunderstand something? Would be greatful to get some help With kind regards, Anna

 October 29, 2018, 05:32 #2 Member   Anna Feichtner Join Date: Dec 2016 Location: Cornwall (UK) Posts: 36 Rep Power: 8 Hi again, so my forces file looks like: Code: forcesFront { type forces; libs ("libforces.so"); log yes; patches (plateFrontPatch_half0); enabled true; writeControl timeStep; writeInterval 1; p total(p); //p; U U; rho rhoInf; rhoInf 1000; // Fluid density -> water 1000 kg/m3 CofR (5 0.005 0); //centre of rotation for moment calulation } So i set rho as constant rhoInf (regarding question 1.), as it's an incompressible case. If I set the pressure field to total(p) instead of p, I get this error message: Code: --> FOAM FATAL ERROR: Could not find U, total(p) From function void Foam::functionObjects::forces::initialise() in file forces/forces.C at line 197. ...still not sure, why it cannot find the calculated total(p) field. I would appreciate any ideas I keep feeling that these are stupid newbie-questions... Best wishes, Anna

 June 19, 2019, 20:24 #3 Member   Anna Feichtner Join Date: Dec 2016 Location: Cornwall (UK) Posts: 36 Rep Power: 8 To give an update on my questions: 1. I am right with this. 2. a) To get the total(p) field I am using the already available postProcessing function now (I have not seen that before). So I include in the controlDict: Code: functions { #includeFunc totalPressureCompressible } and execute it with: Code: interFoam -postProcess -fields "(p U)" -func totalPressureCompressible b) The forcesFunction utility still cannot find the total(p) field and I still don't know why. c) So if I want to calculate the forces with total(p) am using "areaIntegrate" directly in a dictionary (that I include in the controlDict - functions{} again: Code: #includeFunc totalForce Code: totalForce { #includeEtc "caseDicts/postProcessing/surfaceFieldValue/surfaceRegion.cfg" operation areaIntegrate; fields (p total(p)); regionType patch; name patch1; writeControl timeStep; writeInterval 1 } ChiaraViola likes this.

 June 20, 2019, 11:15 #4 Member   Hector Join Date: Jul 2010 Location: Barcelona Posts: 30 Rep Power: 15 No idea why you need total pressure on a surface when it is the same as static pressure since U_normal is zero on a solid boundary.

 June 20, 2019, 20:46 #5 Member   Anna Feichtner Join Date: Dec 2016 Location: Cornwall (UK) Posts: 36 Rep Power: 8 Hi Hector Ah I see, good question. Of course, you are right. I do have a porous zone with an internal patch and wanted to check/try something. Anna