mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: support surfaceFieldValue faceZone on internal volume (#1884)
- uses averaged value instead of emitting a fatal error
This commit is contained in:
@ -495,6 +495,9 @@ Foam::functionObjects::fieldValues::surfaceFieldValue::filterField
|
|||||||
const GeometricField<Type, fvPatchField, volMesh>& field
|
const GeometricField<Type, fvPatchField, volMesh>& field
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
|
const labelList& own = field.mesh().faceOwner();
|
||||||
|
const labelList& nei = field.mesh().faceNeighbour();
|
||||||
|
|
||||||
auto tvalues = tmp<Field<Type>>::New(faceId_.size());
|
auto tvalues = tmp<Field<Type>>::New(faceId_.size());
|
||||||
auto& values = tvalues.ref();
|
auto& values = tvalues.ref();
|
||||||
|
|
||||||
@ -502,18 +505,16 @@ Foam::functionObjects::fieldValues::surfaceFieldValue::filterField
|
|||||||
{
|
{
|
||||||
const label facei = faceId_[i];
|
const label facei = faceId_[i];
|
||||||
const label patchi = facePatchId_[i];
|
const label patchi = facePatchId_[i];
|
||||||
|
|
||||||
if (patchi >= 0)
|
if (patchi >= 0)
|
||||||
{
|
{
|
||||||
|
// Boundary face - face id is the patch-local face id
|
||||||
values[i] = field.boundaryField()[patchi][facei];
|
values[i] = field.boundaryField()[patchi][facei];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
// Internal face
|
||||||
<< type() << " " << name() << ": "
|
values[i] = 0.5*(field[own[facei]] + field[nei[facei]]);
|
||||||
<< regionTypeNames_[regionType_] << "(" << regionName_ << "):"
|
|
||||||
<< nl
|
|
||||||
<< " Unable to process internal faces for volume field "
|
|
||||||
<< field.name() << nl << abort(FatalError);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -537,6 +538,7 @@ Foam::functionObjects::fieldValues::surfaceFieldValue::filterField
|
|||||||
{
|
{
|
||||||
const label facei = faceId_[i];
|
const label facei = faceId_[i];
|
||||||
const label patchi = facePatchId_[i];
|
const label patchi = facePatchId_[i];
|
||||||
|
|
||||||
if (patchi >= 0)
|
if (patchi >= 0)
|
||||||
{
|
{
|
||||||
values[i] = field.boundaryField()[patchi][facei];
|
values[i] = field.boundaryField()[patchi][facei];
|
||||||
|
|||||||
Reference in New Issue
Block a user