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

Negative values in scalarTransportFoam with upwind discretization

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By GerhardHolzinger

Reply
 
LinkBack Thread Tools Search this Thread 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: 10
Rep Power: 10
G_German is on a distinguished road
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, 16 views)
G_German is offline   Reply With Quote

Old   June 7, 2017, 07:58
Default
  #2
Senior Member
 
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 339
Rep Power: 28
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, 20 views)
rasool_soofi likes this.
GerhardHolzinger is offline   Reply With Quote

Old   June 8, 2017, 05:06
Default
  #3
New Member
 
Gerd
Join Date: Nov 2015
Posts: 10
Rep Power: 10
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: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
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

Old   August 21, 2017, 15:57
Default
  #5
Senior Member
 
FlyBob91's Avatar
 
Join Date: Mar 2016
Location: Bergamo
Posts: 157
Rep Power: 10
FlyBob91 is on a distinguished road
I have the same problem. Does someone have a solution?
FlyBob91 is offline   Reply With Quote

Old   August 25, 2017, 20:33
Default
  #6
Senior Member
 
santiagomarquezd's Avatar
 
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 452
Rep Power: 23
santiagomarquezd will become famous soon enough
Hello, there is no native solution for this problem in FOAM. I commented on the topic in the FOAM+ bugtracker.

Regards.
__________________
Santiago MÁRQUEZ DAMIÁN, Ph.D.
Research Scientist
Research Center for Computational Methods (CIMEC) - CONICET/UNL
Tel: 54-342-4511594 Int. 7032
Colectora Ruta Nac. 168 / Paraje El Pozo
(3000) Santa Fe - Argentina.
http://www.cimec.org.ar
santiagomarquezd is offline   Reply With Quote

Old   August 30, 2017, 10:46
Default
  #7
New Member
 
Gerd
Join Date: Nov 2015
Posts: 10
Rep Power: 10
G_German is on a distinguished road
Thanks for this hint.
Were the boundary conditions suggested in the earlier discussion (Wrong fvm::div assembling) actually added to -extend?
G_German is offline   Reply With Quote

Old   August 30, 2017, 12:22
Default
  #8
New Member
 
Gerd
Join Date: Nov 2015
Posts: 10
Rep Power: 10
G_German is on a distinguished road
Another thing:
In the earlier thread only the fixedValue BC was discussed. However, for me the same thing happens with the fixedGradient BC.
G_German is offline   Reply With Quote

Old   August 30, 2017, 13:24
Default
  #9
New Member
 
Gerd
Join Date: Nov 2015
Posts: 10
Rep Power: 10
G_German is on a distinguished road
With another look I am not quite sure that this is the same problem.
As I understand the earlier discussion, the solution oscillated for the upwind scheme as it did for the linear scheme.
In my case the linear scheme oscillates at high Pe but the Upwind (but also the Gamma-scheme) simply give a negative solution.
G_German 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
Avoid negative scalar values (UDS) Bruno Machado Fluent UDF and Scheme Programming 8 November 8, 2023 20:19
Negative value in scalarTransportFoam waiter120 OpenFOAM Running, Solving & CFD 3 May 31, 2021 12:16
[blockMesh] edges not aligned with or perpendicular to non-empty directions ynos OpenFOAM Meshing & Mesh Conversion 6 March 26, 2020 15:02
negative values of additional variable cosine CFX 0 November 15, 2011 04:42
exact face values RubenG Main CFD Forum 0 June 22, 2009 11:09


All times are GMT -4. The time now is 07:35.