File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
applications/modules/twoPhaseSolver Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -142,7 +142,7 @@ void Foam::solvers::twoPhaseSolver::alphaSolve
142142 }
143143
144144 // Set the time blending factor, 1 for Euler
145- scalar cnCoeff = 1.0 /(1.0 + ocCoeff );
145+ const scalar cnCoeff = 1.0 /(1.0 + ocCoeff );
146146
147147 tmp < surfaceScalarField > phiCN (phi );
148148
@@ -232,13 +232,23 @@ void Foam::solvers::twoPhaseSolver::alphaSolve
232232
233233 for (int aCorr = 0 ; aCorr < nAlphaCorr ; aCorr ++ )
234234 {
235+ tmp < volScalarField > talpha1CN (alpha1 );
236+
237+ if (ocCoeff > 0 )
238+ {
239+ // Preserve the BCs of alpha1 in alpha1CN for interpolation
240+ talpha1CN = alpha1 .clone ();
241+ talpha1CN .ref () ==
242+ (cnCoeff * alpha1 + (1.0 - cnCoeff )* alpha1 .oldTime ())();
243+ }
244+
235245 // Split operator
236246 tmp < surfaceScalarField > talphaPhi1Un
237247 (
238248 alphaPhi
239249 (
240250 phiCN (),
241- ( cnCoeff * alpha1 + ( 1.0 - cnCoeff ) * alpha1 . oldTime ()) (),
251+ talpha1CN (),
242252 alphaControls
243253 )
244254 );
You can’t perform that action at this time.
0 commit comments