CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   melting problem: looking for appropriate solvers (https://www.cfd-online.com/Forums/openfoam-solving/93620-melting-problem-looking-appropriate-solvers.html)

kera December 13, 2016 03:23

1 Attachment(s)
Quote:

Originally Posted by akidess (Post 629330)
Sen and Davis do not present experimental results if I remember correctly. The results in that paper are based on a semi-analytic model. Based on what you put in you will obtain other results. What were the values you expected, for which dimensionless numbers?

Yes, you are once again right :) , and sorry for not being clear with the information.

Like I said, I tried to recalculate the properties of the fluid from the given dimensionless numbers for the case Mg = 0.2, Ca = 0.008, Re = 1 and Pr = 0.2 (Also assuming both fluids have same properties).

I have also attached my case file with those values, I am not sure about the values though but I hope it is still plausible to do so.

Thanks once again in advance!

Regards,
Ricky

akidess December 14, 2016 03:10

Quote:

Originally Posted by kera (Post 629409)
(Also assuming both fluids have same properties).

Pretty sure that assumption is not valid. Did you read the Sen and Davis paper?

kera December 14, 2016 03:21

That is the problem, currently I don't have accces to their research work, so I tried to gather as much information as possible from the available resources on the internet and obviously most of the data is still missing. I did place a request to get access to their research work but I have no idea how long it is gonna take, that pretty much gave me a reason to post the query here.

akidess December 19, 2016 04:18

Quote:

Originally Posted by kera (Post 629593)
That is the problem, currently I don't have accces to their research work, so I tried to gather as much information as possible from the available resources on the internet and obviously most of the data is still missing.

OK, that explains a lot... Still, Zaki's thesis clearly states there is a gas on top of the liquid - odd choice you assume both fluids to have the same properties (Sen and Davis go a step further and assume a fluid of negligible viscosity and thermal conductivity).

vak96 January 25, 2017 04:06

Hi all,

I am new to OpenFOAM. I am working on solidification of ingot during vacuum arc remelting. I tried using all the above solvers but none of them seems to work as I am getting an error while compiling. I am using OpenFOAM version 2.3.0. Can someone please help me?

Thanks in advance,
Akshay

kera January 25, 2017 11:59

Quote:

Originally Posted by vak96 (Post 634638)
Hi all,

I am new to OpenFOAM. I am working on solidification of ingot during vacuum arc remelting. I tried using all the above solvers but none of them seems to work as I am getting an error while compiling. I am using OpenFOAM version 2.3.0. Can someone please help me?

Thanks in advance,
Akshay

Hi Akshay,

I am not sure what kind of compilation errors you are talking about, if I have to guess those errors are probably due to version mismatch.

Have you tried using the "solidificationMeltingSource" fvOption which comes with OpenFOAM (not sure about 2.3.0 but it's definitely present from 2.3.1 onwards :D)? I haven't used it myself though, but you can refer to #218 for a sample case (pay attention to the version).

Also, if I remember it correctly someone has uploaded his/her solver for OpenFOAM-2.3.0.

Happy FOAMing!

Regards,
Ricky

vak96 January 25, 2017 21:58

Hi Ricky,

Thanks for your help. I will try and get back to you if I have any problem.

Regards,
Akshay

vak96 January 27, 2017 05:21

Hi guys,

I have tried finding out how to use "solidificationMeltingSource" fvOption in #218 but was not successful. Can anyone please provide me with some tutorial case with geometry?

Thanks in advance,
Akshay

kera January 31, 2017 03:09

Quote:

Originally Posted by vak96 (Post 634821)

I have tried finding out how to use "solidificationMeltingSource" fvOption in #218 but was not successful.

Hallo Akshay,

Sorry for the late reply, I was stuck with documentation :D.

As far as your problem is concerned, it would be helpful if you can elaborate what you tried to do and where exactly you are encountering compilation errors. After my last post I was curious enough to try that "fvOptions" myself and it worked out pretty much good for me.

The tutorial case provided in post #218 is for the OpenFoam-Version 3.0 and you would definitely end up with errors if you try to run that case with your OpenFOAM-Version 2.3.

The usage of "solidificationMeltingSource" is slightly different in version 2.3 when compared to version 3.0.

Hope this helps!

Regards,
Ricky

vak96 February 1, 2017 10:18

Hi Ricky,

I was able to run it OpenFOAM version 4.1. Can you please elaborate the usage of "solidificationMeltingSource" with respect interfoam solver which uses VOF method. Whether such thing is possible or not?

Thanks for the previous reply.

With regards,
Akshay

kera February 2, 2017 09:01

Hallo Akshay,

To be honest, I have really no clue about it.

If I am not overthinking it there is no direct way to use solidificationMeltingSource with interFoam for the following reasons:
  • solidificationMeltingSource term for the time being doesn't handle two phases (atleast not in OpenFoam-2.3.1) \rightarrow So you have to program it.
  • InterFoam being an isothermal solver \rightarrow you need to add energy equation (which is quite easy to add).

After adding the energy equation to interFoam I would definitly try the solidificationMeltingSource term by setting alpha=1 for the whole domain (solving it as a single phase) I don't think it would work but still just to get an idea.

If you are very keen about modifying the solidificationMeltingSource term. I would also look into the "OpenFOAM-2.3.x/src/transportModels/incompressible/" so as to modify/append the solidificaitonMeltingSource by incorporating VOF calculations -- If it is plausible.

(or)

You can go ahead and implement the melting algorithm by Fabian directly in interFoam.

Any help from others is really appreciated.

Regards,
Ricky

vak96 February 9, 2017 00:30

Problem with interphasechangefoam: Urgent
 
1 Attachment(s)
Hi all,

I have shared a folder which has a tutorial along with solver and a test case.https://drive.google.com/file/d/0Bzj...ew?usp=sharing
I have tried to do what this document says to make our own solver based on interphasechangefoam with temperature term included in OpenFoam version 4.1. When I compiled the solver there were no errors but when I do solver -help or run it, it shows the following error. Can anyone help, please?

Thanks in advance,
Akshay

kera February 9, 2017 04:38

Quote:

Originally Posted by vak96 (Post 636468)
Hi all,

I have shared a folder which has a tutorial along with solver and a test case.https://drive.google.com/file/d/0Bzj...ew?usp=sharing
I have tried to do what this document says to make our own solver based on interphasechangefoam with temperature term included in OpenFoam version 4.1. When I compiled the solver there were no errors but when I do solver -help or run it, it shows the following error. Can anyone help, please?

Thanks in advance,
Akshay

Hallo Akshay,

Double free or corruption means either you are deleting the same entity twice or deleting unallocated memory.

I see that you are also compiling the libraries associated to interPhaseChangeFoam once again in your FOAM_USER_APPBIN and seems to me that is actually causing the error.

Just replacing your "Make/file" with the following should solve your problem.

Code:

myInterPhaseChangeFoam.C

Exe = $(FOAM_USER_APPBIN)/myInterPhaseChangeFoam

Regards,
Ricky

zzj February 20, 2017 03:43

Some problems about kinematic density
 
[QUOTE=fabian_roesler;329995][FONT=&quot]Hi

hello,fabian,your solver really works,but I have some questions about your solver.You define a variable named rhok,then add an annotation:Kinematic density for buoyancy force.
There is little information about the variable. I really can not figure out what kinematic density means,could you give me some suggestions?

kera February 20, 2017 07:01

[QUOTE=zzj;637726]
Quote:

Originally Posted by fabian_roesler (Post 329995)
[FONT=&quot]Hi

hello,fabian,your solver really works,but I have some questions about your solver.You define a variable named rhok,then add an annotation:Kinematic density for buoyancy force.
There is little information about the variable. I really can not figure out what kinematic density means,could you give me some suggestions?

I hope this helps!

https://openfoamwiki.net/index.php/B...sinesqPisoFoam

Ricky

zzj February 20, 2017 07:28

[QUOTE=kera;637754][QUOTE=zzj;637726]

hi, Ricky

thanks a lot,it really helps.

The essay gives a detailed explaination so that I can understand.

zzj

cfd@kgp May 14, 2017 12:19

Quote:

Originally Posted by fabian_roesler (Post 609591)
Hi

Actually you do not have to compile anything, as the whole solver for solidification and melting is there as a new fvOption module since version 3.

Check this out:
http://cpp.openfoam.org/v4/a02447.html#details

Cheers

Fabian



Hi Fabian and all phase-change foamers,

The solidification and melting sources (in OF 3.x and 4.x ) gives accurate transient results. I have checked both the transient meltfront evolution and the time evolution of Nusselt numbers for melting.

However, the definition of fluid fraction do not seems to convince me, especially values of fluid fraction cannot be correlated with the temperature,
Quote:


forAll(cells_, i)
{
label cellI = cells_[i];

scalar Tc = T[cellI];
scalar Cpc = Cp[cellI];
scalar alpha1New = alpha1_[cellI] + relax_*Cpc*(Tc - Tmelt_)/L_;

alpha1_[cellI] = max(0, min(alpha1New, 1));
deltaT_[i] = Tc - Tmelt_;
}

can any body explain me the rationale of this fluid fraction defination---> Cpc*(Tc - Tmelt_)/L_;

Any Research paper with this definition?

Fabian your advice is very much needed. Please help.

Thanks in advance!

gtarang June 8, 2017 13:05

Code:

Cpc*(Tc - Tmelt_)/L_
It basically gives the amount of energy contained in the fluid cell above melting point and then we divide it by L to get the fraction. If Tc < Tmelt, we get negative value and then we constrain the alpha to 0 similar things happen when alpha becomes greater than 1, we constrain it to 1.
However, based upon the Voller et al. of papers of phase change, I think Tc should be constraint to Tsolidus or Tliquidus (or Tmelt) when 0<alpha<1 and Tc is out of range of Tsolidus and Tliquidus.
After simulations with different materials I have seen that for alpha still within (0,1), T > Tmelt. I am right now trying to see what can be done about it.

Typhain June 15, 2017 13:36

Adapting convMeltFoam for version 5.0 of OpenFOam
 
Hello everyone. I'm interesting about solving melting/solidification problems on openFoam and that's why I'm trying to adapt conMeltFam parallel solver fo 5.0 version.

But there is a probleme when compiling it. In the header Teqn.H, there is a probleme when using gMax and gSum:

Code:

residual = gMax(mag(alpha3New.internalField()-alpha3.internalField()));
meanResidual = gSum(mag(alpha3New.internalField()-alpha3.internalField())*mesh.V())/gSum(mesh.V().field());

And the error message is the folowing
Code:

TEqn.H:37:78: error: no matching function for call to ‘gMax(Foam::tmp<Foam::DimensionedField<double, Foam::volMesh> >)’
Then I thought it was due to dimension of alpha3 and alpha3New so I built a forAll loop like that

Code:

        forAll(alpha3,i)
        {
        forAll(alpha3New,i)
        {
        residual = gMax(mag(alpha3New[i]-alpha3[i]));
        meanResidual = gSum(mag(alpha3New[i]-alpha3[i])*mesh.V())/gSum(mesh.V().field());
        }}

But then it say that

Code:

error: no matching function for call to ‘gMax(Foam::doubleScalar)’
So I am a little bit confuse about gMax function, what should be the dimension of alpha3 to use it ?

thanks

cfd@kgp June 16, 2017 04:48

Hi Typhain!

If I am not wrong convMeltFoam was developed for version 2.0 or 2.1.0 I have to see the exact version.

So there have been various changes in foam files. were you successful to compile the solver in OF4.0 or OF3.0 or OF2.4 or OF2.3 or OF2.1? these are some of the major releases (many changes in each step).

The conventional way is to climb one step at a time.

upload your solver and mention the compatible solver version. So we will try to upgrade it step by step till current version.

Thanks!

Typhain June 16, 2017 05:03

Hello and thanks for the answer !
Yeah I know, there is lots of step between 2.1 and 5.0 but it work for meltFoam solver post at the bigining of the conversation...
Well I wil follow your advice and climb step by step. If it work I will share my solver for 5.0 version

Bye

cfd@kgp June 16, 2017 05:09

Typhain, are you saying meltfoam got compiled in OF5.0?

if so, pls send the link of the solver

Thanks,

Typhain June 16, 2017 05:26

1 Attachment(s)
Here is the meltFoam solver for 5.0 OpenFoam.
And there is also the test case with gallium wich use meltFoam solver.
Attachment 56717

kera June 18, 2017 10:28

Hallo,

If I am not mistaken, from OpenFOAM 4.0 in order to access the internal values it make uses of "primitiveField()" instead of "internalField()" (as in the earlier versions) and hence the error with gMax.

try using this:

Code:

residual = gMax(mag(alpha3New.primitiveField()-alpha3.primitiveField()));
meanResidual = gSum(mag(alpha3New.primitiveField()-alpha3.primitiveField())*mesh.V())/gSum(mesh.V().field());

hope this helps!

Regards,
Ricky



Quote:

Originally Posted by Typhain (Post 653423)

Code:

residual = gMax(mag(alpha3New.internalField()-alpha3.internalField()));
meanResidual = gSum(mag(alpha3New.internalField()-alpha3.internalField())*mesh.V())/gSum(mesh.V().field());

And the error message is the folowing
Code:

TEqn.H:37:78: error: no matching function for call to ‘gMax(Foam::tmp<Foam::DimensionedField<double, Foam::volMesh> >)’
So I am a little bit confuse about gMax function, what should be the dimension of alpha3 to use it ?

thanks


Typhain June 20, 2017 05:26

Hello Ricky,
First of all I'd like to thank you for the answer, and then thank you for the help. Using primitiveField() work as expected and thanks to you the compilation of convMelt_parallel_solver work.

There is also details on simulation that I have to correct but I think soon, I will post the solver uptated for OF5.0 and a testCase.

My mission now is to change the entry of the simulation. In deed, I want to change the nature of the boundaries conditions : instead of having temperature, I would like to work with thermal flux.
Maybe you have an idea, of how to proceed ?

Regards
Typhain

cfd@kgp June 20, 2017 06:17

Dear Typhain,

There are two ways to proceed for implementing heat flux boundary condition namely,

1. programming method, edit the current boundary condition file located in src directory --> (Dirichlet boundary condition) to Neumann boundary condition or Robin based on your need. This methods involves compilation and then adding the name of.lib in the controlDict

2. Second method is slightly simpler, by using the groovy boundary conditions (check the implementation details here https://openfoamwiki.net/index.php/Contrib/groovyBC).
here also u have to add "libs ( "libgroovyBC.so" );" in controlDict

3. I am not very sure whether swak4foam can also help u in doing this.

But I would go for option 2. Happy Foaming!

Regards,
cfd@kgp

dshafer July 18, 2017 11:40

unconstrained close-contact melting
 
Fabian, would you be willing to share the solver you mention in your thesis which takes unconstrained close contact melting into account?

I realize your thesis came out some time ago - perhaps some of the other solvers mentioned on this forum have been updated to model unconstrained melting? If not, I would be very grateful for suggestions for how to implement this myself. At the moment I'm simply hoping to replicate a simple test case of Octadecane melting in a spherical enclosure.

Full disclosure: I am new to OpenFOAM and have only attempted to model this problem in COMSOL and Fluent so far, without success. I expect the solution will require me to modify the momentum equation to A*(u - u_sink), where A is the porosity function and u_sink is the sinking velocity of the solid. I am not sure how to define u_sink in this case.

I'm hoping OpenFOAM will be more suitable to this problem!

Many thanks


Quote:

Originally Posted by fabian_roesler (Post 513359)
Hi Folks

My PhD thesis on modeling and simulation of phase change processes in macro encapsulated latent heat thermal energy storage is now published. It is written in German and was published by the Logos Verlag Berlin.

Modellierung und Simulation der Phasenwechselvorgänge in makroverkapselten latenten thermischen Speichern
Thermodynamik: Energie - Umwelt - Technik, Bd. 24
Fabian Rösler
ISBN 978-3-8325-3787-6

http://www.logos-verlag.de/cgi-bin/e...87&lng=deu&id=

The convMeltFoam solver as well as the solver which takes unconstrained close contact melting and an additional gas phase into account are explained in detail. Experimental validation in an rectangular cavity is performed.
Hope you like it.

Cheers

Fabian


dshafer July 18, 2017 12:52

unconstrained close-contact melting
 
Dear all,

Does anyone know if the solvers discussed in this thread can be used to model unconstrained close-contact melting? I am trying to replicate a simple case study of Octadecane melting in a spherical enclosure, but am not aware of any solvers which can take the sinking of the solid into account.

I should note that I am new to OpenFOAM, and have only attempted to solve this problem in COMSOL and Fluent so far (without success).

I'd love to know if anyone has had success using OpenFOAM for these purposes!

Thank you!

ahmed1981 July 19, 2017 08:06

Hi Typhain
is there OpenFoam version 5.0 ready for download, I search for this version in internet but I do not find it.
I now use openFoam 4.1, I ask can I use meltFoam solver for this version, If your answer is yes. How can I use this solver please .

I ask that because I am new to OpenFoam, And I want to model phase change materials
.
Thank you very much


Ahmed Almudhafar

janghel August 3, 2017 07:50

Solidification with shrinkage
 
Dear All,
Is there any one who has successfully modelled solidification with shrinkage. I want to do the shrinkage model in openfoam. But i dont know from where should I start.

janghel August 25, 2017 03:29

Quote:

Originally Posted by fabian_roesler (Post 469557)
Hi callahance

I did exactly what you propose in my thesis. However, I am still in the PhD process and want the solver, results and thesis be public not before my defense of the doctor's thesis. You are right; I combined the compressibleInterFoam solver with my own melting solver to allow a free surface between liquid and gas.

Regards

Fabian

Hello Fabian,
I am trying to solve the three phase problem with your convFinMeltFoam solver. I have taken Fin material as air (third phase) with solid and liquid. I want to track the interface of liquid and air using VOF as solidification takes place. Due to density difference in solid and liquid, volume will shrink. I am unable to combine the solver with interFoam.
Please give some advice...

kera September 7, 2017 09:06

Hallo diwaker,

I am also trying to implement shrinkage model due to density variations, were you able to find some good literature?

I am currently trying to adapt the model described in [1] to my solver:

[1] "M. Raessi and J. Mostaghimi, Three-dimensional modeling of density variation due to phase change in complex free surface flows, Numerical Heat transfer, Part B, 47: 507-531, 2005"

Thank you in advance.

Regards,
Ricky

Quote:

Originally Posted by janghel (Post 659356)
Dear All,
Is there any one who has successfully modelled solidification with shrinkage. I want to do the shrinkage model in openfoam. But i dont know from where should I start.


janghel September 7, 2017 14:25

Quote:

Originally Posted by kera (Post 663541)
Hallo diwaker,

I am also trying to implement shrinkage model due to density variations, were you able to find some good literature?

I am currently trying to adapt the model described in [1] to my solver:

[1] "M. Raessi and J. Mostaghimi, Three-dimensional modeling of density variation due to phase change in complex free surface flows, Numerical Heat transfer, Part B, 47: 507-531, 2005"

Thank you in advance.

Regards,
Ricky

Dear kera,
you can look into paper by Sun and Garimella, they have done solidification shrinkage of TNT.
"Numerical and Experimental Investigation of Solidification Shrinkage" 2007
i have some more papers but they are not like Raessi's paper. Using raessi's model you can get 3D cavity.
I am also trying to implement the model by Sun and Garimella. but no progress so far..
were you able to implement shrinkage?

ThankYou

kera September 11, 2017 04:39

Hallo diwaker and FOAMers,

I tried to implement the source term in "alphaEqn" as per this forum https://www.cfd-online.com/Forums/op...-alpha-eq.html and it seems that the source term is being calculated (checked via some print statements), but the problem is I don't see any effect in the simulation. --> This time I blindly followed Sun and Garimella [1], maybe I am doing something wrong.

Here is a snippet of the code.

Code:

volScalarField Sp
    (
        IOobject
        (
            "Sp",
        runTime.timeName(),
        mesh
        ),
      ((rhol - rhos)*gammas*fvc::ddt(alpha1)/rhol  - gammas*fvc::div(phiAlpha1))
    );

explicitSolve:

Code:

MULES::explicitSolve(geometricOneField(), alpha1, phi, tphiAlpha(), Sp,Su, 1, 0);
I am not sure where exactly is the problem, any help is really appreciated.

Thank you!

Regards,
Ricky

[1] " D. Sun and S.V. Garimella, Numerical and Experimental Investigation of Solidification Shrinkage, Prude University, 2007"

Quote:

Originally Posted by janghel (Post 663574)
Dear kera,
you can look into paper by Sun and Garimella, they have done solidification shrinkage of TNT.
"Numerical and Experimental Investigation of Solidification Shrinkage" 2007
i have some more papers but they are not like Raessi's paper. Using raessi's model you can get 3D cavity.
I am also trying to implement the model by Sun and Garimella. but no progress so far..
were you able to implement shrinkage?

ThankYou


janghel September 11, 2017 06:16

Dear ricky,
You are One step ahead of me. I am actually working on solver of Fabian with little modification. I combined the solver with interFoam. Right now i am working on it. will update you ASAP. Meanwhile i tried to combine the solidification solver with compressibleinterFoam. But it did not work. I got an error. I will try your approach by adding source term to alphaEqn. One Question?
Did you solve continuity equation with source terms mentioned in both the papers...?

Regards
Diwakar janghel

MSF November 13, 2017 05:07

Hi
Quote:

Dear all,

Does anyone know if the solvers discussed in this thread can be used to model unconstrained close-contact melting? I am trying to replicate a simple case study of Octadecane melting in a spherical enclosure, but am not aware of any solvers which can take the sinking of the solid into account.

I should note that I am new to OpenFOAM, and have only attempted to solve this problem in COMSOL and Fluent so far (without success).

I'd love to know if anyone has had success using OpenFOAM for these purposes!

Thank you!
If you want to implement close-contact melting you can use multiple approaches: Variable viscosity, force balance + Darcy term or prescribe the settling velocity with forcing functions. Here are some links to papers. The first two models are in OpenFoam, the third was implemented in Matlab I think.

http://www.sciencedirect.com/science...17931017329241
Darcy-Term + force balance
https://link.springer.com/article/10.1007/s00231-016-1932-0
Variable viscosity
http://www.sciencedirect.com/science...17931017300856
Forcing functions + force balance


Best
Moritz

Shekhar@03 August 3, 2018 11:05

Quote:

Originally Posted by AnjaMiehe (Post 365815)
Hello David,

this I not trivial for me either as the solver was coded in 1.4.1, or at least that is the tag in the test case. Also, the test case proposes icoFoam, a PISO based solver, to solve the test case. I tried to rewrite meltFoam in 2.1.0 using the SIMPLE Algorithm but I found far more similarities in coding with the icoFoam solver in 2.1.0.

Therefore, and as my try for the meltSimpleFoam does compile but not solve the test case, here is my idea for the meltIcoFoam in 2.1.0 . For me, it compiles only with warnings and the rough test case given earlier in this thread works alright. I can't guarantee for anything.


I hope this is a help for you,
Regards, Anja

can you please provide a test case for this solver?

Germilly October 22, 2018 06:56

Hello ahmmedshakil,

I am dealing with the same problem (post: #100), have you solved it?

My energy equation is:

Code:

  fvm::div(phiCpf, Tf) - fvm::laplacian(por*kf, Tf)
 - hconv*Ts + fvm::Sp(hconv, Tf)

where phiCpf is:
Code:

phiCpf = fvc::interpolate(cpf)*phi
Tf is the temperature of the fluid...cpf is function of temperature using a polynomial equation.

The solver is running, but the final result does not respect the conservation of energy.

I think I have to do some correction, because of fvm::div(phiCpf, Tf) ...

Can you help me?

Thank you

GB

Parsa Nazmi November 28, 2018 01:49

Melting a simple 2-dimensional ice
 
Hi Everyone

I'm new to OpenFoam6 and I want to melt a two dimensional square ice with conduction. I don't know how to start. Can you help me about solver?:)

hemanth17 December 1, 2018 11:15

hey i m using this sovler and i m facing an error(heat generation at bottom left corner) intial condition upper wall at higher temperature, lower wall at lower temperature, left and right wall at zero gradient condition https://imgur.com/a/cafoEQr


All times are GMT -4. The time now is 12:10.