CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Bugs

tetDecompositionMotionSolver

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   October 4, 2011, 17:00
Default tetDecompositionMotionSolver
  #1
Member
 
Hannes Kröger
Join Date: Mar 2009
Location: Rostock, Germany
Posts: 95
Rep Power: 9
hannes is on a distinguished road
Hello all,

I have noted some strange behaviour of the laplaceTetDecompositionMotionSolver (autoPtr motionSolver_ in the following snippets). I don't know if this is a bug. Maybe someone can comment on this:

I had expected the following code snippet to store the displacements of all mesh nodes (including boundary mesh points) in "deformedPoints":
Code:
tmp<pointField> deformedPoints = -1.0 * motionSolver_().curPoints();
deformedPoints() += motionSolver_().newPoints();
Unfortunately, only the displacement of the internal mesh points seemed to be right. The displacements of the mesh points on the mesh boundary were zero.

I had to code the following to get the wanted displacements:

Code:
  motionSolver_().solve();

  tmp<pointField> deformedPoints(new pointField(allPoints().size(), vector::zero));
  const tetPointVectorField& motionU=
      lookupObject<tetPointVectorField>("motionU");
  forAll(allPoints(), ipi)
      deformedPoints()[ipi]=motionU.internalField()[ipi] * time().deltaT().value();

  forAll(motionU.boundaryField(), patchI)
  {
    if (isA<fixedValueTetPolyPatchVectorField>(motionU.boundaryField()[patchI]))
    {
      const labelList& meshPoints=boundaryMesh()[patchI].meshPoints();
      const fixedValueTetPolyPatchVectorField& ppatch =
          dynamic_cast<const fixedValueTetPolyPatchVectorField&>
      (
          motionU.boundaryField()[patchI]
      );
      forAll(meshPoints, mpi)
      {
        deformedPoints()[meshPoints[mpi]]=
            ppatch[mpi] * time().deltaT().value();
      }
    }
  }
This is a quite ugly code. Does someone perhaps knows a more elegant way? I would really appreciate that.

Thanks in advance,

Hannes
hannes is offline   Reply With Quote

Old   October 7, 2011, 14:03
Default
  #2
Member
 
Hannes Kröger
Join Date: Mar 2009
Location: Rostock, Germany
Posts: 95
Rep Power: 9
hannes is on a distinguished road
Ok, I got it. It should be like this to work as expected:

Code:
tmp<pointField> deformedPoints = -1.0 * motionSolver_().curPoints();
setMotionUBCs();
deformedPoints() += motionSolver_().newPoints();
The BCs of the motionU field should be updated _after_ querying curPoints()
hannes is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 07:57.