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:
sergio
2018-10-17 10:10:06 -07:00
parent d2b32fcc84
commit 5daa38d5b4
68 changed files with 2967 additions and 287 deletions

View File

@ -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);

View File

@ -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];
}
}