mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
rhoCentralFoam: Reverted correction to BCs
Reverted changes proposed in http://openfoam.org/mantisbt/view.php?id=1548 as it adversely affects fixed-value BCs and is formulated to fix an issue with an unphysical case. Further analysis of the handling of fixed pressure outlet conditions as the Mach number approaches 1 is required.
This commit is contained in:
@ -42,8 +42,7 @@ volScalarField rho
|
|||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
IOobject::AUTO_WRITE
|
IOobject::AUTO_WRITE
|
||||||
),
|
),
|
||||||
thermo.rho(),
|
thermo.rho()
|
||||||
derivedPatchFieldTypes(p)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
volVectorField rhoU
|
volVectorField rhoU
|
||||||
@ -56,8 +55,7 @@ volVectorField rhoU
|
|||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
IOobject::NO_WRITE
|
IOobject::NO_WRITE
|
||||||
),
|
),
|
||||||
rho*U,
|
rho*U
|
||||||
derivedPatchFieldTypes(U)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
volScalarField rhoE
|
volScalarField rhoE
|
||||||
@ -70,8 +68,7 @@ volScalarField rhoE
|
|||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
IOobject::NO_WRITE
|
IOobject::NO_WRITE
|
||||||
),
|
),
|
||||||
rho*(e + 0.5*magSqr(U)),
|
rho*(e + 0.5*magSqr(U))
|
||||||
derivedPatchFieldTypes(T)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
surfaceScalarField pos
|
surfaceScalarField pos
|
||||||
@ -98,19 +95,7 @@ surfaceScalarField neg
|
|||||||
dimensionedScalar("neg", dimless, -1.0)
|
dimensionedScalar("neg", dimless, -1.0)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
surfaceScalarField phi("phi", mesh.Sf() & fvc::interpolate(rhoU));
|
||||||
surfaceScalarField phi
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"phi",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
mesh.Sf() & fvc::interpolate(rhoU)
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<< "Creating turbulence model\n" << endl;
|
Info<< "Creating turbulence model\n" << endl;
|
||||||
autoPtr<compressible::turbulenceModel> turbulence
|
autoPtr<compressible::turbulenceModel> turbulence
|
||||||
|
|||||||
@ -26,47 +26,7 @@ tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > interpolate
|
|||||||
|
|
||||||
sf.rename(vf.name() + '_' + dir.name());
|
sf.rename(vf.name() + '_' + dir.name());
|
||||||
|
|
||||||
// Correct BCs of the positive (outgoing) fluxes
|
|
||||||
forAll(sf.boundaryField(), patchi)
|
|
||||||
{
|
|
||||||
if
|
|
||||||
(
|
|
||||||
!sf.boundaryField()[patchi].coupled()
|
|
||||||
&& sf.boundaryField()[patchi].size()
|
|
||||||
&& !vf.boundaryField()[patchi].fixesValue()
|
|
||||||
&& dir.boundaryField()[patchi][0] > 0
|
|
||||||
)
|
|
||||||
{
|
|
||||||
sf.boundaryField()[patchi] =
|
|
||||||
vf.boundaryField()[patchi].patchInternalField();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return tsf;
|
return tsf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
wordList derivedPatchFieldTypes
|
|
||||||
(
|
|
||||||
const GeometricField<Type, fvPatchField, volMesh>& vf
|
|
||||||
)
|
|
||||||
{
|
|
||||||
wordList phiTypes
|
|
||||||
(
|
|
||||||
vf.boundaryField().size(),
|
|
||||||
calculatedFvPatchField<Type>::typeName
|
|
||||||
);
|
|
||||||
|
|
||||||
forAll(vf.boundaryField(), patchi)
|
|
||||||
{
|
|
||||||
if (vf.boundaryField()[patchi].fixesValue())
|
|
||||||
{
|
|
||||||
phiTypes[patchi] = fixedValueFvPatchField<Type>::typeName;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return phiTypes;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user