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

MotionSolver functions openFoam 2.3

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By bullmut

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 4, 2017, 09:19
Default MotionSolver functions openFoam 2.3
  #1
Member
 
Gareth
Join Date: Jun 2010
Posts: 56
Rep Power: 15
bullmut is on a distinguished road
Good Day

I am trying to follow the code for a surfaceDiscplament motion.
To that end i am following the print out call for a single time step from the solver moveDynamicMesh. I am finally at the point where i tracing the steps of the function call
Code:
mesh.update();
line 136 in moveDynamicMesh.C
Please bear with me...
This calls the dynamicMotionSolverFvMesh base class which inherits from the dynamicFvMesh class. The function update in this class actually calls the fvMesh class function movePoints
Code:
bool Foam::dynamicMotionSolverFvMesh::update()
{
    fvMesh::movePoints(motionPtr_->newPoints());

    if (foundObject<volVectorField>("U"))
    {
        volVectorField& U =
            const_cast<volVectorField&>(lookupObject<volVectorField>("U"));
        U.correctBoundaryConditions();
    }

    return true;
}
But before the fvMesh function can be implemented we need to motionSolver pointer to execute the function newPoints.The motionSolver class is a virtual base class that is used to build specific forms of motion. In this case i am looking at displacementMotionsolver. So now i am looking at the base class motionSolver and the virtual function newPoints exists:
Code:
Foam::tmp<Foam::pointField> Foam::motionSolver::newPoints()
{
    solve();
    return curPoints();
}
Now it is not directly replaced by a displacementMotionsolver function however there is a solve() function in the class that inherits from displacementMotionsolver, namely displacementLaplacianFvMotionsolver. Which is ultimately the motion solver i am implementing.
My question is do i assume the final motion solver (displacementLaplacianFvMotionsolver) is being called to execute solve() in which case the code reads:
Code:
void Foam::displacementLaplacianFvMotionSolver::solve()
{
    // The points have moved so before interpolation update
    // the motionSolver accordingly
    movePoints(fvMesh_.points());

    diffusivity().correct();
    pointDisplacement_.boundaryField().updateCoeffs();

    Foam::solve
    (
        fvm::laplacian
        (
            diffusivity().operator()(),
            cellDisplacement_,
            "laplacian(diffusivity,cellDisplacement)"
        )
    );
}
which makes little sense to me or do i assume it is the solve function as defined by the base virtual class motionSolver as below:
Code:
//- Solve for motion
        virtual void solve() = 0;
In which case the code skips the 3rd code block i posted would just jump straight to the function curPoints.
Any help is greatly appreciated and thank you for even reading this lengthy post
UPCzhangshuo likes this.
bullmut is offline   Reply With Quote

Reply


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
cantera integration with openfoam 2.3 khalifa OpenFOAM Running, Solving & CFD 2 May 8, 2018 11:21
OpenFOAM Training Jan-Jul 2017, Virtual, London, Houston, Berlin CFDFoundation OpenFOAM Announcements from Other Sources 0 January 4, 2017 06:15
[OpenFOAM.org] A Mac OS X of23x Development Environment Using Docker rt08 OpenFOAM Installation 1 February 28, 2016 19:00
OpenFOAM v3.0.1 Training, London, Houston, Berlin, Jan-Mar 2016 cfd.direct OpenFOAM Announcements from Other Sources 0 January 5, 2016 03:18
Working with distribution functions in OpenFOAM Aleksey_R OpenFOAM 0 November 5, 2013 10:08


All times are GMT -4. The time now is 11:12.