CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   velocity BC, function of heat flux, using groovyBC (https://www.cfd-online.com/Forums/openfoam-solving/244562-velocity-bc-function-heat-flux-using-groovybc.html)

ET3 August 15, 2022 17:58

velocity BC, function of heat flux, using groovyBC
 
Hi,


I am trying to write a velocity boundary condition as a function of heat flux. The goal is to couple heat and mass flux for a pyrolysis model.



The BC looks like:
Vy = k*DT_Dy / (rho*DeltaHvap.)


I am fairly new to OF and I cant figure out how to get thermal conductivity and temperature gradient into the boundary condition.


Right now I have:


bottom2
{
type groovyBC;
valueExpression "vector(0, Qdot/(rho*1234.5),0)";
value uniform (0 0 0);
}


where Qdot is actually a reaction source term (it's the wrong units and not the term I seek, just wanted to prove to myself that I can access a field using groovyBC).



My main question is how does one access these terms? I have tried defining a wallHeatFunction in controlDict. This gives an answer in postprocessing but I was unsuccessful in accessing the result through groovyBC .

Is it necessary to create a field for k and DT_Dy like is done in createFields.H? Or can heat flux be calculated through a function in controlDict and read by groovyBC?


If you are aware of examples, I'd appreciate it.



Thank you.


All times are GMT -4. The time now is 17:21.