|
[Sponsors] |
June 25, 2010, 02:43 |
Code for New BC in heat transfer
|
#1 |
Member
Join Date: Dec 2009
Location: Kanpur, India
Posts: 54
Rep Power: 16 |
Hi,
I trying of to write programme for boundary condition dT/dn = h_ext / k_f * (T_ext - T). ....(1) which comes from following eqns Fourier's law heat flux q is equal q = - k_f * d(T)/dn ....(2) and conduction: q = h_ext * (T_ext - T_w) ....(3) I read this issue in some post in which I realized that instead of mixed BC one should write programme for eqn (1) in file .../OpenFOAM/OpenFOAM-1.6/src/thermophysicalModels/basic/derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.C Could any body assist me what and how to write a BC programme for above equation (1) in the file wallHeatTransferFvPatchScalarField.C. I know how to compile new BC but its hard for me to edit the OpenFOAM code since it needs knowledge of the code & carefulness. thank you |
|
June 25, 2010, 07:03 |
|
#2 | |
Senior Member
Join Date: Jan 2010
Location: Stuttgart
Posts: 150
Rep Power: 16 |
Hi,
your equations seems to be the fluent equations for heat flux, right? I handled with the same equations trying to implement it in OpenFOAM. I tried something with groovyBC, this makes it unnecessary to create a own BC. Here you can read how to use groovyBC: http://openfoamwiki.net/index.php/Contrib_groovyBC Then I implemented the following: Quote:
But perhabs it can help you. If you know anything improving, tell me please. Best regards Chrisi |
||
June 25, 2010, 18:26 |
|
#3 |
Member
Join Date: Dec 2009
Location: Kanpur, India
Posts: 54
Rep Power: 16 |
Hi Chrisi1984
Thank you very much for your quick reply. It was a great hint. Yes your code runs but mistakenly "alphaEff" has not been defined in the variables; so it is needed to be defined. I am not firm whether this solves my problem or not. I am testing and also looking some more where wallHeatFlux programmes is written and used http://openfoamwiki.net/index.php/Contrib_wallHeatFlux http://www.cfd-online.com/Forums/ope...oussinesq.html (Thomas Baumann #6) so I will test them and let you know soon if these things works. I am really thankful for your help regards dinesh |
|
June 26, 2010, 15:36 |
|
#4 |
Member
Join Date: Dec 2009
Location: Kanpur, India
Posts: 54
Rep Power: 16 |
Hi,
It seems from following posts that both way (groovyBC and wallHeatFlux case) of imposing boundary heat flux transfer can be used. But groovyBC sounds bit superior then wallHeatFlux case. (1) http://www.cfd-online.com/Forums/openfoam-solving/58319-calculation-heat-transfer-coefficients.html (#17) (2) http://www.cfd-online.com/Forums/openfoam-solving/66705-wallheatflux-bc-not-constant-after-restart.html (3) http://www.cfd-online.com/Forums/ope...atflux-bc.html (#2) Though, I could test only groovyBC one. For wallHeatFlux case, I needed to compile the code ( http://openfoamwiki.net/index.php/Contrib_wallHeatFlux), which I was unable to compile yet; still I am trying and if its results are better then I'll post it. But I am feeling that groovyBC is better. again thank you for your hints dinesh |
|
June 27, 2010, 10:08 |
|
#5 | |
Senior Member
Join Date: Jan 2010
Location: Stuttgart
Posts: 150
Rep Power: 16 |
Quote:
I can tell you that you need not define "alphaeEff", its value is derived from the cells directly. If you run a non turbulent flow you should replace "alphaEff" with "alpha". Best regards Chrisi |
||
June 28, 2010, 09:04 |
|
#6 |
Member
Join Date: Dec 2009
Location: Kanpur, India
Posts: 54
Rep Power: 16 |
Hi, Cheris1984,
As we were discussing that alphaEff ought to be replaced. So I found that in my case it has to replaced by kappaEff then it takes it automatically without defining in groovyBC. Further, this time I have been able to compile the HeatWallFlux case. For somebody's help let me put it in following steps : 1) get the "WallHeatFlux-20080819.tar.gz" folder from http://openfoamwiki.net/index.php/Contrib_wallHeatFlux 2) see in the folder there is openFoam-1.5 folder just go inside it till last and copy the folder "WallHeatFlux". Put this folder into /home/dinesh/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/fields/fvPatchFields/derived/ 2) open the file Patch-OpenFOAM-1.5-src-finiteVolume-Make-for-wallHeatFlux-20080819 (which is inside WallHeatFlux folder). Note the line no. 8th which is $(derivedFvPatchFields)/wallHeatFlux/wallHeatFluxFvPatchScalarField.C copy this and add it to the file /home/dinesh/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/Make/files at around line 156 (this I am doing since I was unable to patch it by procedure written in wiki http://openfoamwiki.net/index.php/Contrib_wallHeatFlux) 3) replace the word alphaEff to kappaEff in the file /home/dinesh/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/fields/fvPatchFields/derived/wallHeatFlux/wallHeatFluxFvPatchScalarField.C at arround line 135 4) $cd /home/dinesh/OpenFOAM/OpenFOAM-1.6/src 5)$ wmake libso finiteVolume for running this case 5) Add following two lines in the /home/dinesh/OpenFOAM/dinesh-1.6/run/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/constant/transportProperties //Cp0 specific heat Cp0 Cp0 [0 2 -2 -1 0 0 0] 520.2; ///==< chose it for your case //density rho0 rho0 [1 -3 0 0 0 0 0] 0.8180;///==< chose it for your case 6)now one can run the programme, say, $buoyantBossinsneqPisoFoam Nothing new I have done....All was available in the cfd-forums ...but scattered here and there. I have just arranged it above. Now I can use both groovyBC case as well as wallHeatFlux for groovyBC it is like as outerSideWall { type groovyBC; value uniform 598; gradientExpression "gradT"; fractionExpression "0"; variables "hcof=1000;Cp0=795;rho0=7023;Tamb=25;heatFlux= hcof *(T-Tamb);gradT=heatFlux/(kappaEff * Cp0 * rho0);" timelines ( ); } and for WallHeatFlux outerSideWall { type wallHeatFlux; heatFlux uniform 0.0025; } thank you dinesh IIT Kanpur Last edited by Shoonya; June 29, 2010 at 01:39. |
|
February 3, 2011, 17:48 |
|
#7 |
Member
Join Date: Nov 2010
Posts: 54
Rep Power: 16 |
Hi
I tried to implement Chrisi's BC with the XiFoam solver, but got the following error, at the first time step: Time = 1.19999e-08 diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0 DILUPBiCG: Solving for Ux, Initial residual = 1, Final residual = 4.5435e-09, No Iterations 1 DILUPBiCG: Solving for Uy, Initial residual = 1, Final residual = 5.34054e-09, No Iterations 1 DILUPBiCG: Solving for Uz, Initial residual = 1, Final residual = 5.63001e-09, No Iterations 1 Max St-Courant Number = 7.86393e-07 Igniting cell 43926 state : 1 1 0.135 2.12673e-13 Igniting cell 40685 state : 1 1 0.135 1.47286e-13 Igniting cell 40686 state : 1 1 0.135 1.65015e-13 Igniting cell 40687 state : 1 1 0.135 2.17713e-13 Igniting cell 40866 state : 1 1 0.135 1.40006e-13 Igniting cell 43925 state : 1 1 0.135 4.56461e-13 Igniting cell 43927 state : 1 1 0.135 2.50109e-13 Igniting cell 44106 state : 1 1 0.135 1.30268e-13 DILUPBiCG: Solving for b, Initial residual = 1, Final residual = 4.10764e-10, No Iterations 1 min(b) = 0.999976 DILUPBiCG: Solving for Su, Initial residual = 0.999994, Final residual = 1.48258e-08, No Iterations 14 DILUPBiCG: Solving for Xi, Initial residual = 1, Final residual = 2.83085e-07, No Iterations 16 max(Xi) = 1 max(XiEq) = 1.001 Combustion progress = 6.3418e-08% --> FOAM FATAL ERROR: attempt to use janafThermo<equationOfState> out of temperature range 100 -> 5000; T = 0 From function janafThermo<equationOfState>::checkT(const scalar T) const in file /home/gk/OpenFOAM/OpenFOAM-1.7.1/src/thermophysicalModels/specie/lnInclude/janafThermoI.H at line 63. FOAM aborting (FOAM_ABORT set) Did anyone face something similar? Any ideas why this could be happening, or how to resolve this? Thanks, gk |
|
February 5, 2011, 01:46 |
|
#8 | |
Member
Join Date: Dec 2009
Location: Kanpur, India
Posts: 54
Rep Power: 16 |
Quote:
I think there is some problem in your temperature range. As JANAF tables (U-177 OF user guide) has certain range of temp., so your simulation might had some temperature issue. May be you try once by changing "thermophysicalProperties" like change it "janafThermo" to "specieThermo" ...etc best wishes is using different |
||
Tags |
heat transfer, new bc |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Heat transfer BC at wall- why need wall thickness? | Julie | FLUENT | 7 | February 3, 2012 22:41 |
Issue with units in heat transfer | lost.identity | Main CFD Forum | 0 | May 19, 2009 08:07 |
Water vapour condensation in CFX-5.7.1 | hdj | CFX | 1 | November 27, 2005 08:15 |
code for simulating radiation heat transfer | Seaspace | Main CFD Forum | 1 | October 3, 2002 14:16 |
Design Integration with CFD? | John C. Chien | Main CFD Forum | 19 | May 17, 2001 16:56 |