CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Bugs

Negative values in scalarTransportFoam with upwind discretization

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

Reply
 
LinkBack Thread Tools Display Modes
Old   June 6, 2017, 06:18
Default Negative values in scalarTransportFoam with upwind discretization
  #1
New Member
 
Gerd
Join Date: Nov 2015
Posts: 7
Rep Power: 3
G_German is on a distinguished road
Sponsored Links
I tried to set up the well known test case for the 1D Advection/Diffusion equation with scalarTransportFoam. With a linear discretization of the advection term the results look as expected. However, also with an upwind discretization the result becomes negative for large Peclet numbers, which should not be the case, right? Is there something wrong with my setup (or my understanding of what should happen) or is this an OpenFOAM problem?
Attached Files
File Type: zip upwind_negativeValues.zip (18.9 KB, 5 views)
G_German is offline   Reply With Quote
Sponsored Links

Old   June 7, 2017, 07:58
Default
  #2
Senior Member
 
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 207
Rep Power: 19
GerhardHolzinger will become famous soon enoughGerhardHolzinger will become famous soon enough
I made the following changes:
  • change the convection scheme to bounded Gauss upwind to remove warnings
  • change the laplacian scheme to orthogonal, since there is no non-orthogonality
  • change the outlet BC of T to inletOutlet
  • change the solver for the linear system to smoothSolver
The last two points are the ones that do the trick.
Attached Files
File Type: zip upwind_nonNegativeValues.zip (9.3 KB, 3 views)
GerhardHolzinger is offline   Reply With Quote

Old   June 8, 2017, 05:06
Default
  #3
New Member
 
Gerd
Join Date: Nov 2015
Posts: 7
Rep Power: 3
G_German is on a distinguished road
Hi Gerhard,
thanks for your reply.
With the zeroGradient boundary condition imposed by the inletOutlet setting the solution is no longer negative but T=0 over the whole domain. This is the correct solution for the zero Gradient BC, but unfortunately not the solution for the problem I want to solve (with the boundary condition T(L)=1).

I already had checked and looked at the warning (suggesting the bounded Gauss method) and other solvers, but I think these settings do not cause/solve the problem.
G_German is offline   Reply With Quote

Old   July 25, 2017, 15:15
Default
  #4
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,747
Rep Power: 29
ngj will become famous soon enoughngj will become famous soon enough
FYI:

I have just noticed that this issue has been reported as a bug here (not by myself):

https://develop.openfoam.com/Develop...lus/issues/545

Kind regards,

Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Negative value in scalarTransportFoam waiter120 OpenFOAM Running, Solving & CFD 2 May 5, 2017 06:13
Avoid negative scalar values (UDS) Bruno Machado Fluent UDF and Scheme Programming 7 December 13, 2016 08:10
edges not aligned with or perpendicular to non-empty directions ynos OpenFOAM Native Meshers: blockMesh 5 March 24, 2015 09:15
negative values of additional variable cosine CFX 0 November 15, 2011 05:42
exact face values RubenG Main CFD Forum 0 June 22, 2009 11:09

Sponsored Links


All times are GMT -4. The time now is 10:29.