mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Small changes to energyRegionCoupled BC
This commit is contained in:
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -52,7 +52,6 @@ Foam::regionCoupledBaseGAMGInterface::regionCoupledBaseGAMGInterface
|
|||||||
refCast<const regionCoupledLduInterface>(fineInterface)
|
refCast<const regionCoupledLduInterface>(fineInterface)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
// Construct face agglomeration from cell agglomeration
|
// Construct face agglomeration from cell agglomeration
|
||||||
{
|
{
|
||||||
// From coarse face to cell
|
// From coarse face to cell
|
||||||
@ -94,6 +93,7 @@ Foam::regionCoupledBaseGAMGInterface::regionCoupledBaseGAMGInterface
|
|||||||
faceRestrictAddressing_.transfer(dynFaceRestrictAddressing);
|
faceRestrictAddressing_.transfer(dynFaceRestrictAddressing);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
// On the owner side construct the AMI
|
// On the owner side construct the AMI
|
||||||
if (fineRegionCoupledLduInterface_.owner())
|
if (fineRegionCoupledLduInterface_.owner())
|
||||||
{
|
{
|
||||||
@ -228,15 +228,14 @@ internalFieldTransfer
|
|||||||
const labelUList& iF
|
const labelUList& iF
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
|
// WarningIn
|
||||||
|
// (
|
||||||
|
// "regionCoupledBaseGAMGInterface::internalFieldTransfer"
|
||||||
|
// "( const Pstream::commsTypes, const labelUList&)"
|
||||||
|
// " the internal field can not be transfered "
|
||||||
|
// " as the neighbFvPatch are in different meshes "
|
||||||
|
// );
|
||||||
/*
|
/*
|
||||||
WarningIn
|
|
||||||
(
|
|
||||||
"regionCoupledBaseGAMGInterface::internalFieldTransfer"
|
|
||||||
"( const Pstream::commsTypes, const labelUList&)"
|
|
||||||
" the internal field can not be transfered "
|
|
||||||
" as the neighbFvPatch are in different meshes "
|
|
||||||
);
|
|
||||||
|
|
||||||
//const labelUList& nbrFaceCells = neighbPatch().faceCells();
|
//const labelUList& nbrFaceCells = neighbPatch().faceCells();
|
||||||
|
|
||||||
const labelUList& nbrFaceCells = nbrLduInterface().faceCells();
|
const labelUList& nbrFaceCells = nbrLduInterface().faceCells();
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -308,6 +308,7 @@ energyRegionCoupledFvPatchScalarField
|
|||||||
Foam::tmp<Foam::scalarField> Foam::energyRegionCoupledFvPatchScalarField::
|
Foam::tmp<Foam::scalarField> Foam::energyRegionCoupledFvPatchScalarField::
|
||||||
snGrad() const
|
snGrad() const
|
||||||
{
|
{
|
||||||
|
Debug("snGrad");
|
||||||
return
|
return
|
||||||
regionCoupledPatch_.patch().deltaCoeffs()
|
regionCoupledPatch_.patch().deltaCoeffs()
|
||||||
*(*this - patchInternalField());
|
*(*this - patchInternalField());
|
||||||
@ -317,6 +318,7 @@ snGrad() const
|
|||||||
Foam::tmp<Foam::scalarField> Foam::energyRegionCoupledFvPatchScalarField::
|
Foam::tmp<Foam::scalarField> Foam::energyRegionCoupledFvPatchScalarField::
|
||||||
snGrad(const scalarField&) const
|
snGrad(const scalarField&) const
|
||||||
{
|
{
|
||||||
|
Debug("snGrad");
|
||||||
return snGrad();
|
return snGrad();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -427,7 +429,6 @@ void Foam::energyRegionCoupledFvPatchScalarField::updateInterfaceMatrix
|
|||||||
|
|
||||||
if (&psiInternal == &internalField())
|
if (&psiInternal == &internalField())
|
||||||
{
|
{
|
||||||
|
|
||||||
label patchi = this->patch().index();
|
label patchi = this->patch().index();
|
||||||
const scalarField& pp = thermoPtr_->p().boundaryField()[patchi];
|
const scalarField& pp = thermoPtr_->p().boundaryField()[patchi];
|
||||||
const scalarField& Tp = thermoPtr_->T().boundaryField()[patchi];
|
const scalarField& Tp = thermoPtr_->T().boundaryField()[patchi];
|
||||||
@ -436,6 +437,8 @@ void Foam::energyRegionCoupledFvPatchScalarField::updateInterfaceMatrix
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
//NOTE: This is not correct for preconditioned solvers
|
||||||
|
// psiInternal is not the information needed of the slave
|
||||||
forAll(*this, facei)
|
forAll(*this, facei)
|
||||||
{
|
{
|
||||||
myHE[facei] = psiInternal[regionCoupledPatch_.faceCells()[facei]];
|
myHE[facei] = psiInternal[regionCoupledPatch_.faceCells()[facei]];
|
||||||
@ -460,33 +463,15 @@ void Foam::energyRegionCoupledFvPatchScalarField::updateInterfaceMatrix
|
|||||||
const Pstream::commsTypes
|
const Pstream::commsTypes
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
setMethod();
|
notImplemented
|
||||||
|
(
|
||||||
scalarField myHE(this->size());
|
"energyRegionCoupledFvPatchScalarField::updateInterfaceMatrix()"
|
||||||
|
"("
|
||||||
if (&psiInternal == &internalField())
|
"Field<scalar>& "
|
||||||
{
|
"const Field<scalar>&"
|
||||||
label patchi = this->patch().index();
|
"const scalarField& "
|
||||||
const scalarField& pp = thermoPtr_->p().boundaryField()[patchi];
|
"const Pstream::commsTypes"
|
||||||
const scalarField& Tp = thermoPtr_->T().boundaryField()[patchi];
|
);
|
||||||
|
|
||||||
myHE = thermoPtr_->he(pp, Tp, patchi);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
forAll(*this, facei)
|
|
||||||
{
|
|
||||||
myHE[facei] = psiInternal[regionCoupledPatch_.faceCells()[facei]];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Multiply the field by coefficients and add into the result
|
|
||||||
const labelUList& faceCells = regionCoupledPatch_.faceCells();
|
|
||||||
|
|
||||||
forAll(faceCells, elemI)
|
|
||||||
{
|
|
||||||
result[faceCells[elemI]] -= coeffs[elemI]*myHE[elemI];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user