0/T two boundary conditions on one wall
Hi, in my 0/T folder on one wall I need a heat flux (W/m^2) and convective heat flux (W/m^2K). I tried defining these conditions separately for the same wall or putting it in the same bracket but openfoam only uses one of them not both. Is there a way of doing this without using swak4foam? Example code below in which openfoam only uses the second condition.
top_wall { type externalWallHeatFluxTemperature; value $internalField; q uniform 1000.0; mode flux; kappaMethod solidThermo; qr none; kappa none; thicknessLayers (); kappaLayers (); } top_wall { type externalWallHeatFluxTemperature; mode coefficient; Ta constant 313.0; h uniform 17.0; value $internalField; } |
Hi!
I don't know if you found a solution, but... I faced similar challenges with BC on a wall. I've experimented with some OF options and at the end codedMixed worked just fine. Link to documentation, it has a nice simple example: https://www.openfoam.com/documentati...atchField.html If you would have any questions feel free to ask! :) |
Quote:
If you test with the following, you will see what OpenFOAM itself sees: Code:
foamDictionary -expand 0/T https://develop.openfoam.com/Develop...foam/-/issues/ |
Quote:
(https://api.openfoam.com/2312/classF...atchField.html) which allows you to use a PatchFunction1 for each of the three constituent parts. This can be especially convenient (compared to a complete coded mixed BC) since you can potentially specify some parts as constant or some other PatchFunction1, which include expressions and coded. IMO it is probably the best of both worlds - it offers full flexibility without necessarily needing to compile additional code. |
If you check the Code off that BC you Will see that you can use several BC for that wall, you just need to add all the needed parameters in the same boundary.
|
Quote:
topWall { type externalWallHeatFluxTemperature; mode coefficient; mode flux; Ta constant 313; h uniform 17; q uniform 1000.0; value $internalField; kappaMethod solidThermo; qr none; kappa none; thicknessLayers (); kappaLayers (); } |
Quote:
|
Quote:
Can you at least write out what your BC is supposed to look like in mathematical form in terms of value and gradient of temperature?? |
Quote:
where q is flux W/m^2, h is HTC W/m^2K, k is thermal conductivity W/mK. Tinf is the ambient temperature, T is the boundary temperature. An article posted this code for groovyBC for this type of boundary: boundary { type groovyBC; variables "h=10.0;Tinf=100.0;k=10.0;q=150.0;"; valueExpression "Tinf"; fractionExpression "1.0/(1.0 + k/(mag(delta())*h))"; value uniform 100; gradientExpression "q/k"; } I'm struggling to get swak4foam on Mac, so I'm trying to use this as codedMixed, but I get error saying delta is undeclared identifier. How do I define delta? |
Quote:
Hey, in my case I used deltaCoeffs(), it's a variable of a boundary patch that can be accessed Over here you can find a definition: (https://openfoamwiki.net/index.php/O...n;;deltaCoeffs) I hope that helps! :) |
All times are GMT -4. The time now is 16:21. |