mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH:
Update of overRhoPimpleDyMFoam and overInterDyMFoam solvers. Adding corresponding tutorials with best possible settings The main effort was put on reducing pressure spikes as the stencil change with hole cells on the background mesh.
This commit is contained in:
@ -977,6 +977,40 @@ bool Foam::cellCellStencils::cellVolumeWeight::update()
|
||||
walkFront(layerRelax, allCellTypes, allWeight);
|
||||
|
||||
|
||||
// Check previous iteration cellTypes_ for any hole->calculated changes
|
||||
{
|
||||
label nCalculated = 0;
|
||||
|
||||
forAll(cellTypes_, celli)
|
||||
{
|
||||
if (allCellTypes[celli] == CALCULATED && cellTypes_[celli] == HOLE)
|
||||
{
|
||||
if (allStencil[celli].size() == 0)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Cell:" << celli
|
||||
<< " at:" << mesh_.cellCentres()[celli]
|
||||
<< " zone:" << zoneID[celli]
|
||||
<< " changed from hole to calculated"
|
||||
<< " but there is no donor"
|
||||
<< exit(FatalError);
|
||||
}
|
||||
else
|
||||
{
|
||||
allCellTypes[celli] = INTERPOLATED;
|
||||
nCalculated++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Pout<< "Detected " << nCalculated << " cells changing from hole"
|
||||
<< " to calculated. Changed these to interpolated"
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
|
||||
// Normalise weights, Clear storage
|
||||
forAll(allCellTypes, cellI)
|
||||
{
|
||||
@ -1060,39 +1094,39 @@ bool Foam::cellCellStencils::cellVolumeWeight::update()
|
||||
}
|
||||
|
||||
|
||||
// Check previous iteration cellTypes_ for any hole->calculated changes
|
||||
{
|
||||
label nCalculated = 0;
|
||||
|
||||
forAll(cellTypes_, celli)
|
||||
{
|
||||
if (allCellTypes[celli] == CALCULATED && cellTypes_[celli] == HOLE)
|
||||
{
|
||||
if (allStencil[celli].size() == 0)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Cell:" << celli
|
||||
<< " at:" << mesh_.cellCentres()[celli]
|
||||
<< " zone:" << zoneID[celli]
|
||||
<< " changed from hole to calculated"
|
||||
<< " but there is no donor"
|
||||
<< exit(FatalError);
|
||||
}
|
||||
else
|
||||
{
|
||||
allCellTypes[celli] = INTERPOLATED;
|
||||
nCalculated++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Pout<< "Detected " << nCalculated << " cells changing from hole"
|
||||
<< " to calculated. Changed these to interpolated"
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
// // Check previous iteration cellTypes_ for any hole->calculated changes
|
||||
// {
|
||||
// label nCalculated = 0;
|
||||
//
|
||||
// forAll(cellTypes_, celli)
|
||||
// {
|
||||
// if (allCellTypes[celli] == CALCULATED && cellTypes_[celli] == HOLE)
|
||||
// {
|
||||
// if (allStencil[celli].size() == 0)
|
||||
// {
|
||||
// FatalErrorInFunction
|
||||
// << "Cell:" << celli
|
||||
// << " at:" << mesh_.cellCentres()[celli]
|
||||
// << " zone:" << zoneID[celli]
|
||||
// << " changed from hole to calculated"
|
||||
// << " but there is no donor"
|
||||
// << exit(FatalError);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// allCellTypes[celli] = INTERPOLATED;
|
||||
// nCalculated++;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if (debug)
|
||||
// {
|
||||
// Pout<< "Detected " << nCalculated << " cells changing from hole"
|
||||
// << " to calculated. Changed these to interpolated"
|
||||
// << endl;
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
cellTypes_.transfer(allCellTypes);
|
||||
|
||||
@ -335,10 +335,9 @@ void Foam::dynamicOversetFvMesh::addInterpolation(fvMatrix<Type>& m) const
|
||||
lower[facei] = 0.0;
|
||||
}
|
||||
|
||||
// For safety we make zero the HOLES
|
||||
const scalar normalisation = V()[celli];
|
||||
diag[celli] = normalisation;
|
||||
source[celli] = pTraits<Type>::zero;//normalisation*m.psi()[celli];
|
||||
source[celli] = normalisation*m.psi()[celli];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user