I am considering a case where I have a rectangle geometry. The left vertical wall is kept at 278K, while the right vertical wall is kept at 318K. This wall temperature I am setting using setAdvectionDiffusion Temperature boundary. Now, for the horizontal wall, I want to have linearized temperature distribution in the horizontal direction such that the temperature on the wall would be a function of the distance. At x=0,it would be 278K, at x=L/2 it would be 298K and x =L it should be 318K.
In addition, I also want to know how the temperature non-dimensional conversion is done. In the previous blogs, I read that the Thot is set to 1 in non-dimensional units, while the Tcold is set to 0. Is it set this way?
I hope that you are able to understand the question
regarding your first question, please specify the function as an analytical functor (e.g. AnalyticalLinear3D) and pass it to the boundary condition (depending on what arguments it requires). You can find this procedure in basically any example at some point.
For detailed conversion rules please have a look at the file src/core/thermalUnitConverter.h:
– l.75: The conversion factor for temperature is computed via: (charPhysHighTemperature – charPhysLowTemperature). You set these two values in physical units at the beginning of your simulation. In your case these could be 278K and 318K.
– l.144 onwards: The converter uses the conversion factor for temperature to compute a lattice value of a given physical temperature in this way: (physTemperature – charPhysLowTemperature) / _conversionTemperature + 0.5; and eventually a typecast. Hence, according to this rule, the converter converts charPhysHighTemperature to 1 and charPhysLowTemperature to 0.
– In case you assign your appearing wall temperatures to these two values (in physical units!), respectively, the answer to your second question is yes.