Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions applications/solvers/additiveFoam/additiveFoam.C
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ int main(int argc, char *argv[])

while (runTime.run())
{
#include "updateProperties.H"

#include "readDyMControls.H"
#include "CourantNo.H"
#include "setDeltaT.H"
Expand All @@ -104,6 +102,22 @@ int main(int argc, char *argv[])

mesh.update();

if (mesh.topoChanged())
{
// Temperature is authoritative after topology changes. A
// conservative scheme should consider enthalpy as authoritative.
forAll(mesh.cells(), cellI)
{
scalar alpha1_ =
interpolateXY(T[cellI], thermo.x(), thermo.y());
alpha1[cellI] = min(max(alpha1_, 0.0), 1.0);
}

alpha1.correctBoundaryConditions();

#include "updateProperties.H"
}

runTime++;

Info<< "Time = " << runTime.name() << nl << endl;
Expand All @@ -123,6 +137,8 @@ int main(int argc, char *argv[])

#include "thermo/TEqn.H"

#include "updateProperties.H"

runTime.write();

Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
Expand Down
10 changes: 3 additions & 7 deletions applications/solvers/additiveFoam/updateProperties.H
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
alpha3 *= pos0(solidus - T);
alpha3.correctBoundaryConditions();

forAll(mesh.cells(), cellI)
{
// update phase fractions
scalar alpha1_ = alpha1[cellI];
scalar alpha2_ = 1.0 - alpha1[cellI];

if (alpha1_ < 1.0)
{
alpha3[cellI] = 0.0;
}
scalar alpha3_ = alpha3[cellI];

// update temperature ranges for phase properties
Expand All @@ -24,6 +21,5 @@ forAll(mesh.cells(), cellI)
+ alpha3_*Cp3.value(T1);
}

alpha3.correctBoundaryConditions();
Cp.correctBoundaryConditions();
kappa.correctBoundaryConditions();
Loading