Skip to content

Commit 5acca7a

Browse files
committed
Fix errors in createLocalBlend.
1 parent 141f89a commit 5acca7a

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

applications/solvers/dfLowMachFoam/createLocalBlend.H

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ forAll(keys, i)
3131
}
3232
}
3333

34+
// Declare pointer for UBlendingFactor
35+
autoPtr<surfaceScalarField> UBlendingFactorPtr;
36+
3437
// Create the localBlendingFactor field only if localBlended scheme is found
3538
if (foundLocalBlended)
3639
{
@@ -48,20 +51,23 @@ if (foundLocalBlended)
4851
IOobject::NO_WRITE
4952
),
5053
mesh
51-
)
54+
);
5255

5356
// Construct the surfaceScalarField UBlendingFactor by interpolating UBlend to cell faces
54-
surfaceScalarField UBlendingFactor
57+
UBlendingFactorPtr.reset
5558
(
56-
IOobject
59+
new surfaceScalarField
5760
(
58-
"UBlendingFactor",
59-
mesh.time().timeName(),
60-
mesh,
61-
IOobject::NO_READ,
62-
IOobject::NO_WRITE
63-
),
64-
mesh,
65-
fvc::interpolate(UBlend)
61+
IOobject
62+
(
63+
"UBlendingFactor",
64+
mesh.time().timeName(),
65+
mesh,
66+
IOobject::READ_IF_PRESENT,
67+
IOobject::NO_WRITE,
68+
true
69+
),
70+
fvc::interpolate(UBlend)
71+
)
6672
);
6773
}

0 commit comments

Comments
 (0)