fvMesh: Register V, Sf, magSf, C and Cf fields

required modification of fvMeshDistributors to ensure these sliced fields are
deleted before distribution.
This commit is contained in:
Henry Weller
2023-06-19 19:53:47 +01:00
parent 58f7c8c9e6
commit 01ea17f452
6 changed files with 24 additions and 11 deletions

View File

@ -807,6 +807,7 @@ void Foam::fvMeshSubset::setCellSubset
// Delete any old mesh // Delete any old mesh
fvMeshSubsetPtr_.clear(); fvMeshSubsetPtr_.clear();
// Make a new mesh // Make a new mesh
fvMeshSubsetPtr_.reset fvMeshSubsetPtr_.reset
( (

View File

@ -168,7 +168,7 @@ private:
// will take care of the old-time levels. // will take care of the old-time levels.
mutable label curTimeIndex_; mutable label curTimeIndex_;
//- Cell volumes old time level //- Cell volumes
mutable SlicedDimensionedField<scalar, volMesh>* VPtr_; mutable SlicedDimensionedField<scalar, volMesh>* VPtr_;
//- Cell volumes old time level //- Cell volumes old time level
@ -316,6 +316,7 @@ public:
typedef fvBoundaryMesh BoundaryMesh; typedef fvBoundaryMesh BoundaryMesh;
friend fvMeshTopoChangers::list; friend fvMeshTopoChangers::list;
friend fvMeshDistributor;
// Declare name of the class and its debug switch // Declare name of the class and its debug switch
ClassName("fvMesh"); ClassName("fvMesh");

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -91,4 +91,12 @@ void Foam::fvMeshDistributor::velocityMotionCorrection::update() const
} }
} }
bool Foam::fvMeshDistributor::update()
{
mesh_.clearGeomNotOldVol();
return true;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -154,7 +154,7 @@ public:
return true; return true;
} }
//- Update the mesh for both mesh motion and topology change //- Update the mesh
virtual bool update() = 0; virtual bool update() = 0;
//- Update corresponding to the given map //- Update corresponding to the given map

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -60,7 +60,7 @@ void Foam::fvMesh::makeSf() const
*this, *this,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false true
), ),
*this, *this,
dimArea, dimArea,
@ -95,7 +95,7 @@ void Foam::fvMesh::makeMagSf() const
*this, *this,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false true
), ),
*this, *this,
dimArea, dimArea,
@ -132,7 +132,7 @@ void Foam::fvMesh::makeC() const
*this, *this,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false true
), ),
*this, *this,
dimLength, dimLength,
@ -170,7 +170,7 @@ void Foam::fvMesh::makeCf() const
*this, *this,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false true
), ),
*this, *this,
dimLength, dimLength,
@ -276,7 +276,7 @@ const Foam::volScalarField::Internal& Foam::fvMesh::V() const
*this, *this,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false true
), ),
*this, *this,
dimVolume, dimVolume,

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -70,6 +70,9 @@ void Foam::fvMeshDistributors::distributor::distribute
// Mesh distribution engine // Mesh distribution engine
fvMeshDistribute distributor(mesh); fvMeshDistribute distributor(mesh);
// Clear sliced and other non-distributable mesh data
fvMeshDistributor::update();
// Do actual sending/receiving of mesh // Do actual sending/receiving of mesh
autoPtr<polyDistributionMap> map autoPtr<polyDistributionMap> map
( (