|
[Sponsors] |
July 16, 2018, 09:00 |
Computation of total pressure drop
|
#1 |
Member
Pablo Alarcón
Join Date: Mar 2018
Location: Liège
Posts: 59
Rep Power: 8 |
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 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]])) ); } } Thank you all in advance |
|
July 18, 2018, 12:32 |
|
#2 |
Senior Member
Join Date: Aug 2015
Posts: 494
Rep Power: 14 |
I've used
Code:
p.boundarField()[patch] + 0.5*magSqr(phi.boundaryField()[patch]/mesh.magSf()[patch]) Caelan |
|
July 18, 2018, 14:10 |
|
#3 | |
Member
Pablo Alarcón
Join Date: Mar 2018
Location: Liège
Posts: 59
Rep Power: 8 |
Quote:
Nevertheless, knowing that PHI is equal to U times A, would it be better to define the second value has or ??? |
||
July 18, 2018, 14:14 |
|
#4 |
Senior Member
Join Date: Aug 2015
Posts: 494
Rep Power: 14 |
I think they'll give you the same result. Offhand -- velocity is a volVectorField, while phi is a surfaceVectorField (and the patch is a surface). Also, if you specify velocity on a patch it's a trivial result. You could try computing both ways and see if there's a difference.
Caelan |
|
July 19, 2018, 09:37 |
|
#5 |
Member
Pablo Alarcón
Join Date: Mar 2018
Location: Liège
Posts: 59
Rep Power: 8 |
Thank you very much for your kind replies.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Fluent cyclone pressure drop | mkal | FLUENT | 1 | February 20, 2020 00:55 |
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 (CFX4.2) | HB &DS | CFX | 0 | January 9, 2000 13:19 |
Hydrostatic pressure in 2-phase flow modeling (long) | DS & HB | Main CFD Forum | 0 | January 8, 2000 15:00 |