CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

solidificationMeltingSource - varying thermal properties

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 18, 2023, 08:16
Default solidificationMeltingSource - varying thermal properties
  #1
New Member
 
Join Date: Apr 2023
Posts: 12
Rep Power: 3
elBombastico is on a distinguished road
Dear Foamers,


I am working with an ice melting problem, that I intended to model using solidificationMeltingSource. I am using OF8. I have managed to validate its use assuming that the thermal properties (density, specific heat capacity, thermal conductivity) remain the same at both sides of the melting temperature. The issue is, for ice-water, all these three properties undergo quite a sharp jump at 0 oC and, if I have correctly understood, it is not possible to provide solidificationMeltingSource with different properties for the liquid and the solid. It is the solver who must be provided with a way to determine them in function of temperature (or fraction of liquid). So far, I have tried the following, without success:
  • Use properties interpolated from tables. Unfortunately, OF8 suffers from this bug.
  • Implement a new thermotype (e.g. in function of temperature or the fraction of liquid computed by solidificationMeltingSource). All the tutorials and posts would work for OF7 latest. From OF8 onwards, thermoPhysicsTypes.H is gone, and in its place, there are "typedefThermo", "makeThermo" and centralised macros. Result: compilation problems that are way beyond my proficiency in C++ and OF's software structure.
  • Compute the properties as a weighed average of the liquid and the solid using the liquid fraction and multicomponentMixture. Unfortunately, I have not been able to figure out how to tell multicomponentMixture to use the liquid fraction computed by sMS as weighing variable.
  • Create a new solver, in which the calculation of the properties is hardcoded in the main file of the energy equation (well, this I have not done yet).

I am trying to avoid the last one, together with upgrading to OF10 or downgrading to OF7. I am pretty sure there must be a (or even several) easier solutions than the ones posted above.

How would you implement this jump? Is there a way to use sMS that I am missing? Or to provide the property calculation at run time without compiling a new solver or thermotype?



Thanks in advance for your help
elBombastico is offline   Reply With Quote

Old   March 11, 2024, 08:36
Default
  #2
New Member
 
Dasha
Join Date: Sep 2023
Posts: 16
Rep Power: 3
DashaSh is on a distinguished road
Hello,

I'm struggling with the same problem, do you have any progress?
DashaSh is offline   Reply With Quote

Old   March 12, 2024, 06:40
Default
  #3
New Member
 
Join Date: Apr 2023
Posts: 12
Rep Power: 3
elBombastico is on a distinguished road
Hi,


Any progress ? Well, I managed to solve the problem, but the solution was far less than optimal.
  • Did not manage to make the tables work in OF8 with the discontinuity at the transition temperature.
  • Did not manage to implement a new thermo type in OF8. I managed to compile it and to have it shown in the thermo type option list, but it crashed at runtime for reasons I did not get to understand.
So, at the end, the easiest for me was to do create a new thermo type in OF 7, for which I had tutorials. It worked, but it is really an overkill.



I have recently discovered that you can use #codestream to include code that is compiled compiled during runtime. I have successfully used it for a complex boundary condition. I think it should be possible to include in your thermo dictionary some lines that:

  • Define and assign a value for Cp solid.
  • Define and assign a value for Cp liquid.
  • Retrieve the value of alpha liquid of each cell.
  • Calculate a weighed average and return it as Cp or Cv (depending on which one your thermo model requires).
This would spare you the whole "new thermo type" shenanigan.

Please let me know if this helps you, and if you happen to try it, could you let me know if it worked?


Regards and good luck
elBombastico is offline   Reply With Quote

Old   May 30, 2024, 04:50
Default
  #4
New Member
 
Iason Tsiapkinis
Join Date: Jul 2019
Posts: 8
Rep Power: 7
souvlaki41 is on a distinguished road
Hey, any chance you can share the thermoType? I want to use a similar setup in the ESI version.
souvlaki41 is offline   Reply With Quote

Old   June 4, 2024, 10:53
Default
  #5
New Member
 
Join Date: Apr 2023
Posts: 12
Rep Power: 3
elBombastico is on a distinguished road
Hi,


Sorry for the late reply. Any progress on this?

I just used the tutorial by Isabelle Chouquet that you can find in the link "tutorial" in my first post of this thread. As said, it will not work for OF7 onwards. In order to avoic conflicts with my current installation, I had to use a virtual console dedicated to it. It was a complete overkill, but it did the job.

If it was today, I think I will go with #codeStream: retrieve the value of the volume fraction of liquid from the object registry, and calculate a weighed average between the thermal properties of the solid and the liquid.


Regards,
elBombastico is offline   Reply With Quote

Reply

Tags
multicomponent mixture, solidificationmeltingsour, thermo type


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
mass flow in is not equal to mass flow out saii CFX 12 March 19, 2018 06:21
chtMultiRegionSimpleFoam: Thermal Conduction + Surface-To-Surface Radiation Zeppo OpenFOAM Running, Solving & CFD 16 May 18, 2017 19:04
Ansys CFX problem: unexpected very high temperatures in premix laminar combustion faizan_habib7 CFX 4 February 1, 2016 18:00
Can i get the thermal properties nareshpolasa Main CFD Forum 0 July 7, 2009 14:05
Info: Short Course On Thermal Design of Electronic Equipment Arnold Free Main CFD Forum 0 August 10, 1999 11:18


All times are GMT -4. The time now is 03:37.