Skip to content
Snippets Groups Projects
Commit 8a2857e7 authored by sergio's avatar sergio
Browse files

BUG: dynamicMotionSolverListFvMesh uses same points0 as reference. Fixes #1702

points0 based motion solvers now registers the initial points named
'points0' which can be looked by solvers which need a reference.
parent 0dc07fb0
No related branches found
No related tags found
1 merge request!376WIP:dynamicMotionSolverListFvMesh uses same points0 as reference. Fixes #1702
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2016 OpenFOAM Foundation Copyright (C) 2016 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
...@@ -119,12 +119,14 @@ bool Foam::dynamicMotionSolverListFvMesh::update() ...@@ -119,12 +119,14 @@ bool Foam::dynamicMotionSolverListFvMesh::update()
{ {
if (motionSolvers_.size()) if (motionSolvers_.size())
{ {
const pointField& initPoints = lookupObjectRef<pointField>("points0");
// Accumulated displacement // Accumulated displacement
pointField disp(motionSolvers_[0].newPoints() - fvMesh::points()); pointField disp(motionSolvers_[0].newPoints() - initPoints);
for (label i = 1; i < motionSolvers_.size(); i++) for (label i = 1; i < motionSolvers_.size(); i++)
{ {
disp += motionSolvers_[i].newPoints() - fvMesh::points(); disp += motionSolvers_[i].newPoints() - initPoints;
} }
fvMesh::movePoints(points() + disp); fvMesh::movePoints(points() + disp);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2012-2017 OpenFOAM Foundation Copyright (C) 2012-2017 OpenFOAM Foundation
Copyright (C) 2015-2019 OpenCFD Ltd. Copyright (C) 2015-2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
...@@ -56,8 +56,7 @@ Foam::IOobject Foam::points0MotionSolver::points0IO(const polyMesh& mesh) ...@@ -56,8 +56,7 @@ Foam::IOobject Foam::points0MotionSolver::points0IO(const polyMesh& mesh)
polyMesh::meshSubDir, polyMesh::meshSubDir,
mesh, mesh,
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE
false
); );
// If points0 are located in constant directory, verify their existence // If points0 are located in constant directory, verify their existence
...@@ -117,6 +116,7 @@ Foam::points0MotionSolver::points0MotionSolver ...@@ -117,6 +116,7 @@ Foam::points0MotionSolver::points0MotionSolver
) )
<< exit(FatalError); << exit(FatalError);
} }
points0_.rename("points0");
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment