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
Branches
Tags
1 merge request!376WIP:dynamicMotionSolverListFvMesh uses same points0 as reference. Fixes #1702
......@@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -119,12 +119,14 @@ bool Foam::dynamicMotionSolverListFvMesh::update()
{
if (motionSolvers_.size())
{
const pointField& initPoints = lookupObjectRef<pointField>("points0");
// Accumulated displacement
pointField disp(motionSolvers_[0].newPoints() - fvMesh::points());
pointField disp(motionSolvers_[0].newPoints() - initPoints);
for (label i = 1; i < motionSolvers_.size(); i++)
{
disp += motionSolvers_[i].newPoints() - fvMesh::points();
disp += motionSolvers_[i].newPoints() - initPoints;
}
fvMesh::movePoints(points() + disp);
......
......@@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2012-2017 OpenFOAM Foundation
Copyright (C) 2015-2019 OpenCFD Ltd.
Copyright (C) 2015-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -56,8 +56,7 @@ Foam::IOobject Foam::points0MotionSolver::points0IO(const polyMesh& mesh)
polyMesh::meshSubDir,
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
IOobject::NO_WRITE
);
// If points0 are located in constant directory, verify their existence
......@@ -117,6 +116,7 @@ Foam::points0MotionSolver::points0MotionSolver
)
<< 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