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

dynamic mesh with solution depended

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 27, 2014, 08:41
Default dynamic mesh with solution depended
  #1
New Member
 
Detian Liu
Join Date: Mar 2013
Location: Beijing, P.R.China
Posts: 20
Rep Power: 13
Detian Liu is on a distinguished road
Dear All,
Recently, I am trying to accomplish a case. In the case, I can get the variation (delta y) for every mesh in the bottom boundary for every time step, and I want to generate a new bottom boundary by adding the variation to the old bottom boundary. But I do not know how to read the variation when adapt "dynamicFvMesh". Am I right to adapt the class "dynamicInkJetFvMesh"? Is there anybody who can give me some advice about the dynamic mesh with solution depended?

I just want to read the result in the runtime dictionary, and the .C file is like this:
Code:
/*---------------------------------------------------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     |
    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
     \\/     M anipulation  |
-------------------------------------------------------------------------------
License
    This file is part of OpenFOAM.

    OpenFOAM is free software: you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    for more details.

    You should have received a copy of the GNU General Public License
    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.

\*---------------------------------------------------------------------------*/

#include "dynamicAddFvMesh.H"
#include "addToRunTimeSelectionTable.H"
#include "volFields.H"
#include "mathematicalConstants.H"

// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

namespace Foam
{
    defineTypeNameAndDebug(dynamicAddFvMesh, 0);
    addToRunTimeSelectionTable(dynamicFvMesh, dynamicAddFvMesh, IOobject);
}


// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //

Foam::dynamicAddFvMesh::dynamicAddFvMesh(const IOobject& io)
:
    dynamicFvMesh(io),   stationaryPoints_
    (
        IOobject
        (
            "points",
            io.time().constant(),
            meshSubDir,
            *this,
            IOobject::MUST_READ,
            IOobject::NO_WRITE
        )
    ),
    Eta_
    (
        IOobject
        (
            "Eta",
            io.time().timeName(),
            mesh,
            IOobject::MUST_READ,
            IOobject::NO_WRITE
        ),
    mesh
    )
{
    Info<< "Performing a dynamic mesh calculation: " << endl
        << "amplitude: " << amplitude_
        << " you are win! " << frequency_
        << " refPlaneX: " << refPlaneX_ << endl;
}

// * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //

Foam::dynamicAddFvMesh::~dynamicAddFvMesh()
{}


// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //

bool Foam::dynamicAddFvMesh::update()
{

    Info<< "Mesh scaling. Time = " << time().value() << endl;

    pointField newPoints = stationaryPoints_;

    newPoints.replace
    (
        vector::Y,
        stationaryPoints_.component(vector::Y)
    );

    fvMesh::movePoints(newPoints);

    volVectorField& U =
        const_cast<volVectorField&>(lookupObject<volVectorField>("U"));
    U.correctBoundaryConditions();

    return true;
}


// ************************************************************************* //
and it give the error like this:
Code:
Making dependency list for source file dynamicAddFvMesh.C
SOURCE=dynamicAddFvMesh.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra  -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3   -DNoRepository -ftemplate-depth-100  -I/opt/openfoam220/src/triSurface/lnInclude  -I/opt/openfoam220/src/meshTools/lnInclude  -I/opt/openfoam220/src/dynamicMesh/lnInclude  -I/opt/openfoam220/src/finiteVolume/lnInclude  -I/opt/openfoam220/src/dynamicFvMesh/lnInclude -IlnInclude -I.  -I/opt/openfoam220/src/OpenFOAM/lnInclude  -I/opt/openfoam220/src/OSspecific/POSIX/lnInclude   -fPIC -c $SOURCE -o  Make/linux64GccDPOpt/dynamicAddFvMesh.o
dynamicAddFvMesh.C: In constructor ‘Foam::dynamicAddFvMesh::dynamicAddFvMesh(const Foam::IOobject&)’:
dynamicAddFvMesh.C:83:13: error: ‘mesh’ was not declared in this scope
make: *** [Make/linux64GccDPOpt/dynamicAddFvMesh.o] Error 1
could someone give me some advice?

Thank you very much!
Best wishes!

Sincerely,
Detian
2012.2.26
Detian Liu 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
dynamic mesh for drop interface IndrajitW FLUENT 0 March 30, 2013 09:03
dynamic mesh refinement and rhoCentralFoam ChrisA OpenFOAM Running, Solving & CFD 1 March 21, 2013 09:00
Solution Diverging with Trimmer Mesh rietuk STAR-CCM+ 8 February 27, 2013 05:50
I find the solution of mesh dynamic cheredha Fluent UDF and Scheme Programming 0 June 8, 2010 21:24
Could anybody help me see this error and give help liugx212 OpenFOAM Running, Solving & CFD 3 January 4, 2006 19:07


All times are GMT -4. The time now is 06:40.