Applying Heat Flux Boundary Condition to Incompressible Solver
Tags openfoam
Hi All!
I have struggled a lot to try and get the Heat Flux Boundary Condition for an incompressible solvers like buoyantBoussinesqSimpleFoam and buoyantBoussinesqPimpleFoam.
So, here I am providing the details of what worked after looking through several posts on the forum.
The answer is groovyBC boundary condition.
You'll need to install swak4Foam from https://openfoamwiki.net/index.php/I...tion/swak4Foam.
Now, in your Temperature dictionary (0/T), let's say you have heaterWall boundary where you want to apply the constant heat flux boundary. You'll write it as follows:
In order to check that the Heat Flux at the wall has been applied correctly, the wallHeatFluxIncompressible utility (https://github.com/wyldckat/wallHeatFluxIncompressible) can be used.
However, this utility is not compatible with groovyBC. Hence, after the case has been run, just for the sake of the utility to run correctly, the groovyBC needs to be replaced with fixedValue (a known boundary condition).
The following command can be used on terminal:
Now you can run the wallHeatFluxIncompressible utility in the case directory.
Cheers!
I have struggled a lot to try and get the Heat Flux Boundary Condition for an incompressible solvers like buoyantBoussinesqSimpleFoam and buoyantBoussinesqPimpleFoam.
So, here I am providing the details of what worked after looking through several posts on the forum.
The answer is groovyBC boundary condition.
You'll need to install swak4Foam from https://openfoamwiki.net/index.php/I...tion/swak4Foam.
Now, in your Temperature dictionary (0/T), let's say you have heaterWall boundary where you want to apply the constant heat flux boundary. You'll write it as follows:
heaterWallYou can run the case now.
{
type groovyBC;
value uniform 300; // Reference temperature value. If this is not provided, the solver assumes wall temperature as 0 by default
valueExpression "0"; //Can be used when you want a Dirichlet BC as an expression e.g. wall temperature as some function of position or even time.
gradientExpression "gradientT"; //Neumann BC - For Heat Flux, we actually calculate the temperature gradient across the wall - expression is given below
fractionExpression "0"; //0 for Neumann BC; 1 for Dirichlet BC
variables
(
"Cp0=4182.4;" //Sp. Heat Capacity [J/kg-K]
"rho0=984.6;" //Density [kg/m3]
"Power=552;" //Input Power [W] - This is optional. If you know heat flux, you can enter it in the heatFlux below.
"Area=0.062114;" //Heater Surface Area [W]
"heatFlux=Power/Area;" //Heat Flux [W/m2]
"kappaEff=alphaEff*Cp0*rho0;" //Effective Thermal Conductivity [W/m-K]
"gradientT=heatFlux/kappaEff;" // Temperature Gradient which will be set as gradient boundary in the groovyBC
//alphaEff - Effective Thermal Diffusivity will be calculated by the solver as below
// alphaEff = alpha_mol + alphat
// alpha_mol: Molecular Thermal Diffusivity [m2/s2] - thermophysical property of the fluid that is provided in the transportProperties dictionary
// alphat: Turbulent Thermal Diffusivity [m2/s2] - Calculated by the solver in your time directory
//If the flow is laminar, you can substitute kappaEff with kappa, actual thermal conductivity of the fluid.
);
evaluateDuringConstruction false; // false flag will allow the ussage of external parameters like alphaEff which is not defined here.
}
In order to check that the Heat Flux at the wall has been applied correctly, the wallHeatFluxIncompressible utility (https://github.com/wyldckat/wallHeatFluxIncompressible) can be used.
However, this utility is not compatible with groovyBC. Hence, after the case has been run, just for the sake of the utility to run correctly, the groovyBC needs to be replaced with fixedValue (a known boundary condition).
The following command can be used on terminal:
sed -i s/groovyBC/fixedValue/g */TThis command searches in all the files named T for "groovyBC" and replaces it with "fixedValue".
Now you can run the wallHeatFluxIncompressible utility in the case directory.
Cheers!
Total Comments 0



