mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
potentialFoam: simplify the Phi BCs to use only fixedValue and zeroGradient by default
Resolves bug-report http://bugs.openfoam.org/view.php?id=2129
This commit is contained in:
@ -40,7 +40,7 @@ word pName("p");
|
|||||||
// Update name of the pressure field from the command-line option
|
// Update name of the pressure field from the command-line option
|
||||||
args.optionReadIfPresent("pName", pName);
|
args.optionReadIfPresent("pName", pName);
|
||||||
|
|
||||||
// Infer the pressure BCs from the velocity BCs
|
// Infer the pressure BCs from the velocity
|
||||||
wordList pBCTypes
|
wordList pBCTypes
|
||||||
(
|
(
|
||||||
U.boundaryField().size(),
|
U.boundaryField().size(),
|
||||||
@ -71,6 +71,21 @@ volScalarField p
|
|||||||
pBCTypes
|
pBCTypes
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Infer the velocity potential BCs from the pressure
|
||||||
|
wordList PhiBCTypes
|
||||||
|
(
|
||||||
|
p.boundaryField().size(),
|
||||||
|
zeroGradientFvPatchScalarField::typeName
|
||||||
|
);
|
||||||
|
|
||||||
|
forAll(p.boundaryField(), patchi)
|
||||||
|
{
|
||||||
|
if (p.boundaryField()[patchi].fixesValue())
|
||||||
|
{
|
||||||
|
PhiBCTypes[patchi] = fixedValueFvPatchScalarField::typeName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Info<< "Constructing velocity potential field Phi\n" << endl;
|
Info<< "Constructing velocity potential field Phi\n" << endl;
|
||||||
volScalarField Phi
|
volScalarField Phi
|
||||||
(
|
(
|
||||||
@ -84,7 +99,7 @@ volScalarField Phi
|
|||||||
),
|
),
|
||||||
mesh,
|
mesh,
|
||||||
dimensionedScalar("Phi", dimLength*dimVelocity, 0),
|
dimensionedScalar("Phi", dimLength*dimVelocity, 0),
|
||||||
p.boundaryField().types()
|
PhiBCTypes
|
||||||
);
|
);
|
||||||
|
|
||||||
label PhiRefCell = 0;
|
label PhiRefCell = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user