CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Computation of total pressure drop

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 18, 2018, 02:57
Default Computation of total pressure drop
  #1
Member
 
Pablo Alarcón
Join Date: Mar 2018
Location: Liège
Posts: 59
Rep Power: 8
palarcon is on a distinguished road
Hello everybody

I'm working on topology optimization with OpenFOAM and I'm using and adapting the solver adjointShapeOptimizationFoam.
In order to do that, I need to compute and print the objective function used on that solver (which is not the same used on the paper which is based on).
The real objective function used in this solver is the total pressure drop, which mathematically is

J=-\int(p+\frac{1}{2}v^{2})

I created a .H file to compute that pressure drop, but I'm not really sure that the implementation is correct, given the fact that the pressure is multiplied by mesh.Sf (I always gets confused with the normalized pressure used in simpleFOAM, which the solver is based on). Could somebody please tell me if I'm right?

Code:
scalar jDissPower (0);

for (iLoop=0; iLoop<nObjPatch; iLoop++)
{
	if (objFunction==1) {
		jDissPower =
		jDissPower - sum(
		(p.boundaryField()[objPatchList[iLoop]]*mesh.Sf().boundaryField()[objPatchList[iLoop]]
		+ 0.5*magSqr(U.boundaryField()[objPatchList[iLoop]]))
		);
	}
}
where nObjPatch is the number of patchs (usually 2, inlet and outlet) and the sum function to compute the integral over the patchs.

Thank you all in advance
palarcon is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fluent cyclone pressure drop mkal FLUENT 1 February 20, 2020 00:55
Computation of total pressure drop palarcon OpenFOAM Running, Solving & CFD 4 July 19, 2018 09:37
static vs. total pressure auf dem feld FLUENT 17 February 26, 2016 13:04
Difference between total pressure, total pressure in Stn and in Rel frames turbo5 CFX 6 January 21, 2016 16:05
Hydrostatic pressure in 2-phase flow modeling (long) DS & HB Main CFD Forum 0 January 8, 2000 15:00


All times are GMT -4. The time now is 04:14.