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)

som October 20, 2011 13:15

melting problem: looking for appropriate solvers
 
Did anybody solve melting problem with OpenFoam. Are there any appropriate solvers exist?

nimasam October 20, 2011 15:23

meltFoam
 
1 Attachment(s)
1) here is a solver i found some months ago in forum so if you search in forum you maybe find more

2) to use this solver, compile it with wmake command

3) it has a test case ;) too

som October 20, 2011 16:08

many thanks i'll try it asap

fabian_roesler October 29, 2011 16:03

New non-isothermal melting solver
 
2 Attachment(s)
Hi

I was writing a new melting solver for non-isothermal phase change. It can be used for isothermal melting as well. In the near future I want to combine meltFoam with my new solver which is significantly faster than the old solver. I although wrote an article about my work. Have a look here:


F. Rösler, D. Brüggemann (2011): Shell-and-tube type latent heat thermal energy storage: numerical analysis and comparison with experiments. Heat and Mass Transfer, Vol. 47 Issue 8 , 1027-1033, DOI: 10.1007/s00231-011-0866-9
http://www.springerlink.com/content/b1tp01k2u7q8j432/

What do you plan to do?

Regards

Fabian


Attachment 9805
Attachment 9806

som October 31, 2011 13:57

Quote:

Originally Posted by nimasam (Post 328791)
1) here is a solver i found some months ago in forum so if you search in forum you maybe find more

2) to use this solver, compile it with wmake command

3) it has a test case ;) too


It's been written for openFoam 1.3. I've managed to compile it after some minor changes for openfoam v2.01 .It works fine. Thanks again, Serge

nimasam October 31, 2011 14:07

yourwelcome, you can pay it forward :D
by putting your modified solver here for other users use ;)

be lucky

som November 1, 2011 12:56

Quote:

Originally Posted by fabian_roesler (Post 329995)
Hi

I was writing a new melting solver for non-isothermal phase change. It can be used for isothermal melting as well. In the near future I want to combine meltFoam with my new solver which is significantly faster than the old solver. I although wrote an article about my work. Have a look here:


F. Rösler, D. Brüggemann (2011): Shell-and-tube type latent heat thermal energy storage: numerical analysis and comparison with experiments. Heat and Mass Transfer, Vol. 47 Issue 8 , 1027-1033, DOI: 10.1007/s00231-011-0866-9
http://www.springerlink.com/content/b1tp01k2u7q8j432/

What do you plan to do?

Regards

Fabian


Attachment 9805
Attachment 9806


Hello. Your solver also works after some minore changes. Very fast for testcase geometry

fabian_roesler November 7, 2011 02:16

Re: Melting problem
 
Quote:

Originally Posted by som
hello, Fabian

I read your artical. It's very interesting for me.
Now I try to solve the following case : moving spherical
heat source in a tube storrage. How do you think is it possble to apply your solver for this problem?

Hi som

I don't quite know what you mean with moving spherical heat source. But it sounds to me like a boundary condition, right? So it must be possible to attach my solver to this problem.
Glade you like my solver. I'm still working on it to allow moving rigid body (solid phase) and volume expansion of the melt into a gaseous phase with volume-of-fluid method.

Regards

Fabian

som November 21, 2011 07:25

I have a ball with fixed T gradient on the boundary. this ball is placed into tube full of wax. Your solver acts very well with such problem.

Now i have new problem. I want make the ball moving in the tube.
I've tried to setup the boundary of the ball to type movingWallVelocity and run the case. Everything is good but a cant see any boundary displacement in ParaFoam.
Any ideas?

AnjaMiehe February 14, 2012 04:05

1 Attachment(s)
Hello everybody,

Quote:

Originally Posted by nimasam (Post 330202)
yourwelcome, you can pay it forward :D
by putting your modified solver here for other users use ;)

I quite agree and as I succeeded in compiling it in 2.1.0, see for the adapted solver below. The testcase given earlier by Fabian works and a Stefan-Problem testcase shows very good agreement between the numerical and the analytical solution.

som March 4, 2012 13:37

Quote:

Originally Posted by AnjaMiehe (Post 344292)
Hello everybody,



I quite agree and as I succeeded in compiling it in 2.1.0, see for the adapted solver below. The testcase given earlier by Fabian works and a Stefan-Problem testcase shows very good agreement between the numerical and the analytical solution.



What Stefan problem testcase do you mean? Where can i find it?

AnjaMiehe March 4, 2012 13:52

Hello Serge,

and welcome back to the thread. The Stefan Problem or Stefan Task is a classical testcase of solidification or melting, in fact where a moving boundary is met. The problem has an analytical solution depending on the various possible boundary conditions and as it is but 1 dimensional, it is very fast to validate parts of the code.

Try the key words "Stefan task solidification melting" in google or google scholar. I have just tried it and received lots of good hits.

Have a nice evening, Anja

som March 4, 2012 14:19

Quote:

Originally Posted by AnjaMiehe (Post 347579)
Hello Serge,

and welcome back to the thread. The Stefan Problem or Stefan Task is a classical testcase of solidification or melting, in fact where a moving boundary is met. The problem has an analytical solution depending on the various possible boundary conditions and as it is but 1 dimensional, it is very fast to validate parts of the code.

Try the key words "Stefan task solidification melting" in google or google scholar. I have just tried it and received lots of good hits.

Have a nice evening, Anja


yes, i know about it. I asked you about testcase for openfoam. Did you mean galliumErfMelting testcase or something else?

fabian_roesler March 5, 2012 02:19

Stefan Testcase
 
Hi

I used the gallium melting test case by Gau and Viskanta [Gau C. and Viskanta R.: Melting and Solidification of a Pure Metal on a Vertical Wall, Journal of Heat Transfer, 1986, 108(1), pp. 174–181] for validation. However there are two Stefan problem test cases that are also often used when it comes to melting simulation. The one phase or two phase Stefan problem. Have a look into Cranks book [Crank J.: Free and Moving Boundary Problems, 1984, Oxford University Press, Oxford].

Regards

Fabian

AnjaMiehe March 5, 2012 06:55

Quote:

Originally Posted by som (Post 347584)
yes, i know about it. I asked you about testcase for openfoam. Did you mean galliumErfMelting testcase or something else?

Hi,

I used the testcase of Fabian, the gallium melting and the Stefan Problem.

Regards, Anja

salehda June 6, 2012 22:21

Hi
I am trying to Compile the meltFoam.C , but I wasn't succesful because it was made for an older version - I had OpenFOAM-2.1.0 .
and while compiling it gave me an error message related to
readSIMPLEControls.H: No such file or directory
Any suggestions how to solve that please ?

Thanks
David

AnjaMiehe June 11, 2012 09:09

1 Attachment(s)
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

fabian_roesler June 11, 2012 09:28

compilation meltFoam
 
Hi

The meltFoam solver is based on the old buoyantBoussinesqPisoFoam solver as buoyancy is taken into account. You should be able to translate the solver to OpenFOAM 2.1.x. I did that few month ago but without comments and bad syntax. Maybe I can post the solver for OF_2.1.x after a small revision in the next days if you still need it :).

Regards

Fabian

fabian_roesler June 11, 2012 10:22

new MeltFoam solver for OF 2.1
 
1 Attachment(s)
Hi all

I posted that it might take some time to review the meltFoam solver and port it from OF_1.7 to OF_2.1 but I felt like doing it instantly. So here you go :). I hope you enjoy it.

Regards

Fabian

AnjaMiehe June 12, 2012 07:36

Hello,
thanks for the code Fabian, nice to see that I did a good job with the changings of erfConvectiveMeltingPimpleFoam posted here in #10 earlier ;-)
As far as my post on meltIcoFoam goes, I thought David was asking for an adapted coding of the solver in post #2 and that one is based on 1.4.1.
Thanks again for your code in general, I am having fun with it.

Anja

fabian_roesler June 12, 2012 08:06

isothermal phase change
 
Hi

Sorry, I messed up the two solvers and thought that David needed my solver for OF_2.1.
I once compiled the meltFoam solver for isothermal phase change problems for OF_1.7. I remember the problem you are talking about. You can go for icoFoam but I would suggest using the buoyantBoussinesPimpleFoam. You can use pimpleControls instead simpleControls in the old solver. However syntax changed a little bit during the years.

Regards

Fabian

AnjaMiehe June 13, 2012 04:06

Hi,
I have absolutely no idea which of the solvers David meant but know he has both and you additional ideas. Thanks for the like.
Regards, Anja

salehda August 15, 2012 13:45

Thanks Fabian and Anja , this had been helpful to me and I agree , i think that buoyantboussinesqFoam is more suitable

chaolian November 7, 2012 08:29

1 Attachment(s)
Hello, AnjaI also modified meltFoam, instead of using enthalpy based update like yours I used temperature based update for my liquid fraction. All the others are similar to yours. But my results are not correct, do you have any suggestions? Thanks in advance.

fabian_roesler November 8, 2012 03:09

linear step and continuous liquid fraction function
 
Hi Chaolian

Nice that somebody else then Anja and I are interested into solid/liquid phase change problems. As you already know, the linear liquid fraction is the standard case from literature as proposed by many authors. There are some predictor corrector methods to update temperature to be consistent with the enthalpy-temperature-curve. This is necessary as the enthalpy equation is non-linear. In the case of a continuous liquid fraction function, you can substitute the function into the energy conservation equation. The drawback is that you still have a non-linear function. But as you do not solve for the liquid fraction anymore, the non-linear behavior is quite small. The error is small and so no or only a few iterations are necessary to solve the equation.
I once programed a solver for the linear function using the Brent et al. corrector method and some newer method by Voller. However the solver was not very stable and still 20 and more iterations for the temperature were necessary for solving.

Hope this helps

Best wishes

Fabian

chaolian November 8, 2012 03:37

Quote:

Originally Posted by fabian_roesler (Post 390938)
Hi Chaolian

Nice that somebody else then Anja and I are interested into solid/liquid phase change problems. As you already know, the linear liquid fraction is the standard case from literature as proposed by many authors. There are some predictor corrector methods to update temperature to be consistent with the enthalpy-temperature-curve. This is necessary as the enthalpy equation is non-linear. In the case of a continuous liquid fraction function, you can substitute the function into the energy conservation equation. The drawback is that you still have a non-linear function. But as you do not solve for the liquid fraction anymore, the non-linear behavior is quite small. The error is small and so no or only a few iterations are necessary to solve the equation.
I once programed a solver for the linear function using the Brent et al. corrector method and some newer method by Voller. However the solver was not very stable and still 20 and more iterations for the temperature were necessary for solving.

Hope this helps

Best wishes

Fabian

Hello Fabian,
It's very nice to get your reply. I totally agree with you that your erf fitting approach, and some other predictor corrector method are better than classical linear approach. What I want to do is just try to implement the classical approach as a good practice to learn OpenFOAM structure and coding syntax, etc.

Many thanks for your reply and comments,
Best,
Chao

tvincent2k February 8, 2013 11:05

Quote:

Originally Posted by fabian_roesler (Post 365835)
Hi all

I posted that it might take some time to review the meltFoam solver and port it from OF_1.7 to OF_2.1 but I felt like doing it instantly. So here you go :). I hope you enjoy it.

Regards

Fabian

This is great! I'm glad to see people have been working on this. I took this code and modified it to use the SIMPLE algorithm for steady-state conditions and was able to solve the gallium melting test case with it.

Now I'm wondering if you have made any progress on adding motion to the solid region. It seems like it is a little more complicated than simply adding a DC*(volVectorField solidVelocity) term to the explicit terms of the momentum equation. I tried that and the solution won't converge.

Any ideas?

AnjaMiehe February 13, 2013 07:09

Hello Tim,

nice to see that this thread does put together people interested in solving for solidification with OpenFOAM.

As far as your question is concerned, I do not know why your code does not converge. I started from the updated code I posted, everything is still transient although I am dealing with continuous casting and do have quasi steady-state conditions as well. Then I added in the "createFields.H" the following field:
Code:

    Info<< "Reading field Us\n" << endl;
    volVectorField Us
    ( 
        IOobject
        ( 
            "Us",
            runTime.timeName(),
            mesh,
            IOobject::MUST_READ,
            IOobject::AUTO_WRITE
        ), 
        mesh
    );

And the velocity equation looks as follows:
Code:

    fvVectorMatrix UEqn
    ( 
        fvm::ddt(U)
      + fvm::div(phi, U)
      - fvm::laplacian(nu, U)
      + fvm::Sp(DC, U) // since DC=>0, all time implicit is possible
      - DC*Us  // additional term for moving solidified shell << continuous casting >>
    ); 

    UEqn.relax();

This works for me, although there may be "better" approaches.
The Us field, you first copy the U file, then you change for your velocities - if they are that easy to be got. I am dealing with a curvilinear geometry, so I do produce my Us velocity field using a Stokes solution, that means I do use simpleFoam with the exact same region and boundaries but very high viscosity. Then, I do copy the final velocity field to be my Us.

I hope that will help you.
Regards, Anja

tvincent2k February 13, 2013 10:45

Thanks Anja! It looks like that is basically the same thing that I was trying. I did a little more investigating and found that my problem was related to need for greater relaxation. I had my T relaxationFactor set to 0.5 but I needed it at 0.2 for my problem. I am guessing this is related to the interaction between the complex temperature/velocity boundary condition that I am using and the constant velocity of the solid region. Happily my solution is converging now.

fabian_roesler February 13, 2013 11:52

close-contact melting
 
Hi Anja,
hi Tim

I can just confirm your steps to include solid movement into the solver. I used the following:


Code:

fvVectorMatrix UEqn
  ( 
      fvm::ddt(rho, U)
  + fvm::div(rhoPhi, U)
  - fvm::laplacian(mu, U)
  + rho*fvm::Sp(DC, U)
  - rho*DC*Us
  );

The main question is whether you have a fixed and constant velocity like in continuous molding or if you have unconstrained melting with settling solid. In this case you will need some equations of movement to describe the settling process of the solid phase. This leads to a complex highly non-linear and coupled problem. However it is necessary to model close-contact melting. This is what I am doing at the moment. But the model and solver are not yet validated with experimental data.

Best wishes

Fabian

chaolian March 3, 2013 23:35

Quote:

Originally Posted by fabian_roesler (Post 365835)
Hi all

I posted that it might take some time to review the meltFoam solver and port it from OF_1.7 to OF_2.1 but I felt like doing it instantly. So here you go :). I hope you enjoy it.

Regards

Fabian

Thanks for your work. But why don't you have U solver in system/fvSolution file? Don't you solve UEqn?

fabian_roesler March 4, 2013 02:24

momentumPredictor
 
Hi,

the U solver is only necessary when using a momentumPredictor step in PISO or PIMPLE. I don't do the predictor step as it does not help convergence for the melting case. Without predictor step, U is corrected after the pressure equation.

Regards

Fabian

Yahoo March 4, 2013 12:07

Concentration equation
 
It is good to see people are working on melting problem. Have you guys ever tries to include species equation in your codes? That is what I am working on right now. Any comments?

chaolian March 4, 2013 12:11

Quote:

Originally Posted by Yahoo (Post 411441)
It is good to see people are working on melting problem. Have you guys ever tries to include species equation in your codes? That is what I am working on right now. Any comments?

I know in thermodynamic model there are some species parameters specified in constant/thermophysicalProperties file. But I don't know too much of it. Here's something about this model: http://www.openfoam.org/docs/user/thermophysical.php

fabian_roesler March 5, 2013 02:45

Species
 
Hi there

No, never tried that. But it should not be that hard to implement it. Just add another volScalarField C and solve for it after the energy conservation equation. You also have to use another liquid fraction function and an additional one for the concentration. As all melting solvers here in the thread refer to the enthalpy porosity method by Voller and Prakash you could have a look for their solver. They wrote an article on the method for additional species transport.

Regards


Fabian

Yahoo March 5, 2013 11:55

Fabian:

Thanks for your answer, I really appreciate it.

However, the problem I am working on is somehow different so I am not sure I can use your solver. In your paper you have updated liquid fraction by an error function (equation (6) in the paper), but I want to use Lever Micro-segregation rule for liquid fraction, and since it is numerical very unstable so I have implemented the liquid fraction updating scheme by C. Prakash and V. Voller. in "ON THE NUMERICAL SOLUTION OF CONTINUUM MIXTURE MODEL EQUATIONS DESCRIBING BINARY SOLID-LIQUID PHASE CHANG, Numerical Heat Transfer, Part B:Volume 15, Issue 2, 1989"

I will updated you guys in this thread if i find sth interesting.

Yahoo April 8, 2013 18:30

Hi Fabian
Would you please let me know why you have used "mesh.solver( .select(finalIter))" in your code? What does this statement do?

fabian_roesler April 13, 2013 02:47

p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.fin alInnerIter())))
 
Hi Yahoo

Have a look into pisoFoam solver. There you have this statement split up. In most solvers, you specify two different tolerances. One for the last iteration and the other for all previous iterations. An example:

Code:


    p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())))

Code:

   
    p_rgh
    {
        solver          PCG;
        preconditioner  DIC;
        tolerance      1e-8;
        relTol          0.01;
    }

    p_rghFinal
    {
        $p_rgh;
        relTol          0;
    }

Here the relative tolerance is set to zero for the last inner iteration to be sure to reach the absolute tolerance of 1e-8. The statement just sais when to choose the final tolerance, namely for the finalInnerIter().

Regards

Fabian

Yahoo April 17, 2013 13:35

Hi Guys
Have you tried to compile erfConvectiveMeltingPimpleFoam.C (Fabian's code for melting) on OpenFOAM 2.2.0? I am getting this compile error:

make: *** No rule to make target `/opt/OpenFOAM-2.2.0/src/finiteVolume/lnInclude/newFvPatchField.C', needed by `erfConvectiveMeltingPimpleFoam.dep'. Stop.

fabian_roesler April 18, 2013 03:00

OF2.1 meltFoam
 
Hi,

you could just use the solver for OF2.1 I posted here :confused::

http://www.cfd-online.com/Forums/ope...tml#post365835

Regards

Fabian


All times are GMT -4. The time now is 22:02.