CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Messing alphaEqn solver with meshPrimitivePtr->movePoints(newPointsRef, oldPointsRef)

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 21, 2016, 16:36
Default Messing alphaEqn solver with meshPrimitivePtr->movePoints(newPointsRef, oldPointsRef)
  #1
jmf
Member
 
Jean-Michel FONTAINE
Join Date: Aug 2009
Location: Orleans - France
Posts: 55
Rep Power: 17
jmf is on a distinguished road
Hi

I spent two days in vain to solve coding problem.

My project is to modify interDyMFoam by adding a tightly coupled motion solver loop.
For the mesh deformation, I try to use the method movePoints() from the class primitiveMesh

Here is an extract of the code:

Code:
// Calculates the candidatePoints from the initialPoints
pointField initialPoints(mesh.points());
tmp<pointField> candidatePointsTmp(new pointField(mesh.points()));
pointField& candidatePointsRef = candidatePointsTmp();

// Calculate the transformation septernion from the initial state
septernion s ( centreOfMass - centreOfMass0,
    quaternion(orientationTensor & orientationTensor0.T())
);

forAll(candidatePointsRef, iPoint) {
    // Move non-stationary points
    if (scale_[iPoint] > SMALL) {
        // Use solid-body motion where scale_ = 1
        if (scale_[iPoint] > 1 - SMALL) {
            candidatePointsRef[iPoint] = centreOfMass
                + (orientationTensor & orientationTensor0.T() & (initialPoints[iPoint] - centreOfMass0));
        }
        // Slerp septernion interpolation
        else {
            septernion ss(slerp(septernion::I, s, scale_[iPoint]));
            candidatePointsRef[iPoint] = centreOfMass0
              + ss.transform (initialPoints[iPoint] - centreOfMass0);
        }
    }
}

// Calculates the swept volume with the base class primitiveMesh
pointField& initialPointsRef = initialPoints;
primitiveMesh* meshPrimitivePtr = &mesh;

// Following instruction causes the bug
tmp<scalarField> sweptVolsTmp
(
    meshPrimitivePtr->movePoints
    (
         candidatePointsRef, 
         initialPointsRef
    )
);
This compiles, creates the new points and calculates the swept volume as expected.
But after that, the solver fails when solving "alpha1" :

Code:
smoothSolver:  Solving for alpha.water, Initial residual = nan, Final residual = nan, No Iterations 1000
Phase-1 volume fraction = -nan  Min(alpha1) = -nan  Max(alpha1) = -nan
MULES: Correcting alpha.water
Phase-1 volume fraction = -nan  Min(alpha1) = -nan  Max(alpha1) = -nan
When I comment out the line marked as bug, everything is normal.
I can't figure out the problem : pointers ? tmp<field> ?
Could anybody help out ?

Greetings

Jean-Michel
jmf is offline   Reply With Quote

Reply

Tags
interdymfoam, primitivemesh, tmp<volscalarfield>


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
fluent divergence for no reason sufjanst FLUENT 2 March 23, 2016 17:08
3d vof Smaras FLUENT 2 February 19, 2013 07:58
CFX 5.5 Roued CFX 1 October 2, 2001 17:49
Setting a B.C using UserFortran in 4.3 tokai CFX 10 July 17, 2001 17:25
Error during Solver cfd guy CFX 4 May 8, 2001 07:04


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