CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Implementation of Robin BC by groovyBC : difference wrt. theoretic solution (https://www.cfd-online.com/Forums/openfoam-programming-development/99669-implementation-robin-bc-groovybc-difference-wrt-theoretic-solution.html)

 tianyikillua April 9, 2012 11:24

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

1 Attachment(s)
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

 gschaider April 11, 2012 16:20

Quote:
 Originally Posted by tianyikillua (Post 353794) 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

 tianyikillua April 12, 2012 10:33

After we changed the gradient scheme to leastSquares, everything is fine !! However we still don't know why...

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