temperature / enthalpy fields depending on type of fvPatchField
I experienced the following issue:
I am writing a boundary condition, which can be used for writing pressure, temperature and velocity values. Since none of the available boundary conditions really fitted to what I want, I derived by new BC directly from the class "fvPatchField". While trying out some simulations, I figured out that an enthalpy field (internalField dimensions 0 2 -2 0 0 0 0) is created as a copy from the temperaturefield (internalField dimensions 0 0 0 1 0 0 0). The updateCoeffs() ob my customized boundary condition is called with these dimensions throughout the simulation, but not with a internalField with temperature dimensions.
Therefore I thought I had to write enthalpy values to this object of my fvPatchField. Nevertheless, writing values to this enthalpyfield did not change anything in the output of the simulations. The temperature values of the boundaryfield stayed on their initial values. Writing pressure and velocities worked out fine.
In a second step, I analyzed how the totalTemperature BC writes the temperature. Here, i recognized that no enthalpy field is created for this boundary condition.
After some further digging in the code, I found out that the boundary conditions are treated differently, if they are of the following types (or inheriting them): fixedValue, fixedGradient, zeroGradient, mixedFvPatchField. I changed my implementation to one which is inheriting mixedFvPatchField and now writing temperature values does work as well.
In there anybody out there who is willing to explain WHY the type of the boundary condition is important for the simulation? Why do self-made boundary conditions have to be derived from those base classes to be able to write temperature values?
Thanks a lot in advance!
|All times are GMT -4. The time now is 00:11.|