CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   temperature / enthalpy fields depending on type of fvPatchField (http://www.cfd-online.com/Forums/openfoam-programming-development/77585-temperature-enthalpy-fields-depending-type-fvpatchfield.html)

astein June 28, 2010 07:10

temperature / enthalpy fields depending on type of fvPatchField
 
Dear Foamers,

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!
-Andreas.


All times are GMT -4. The time now is 07:51.