Skip to content

Commit 55410be

Browse files
author
Henry Weller
committed
laminarModels::lambdaThixotropic: Reformulated lambda equation in conservative form
to support standard fvModel sources.
1 parent 4bbcf7e commit 55410be

File tree

2 files changed

+34
-9
lines changed

2 files changed

+34
-9
lines changed

src/MomentumTransportModels/momentumTransportModels/laminar/lambdaThixotropic/lambdaThixotropic.C

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
========= |
33
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
44
\\ / O peration | Website: https://openfoam.org
5-
\\ / A nd | Copyright (C) 2020-2023 OpenFOAM Foundation
5+
\\ / A nd | Copyright (C) 2020-2024 OpenFOAM Foundation
66
\\/ M anipulation |
77
-------------------------------------------------------------------------------
88
License
@@ -75,7 +75,16 @@ lambdaThixotropic<BasicMomentumTransportModel>::lambdaThixotropic
7575
? dimensionedScalar("sigmay", dimPressure/dimDensity, this->coeffDict_)
7676
: dimensionedScalar("sigmay", dimPressure/dimDensity, 0)
7777
),
78-
78+
residualAlpha_
79+
(
80+
dimensioned<scalar>::lookupOrAddToDict
81+
(
82+
"residualAlpha",
83+
this->coeffDict_,
84+
dimless,
85+
1e-6
86+
)
87+
),
7988
lambda_
8089
(
8190
IOobject
@@ -210,7 +219,9 @@ template<class BasicMomentumTransportModel>
210219
void lambdaThixotropic<BasicMomentumTransportModel>::correct()
211220
{
212221
// Local references
213-
const surfaceScalarField& phi = this->phi_;
222+
const alphaField& alpha = this->alpha_;
223+
const rhoField& rho = this->rho_;
224+
const surfaceScalarField& alphaRhoPhi = this->alphaRhoPhi_;
214225
const Foam::fvModels& fvModels(Foam::fvModels::New(this->mesh_));
215226
const Foam::fvConstraints& fvConstraints
216227
(
@@ -221,12 +232,20 @@ void lambdaThixotropic<BasicMomentumTransportModel>::correct()
221232

222233
tmp<fvScalarMatrix> lambdaEqn
223234
(
224-
fvm::ddt(lambda_) + fvm::div(phi, lambda_)
225-
- fvm::Sp(fvc::div(phi), lambda_)
235+
fvm::ddt(alpha, rho, lambda_)
236+
+ fvm::div(alphaRhoPhi, lambda_)
226237
==
227-
a_*pow(1 - lambda_(), b_)
228-
- fvm::Sp(c_*pow(strainRate(), d_), lambda_)
229-
+ fvModels.source(lambda_)
238+
alpha()*rho()*a_*pow(1 - lambda_(), b_)
239+
- fvm::Sp
240+
(
241+
rho()
242+
*(
243+
alpha()*c_*pow(strainRate(), d_)
244+
+ max(residualAlpha_ - alpha(), dimensionedScalar(dimless, 0))*a_
245+
),
246+
lambda_
247+
)
248+
+ fvModels.source(alpha, rho, lambda_)
230249
);
231250

232251
lambdaEqn.ref().relax();

src/MomentumTransportModels/momentumTransportModels/laminar/lambdaThixotropic/lambdaThixotropic.H

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
========= |
33
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
44
\\ / O peration | Website: https://openfoam.org
5-
\\ / A nd | Copyright (C) 2020-2023 OpenFOAM Foundation
5+
\\ / A nd | Copyright (C) 2020-2024 OpenFOAM Foundation
66
\\/ M anipulation |
77
-------------------------------------------------------------------------------
88
License
@@ -119,6 +119,12 @@ class lambdaThixotropic
119119
//- Optional Bingham plastic yield stress [m^2/s^2]
120120
dimensionedScalar sigmay_;
121121

122+
//- Residual alpha
123+
// Used to stabilise the solution of the lambda equation
124+
// where the phase-fraction is below this value
125+
// Defaults to 1e-6
126+
dimensionedScalar residualAlpha_;
127+
122128
//- Structural parameter
123129
// 0 = freestream value (most liquid)
124130
// 1 = fully built (most solid)

0 commit comments

Comments
 (0)