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

[swak4Foam] Implementation of Robin BC by groovyBC : difference wrt. theoretic solution

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 9, 2012, 11:24
Default Implementation of Robin BC by groovyBC : difference wrt. theoretic solution
  #1
New Member
 
Tianyi LI
Join Date: Mar 2012
Posts: 4
Rep Power: 14
tianyikillua is on a distinguished road
Hello everyone, we consider the following stationary heat equation:

Laplacian(T)=0

Code:
-----------T(x)---------- a bar with length L=0.4 m, mesh Delta x=1 mm
x=0        x           x=L (patch outlet)
BC :
At x=0 : T(0)=T0=273 K
At x=L : kT'(x)=h*(T(L)-Tinf) with k=237 W/mK, h=-100 W/m^2K, Tinf=873 K

We have implemented this BC using swak4Foam, in 0/T for the patch outlet:
Code:
    	type                groovyBC;
    	variables           "k=237;h=-100;Tinf=873;";
    	valueExpression     "Tinf";
    	fractionExpression  "1/(1-k/(mag(delta())*h))";
    	value	            $internalField;
We are using the "steadylaplacianFoam" where we solve only the stationary heat equation. After about 5 iterations the solution OF has converged.

However, the OF solution differs a little from the theoretic solution :

CL.jpg
tianyikillua is offline   Reply With Quote

Old   April 11, 2012, 16:20
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by tianyikillua View Post
Hello everyone, we consider the following stationary heat equation:

Laplacian(T)=0

Code:
-----------T(x)---------- a bar with length L=0.4 m, mesh Delta x=1 mm
x=0        x           x=L (patch outlet)
BC :
At x=0 : T(0)=T0=273 K
At x=L : kT'(x)=h*(T(L)-Tinf) with k=237 W/mK, h=-100 W/m^2K, Tinf=873 K

We have implemented this BC using swak4Foam, in 0/T for the patch outlet:
Code:
    	type                groovyBC;
    	variables           "k=237;h=-100;Tinf=873;";
    	valueExpression     "Tinf";
    	fractionExpression  "1/(1-k/(mag(delta())*h))";
    	value	            $internalField;
We are using the "steadylaplacianFoam" where we solve only the stationary heat equation. After about 5 iterations the solution OF has converged.

However, the OF solution differs a little from the theoretic solution :

Attachment 12409
Convergence is relative. Have you tried a stricter convergence criterion? Also try varying the mesh resolution to see if this is not just a discretization problem
gschaider is offline   Reply With Quote

Old   April 12, 2012, 10:33
Default
  #3
New Member
 
Tianyi LI
Join Date: Mar 2012
Posts: 4
Rep Power: 14
tianyikillua is on a distinguished road
After we changed the gradient scheme to leastSquares, everything is fine !! However we still don't know why...
tianyikillua 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
CFL Condition Matt Umbel Main CFD Forum 19 June 30, 2020 08:20
[swak4Foam] A way to update groovyBC variables during the solution immortality OpenFOAM Community Contributions 10 February 4, 2013 00:56
[swak4Foam] no change in solution by change in groovyBC variables immortality OpenFOAM Community Contributions 2 January 28, 2013 07:34
IcoFoam parallel woes msrinath80 OpenFOAM Running, Solving & CFD 9 July 22, 2007 02:58
Could anybody help me see this error and give help liugx212 OpenFOAM Running, Solving & CFD 3 January 4, 2006 18:07


All times are GMT -4. The time now is 18:26.