Code for New BC in heat transfer
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)
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.
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:
Then I implemented the following:
But perhabs it can help you.
If you know anything improving, tell me please.
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://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
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)
(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
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".
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
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
copy this and add it to the file
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
rho0 rho0 [1 -3 0 0 0 0 0] 0.8180;///==< chose it for your case
6)now one can run the programme, say,
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
value uniform 598;
variables "hcof=1000;Cp0=795;rho0=7023;Tamb=25;heatFlux= hcof *(T-Tamb);gradT=heatFlux/(kappaEff * Cp0 * rho0);"
and for WallHeatFlux
heatFlux uniform 0.0025;
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?
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
is using different
|All times are GMT -4. The time now is 10:40.|