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

Pressure flips from positive to negative

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 25, 2016, 11:34
Default Pressure flips from positive to negative
  #1
New Member
 
Jeroen
Join Date: Oct 2016
Posts: 21
Rep Power: 10
verboomj is on a distinguished road
So, I've read a few posts about the prefcell and prefvalue but apparently I don't understand it yet.

I'm using adjoinShapeOptimizationFoam, which uses simpleFoam to solve pressure and velocity.

However, from iteration 4 to iteration 5, suddenly my pressure at the inlet becomes negative. This behaviour is also visible in my objective function because it has a pressure term included.

At the inlet I assign a velocity and at the outlet I set the pressure to zero.

So does anyone know where this behaviour comes from?


EDIT: In the plot and file I used P = 1 at the outlet
Attached Images
File Type: png Iteration4.PNG (49.4 KB, 39 views)
File Type: png Iteration5.PNG (73.2 KB, 41 views)
File Type: png Objective.png (11.9 KB, 45 views)
Attached Files
File Type: txt p.txt (1.2 KB, 18 views)
File Type: txt U.txt (1.3 KB, 8 views)
verboomj is offline   Reply With Quote

Old   November 25, 2016, 12:02
Default
  #2
Senior Member
 
floquation's Avatar
 
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 21
floquation will become famous soon enough
prefcell and prefvalue fix the value for pressure, if it is not fixed by anything else.
The reason is quite simple: if the pressure differential equation is solved, you will get an integration constant. If your BCs only demand the gradient of pressure to be a certain value, your BC do not impose any condition on this integration constant. Numerically you do, however, need such a constraint, which is achieved by simply fixing the value for pressure in one cell.

In your case, your BC demands a value for P at the outlet, therefore prefcell and prefvalue do nothing.

Your BC seem appropriate.

It seems like your simulation is not properly converging, or diverging even.
Post your fvSolution and fvSchemes files and the solver output and someone may be able to diagnose the issue.
floquation is offline   Reply With Quote

Old   November 26, 2016, 06:51
Default
  #3
New Member
 
Jeroen
Join Date: Oct 2016
Posts: 21
Rep Power: 10
verboomj is on a distinguished road
Hi Kevin,

Thanks for your reply, good to know how the reference value works! However this was my first idea what could be wrong so I have to look further now.

In the attachment are my fvSolution and fvSchemes, which I left 'as downloaded' from OF and the log file from my solution. Only 25 iterations, but the behaviour already happens from iteration 4 to 5.

Also in the residual plot you can see p_resiudual is increasing significantly from iteration 2 to 5. Any idea?

Thanks in advance!

Jeroen


EDIT: In the plot only p, Ux and Uy are of interest, the adjoint solutions shouldn't have an effect on the primal solution.
Attached Images
File Type: png Residuals.png (12.6 KB, 36 views)
Attached Files
File Type: txt fvSolution.txt (1.9 KB, 16 views)
File Type: txt fvSchemes.txt (1.5 KB, 11 views)
File Type: txt log.txt (39.6 KB, 6 views)
verboomj is offline   Reply With Quote

Old   December 6, 2016, 06:53
Default
  #4
New Member
 
Jeroen
Join Date: Oct 2016
Posts: 21
Rep Power: 10
verboomj is on a distinguished road
Solved it by rewriting the entire solver based on simpleFoam instead of adjointShapeOptimizationFoam. Must've been something wrong with the latter.
verboomj 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
[blockMesh] Errors during blockMesh meshing Madeleine P. Vincent OpenFOAM Meshing & Mesh Conversion 51 May 30, 2016 11:51
High negative pressure with interPhaseChangeFoam legione OpenFOAM Running, Solving & CFD 7 July 5, 2015 11:28
seeking for help about a room with negative pressure mengyue1 FLUENT 0 November 26, 2009 07:40
what the result is negatif pressure at inlet chong chee nan FLUENT 0 December 29, 2001 06:13
Hydrostatic pressure in 2-phase flow modeling (long) DS & HB Main CFD Forum 0 January 8, 2000 16:00


All times are GMT -4. The time now is 06:33.