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

laplacianfoam with solidification

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By dakos

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 9, 2009, 13:22
Default laplacianfoam with solidification
  #1
New Member
 
Join Date: May 2009
Posts: 7
Rep Power: 16
dakos is on a distinguished road
Hi,
I'm trying to add solidification to laplacianfoam (I'm not interested in convective flux, but only in conduction with heat source).
My problem is that the temperature I have calculated in a simple test doesn't seem correct (a simple square cavity with uniform temperature inside, 700°C, and fixed temperature to the rigth wall, 500°C).
The temperature decreases too fast!

Modification to laplacianfoam:

Info<< "\nCalculating temperature distribution\n" << endl;

for (runTime++; !runTime.end(); runTime++)
{
Info<< "Time = " << runTime.timeName() << nl << endl;

# include "readSIMPLEControls.H"

for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
solve
(
rho * cp * fvm::ddt(T)
+ Lh * rho * fvc::ddt(alpha1)
- fvm::laplacian(kT, T)
);
alpha1 = max(min((T-Ts)/(Tl-Ts),scalar(1)),scalar(0));
Info<< "Liquid phase volume fraction = "
<< alpha1.weightedAverage(mesh.V()).value()
<< " Min(alpha1) = " << min(alpha1).value()
<< " Min(alpha2) = " << min(alpha2).value()
<< endl;
alpha2 = scalar(1) - alpha1;
rho = alpha1*rho1 + alpha2*rho2;
cp = alpha1*cp1 + alpha2*cp2;
kT = alpha1*kT1 + alpha2*kT2;
}

runTime.write();

Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
}

Info<< "End\n" << endl;

return(0);

Modification to Createfield:

Info<< "Reading transportProperties\n" << endl;

IOdictionary transportProperties
(
IOobject
(
"transportProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);


dimensionedScalar rho1
(
transportProperties.lookup("rho1")
);

dimensionedScalar rho2
(
transportProperties.lookup("rho2")
);

dimensionedScalar cp1
(
transportProperties.lookup("cp1")
);

dimensionedScalar cp2
(
transportProperties.lookup("cp2")
);

dimensionedScalar kT1
(
transportProperties.lookup("kT1")
);

dimensionedScalar kT2
(
transportProperties.lookup("kT2")
);

dimensionedScalar Tl
(
transportProperties.lookup("Tl")
);

dimensionedScalar Ts
(
transportProperties.lookup("Ts")
);

dimensionedScalar Lh
(
transportProperties.lookup("Lh")
);

Info<< "Reading field T\n" << endl;

volScalarField T
(
IOobject
(
"T",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);

Info<< "Reading field alpha1\n" << endl;
volScalarField alpha1
(
IOobject
(
"alpha1",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh
);

Info<< "Calculating field alpha2\n" << endl;
volScalarField alpha2("alpha2", scalar(1) - alpha1);

Info<< "Reading field rho\n" << endl;
volScalarField rho
(
IOobject
(
"rho",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh
);

Info<< "Reading field cp\n" << endl;
volScalarField cp
(
IOobject
(
"cp",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh
);

Info<< "Reading field kT\n" << endl;
volScalarField kT
(
IOobject
(
"kT",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh
);

Can someone tell me where am I wrong?

Dario
brucechen likes this.
dakos is offline   Reply With Quote

Old   November 14, 2009, 06:15
Default
  #2
New Member
 
Join Date: May 2009
Posts: 7
Rep Power: 16
dakos is on a distinguished road
Hi,
the problem is in the source term that is always 0.
How can I use the old value of alpha1, to compute:

Q = Lh*rho*(alpha1-alpha1OLD)?

Dario
dakos is offline   Reply With Quote

Reply

Tags
phase change, solidification


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
tracking the solidification front Kuba FLUENT 1 May 25, 2018 03:06
Solidification in OpenFoam luke.christ OpenFOAM 24 September 10, 2013 07:50
About the solidification? H.P.LIU Phoenics 1 December 1, 2010 09:49
Restart for Solidification atulverma FLOW-3D 3 May 6, 2009 17:40
Solidification problem: viscosity ratio limited Deepak FLUENT 0 December 11, 2008 13:08


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