CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

A question on implementing the actuationDisk to the pisoFoam solver

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

Reply
 
LinkBack Thread Tools Display Modes
Old   February 11, 2013, 14:52
Default A question on implementing the actuationDisk to the pisoFoam solver
  #1
New Member
 
Frank Yu
Join Date: Jun 2011
Location: Toronto, ON
Posts: 15
Rep Power: 6
frankyux is on a distinguished road
Hi folks,
I have a question on implementing the actuationDisk to the pisoFoam solver. Since I didn’t use OpenFoam too much and don’t familiar with C++, my questions may sounds stupid.
I’m currently using OpenFoam 2.0.., I can find the implementation of actuationDisk under simpleFoam, namely windSimpleFoam, and this is my starting point.

My first attempt was, in the pisoFoam.C, first include #include "IObasicSourceList.H". Then add the actuationDisk to the right-hand-side of the UEqn.
Code:
 
#include "fvCFD.H"
#include "singlePhaseTransportModel.H"
#include "turbulenceModel.H"
#include "IObasicSourceList.H"

int main(int argc, char *argv[])
{
    #include "setRootCase.H"
    #include "createTime.H"
    #include "createMesh.H"
    #include "createFields.H"
    #include "initContinuityErrs.H"

    IObasicSourceList actuationDisks(mesh);

    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

    Info<< "\nStarting time loop\n" << endl;
    while (runTime.loop())
    {
        Info<< "Time = " << runTime.timeName() << nl << endl;

        #include "readPISOControls.H"
        #include "CourantNo.H"

        // Pressure-velocity PISO corrector
        {
            // Momentum predictor
            fvVectorMatrix UEqn
            (
                fvm::ddt(U)
              + fvm::div(phi, U)
              + turbulence->divDevReff(U)
            );
            // Add resistance on the actuation disks
            actuationDisks.addSu(UEqn());
            UEqn.relax();

            if (momentumPredictor)
            {
                solve(UEqn == -fvc::grad(p));
            }
            // --- PISO loop
                   ….
                   ….
        }
        turbulence->correct();
        runTime.write();
        Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
            << "  ClockTime = " << runTime.elapsedClockTime() << " s"
            << nl << endl;
    }
    //Info<< "End\n" << endl;


After the above modification, I got the following error message:

pisoFoam.C: In function ‘int main(int, char**)’:

pisoFoam.C:77: error: no match for call to ‘(Foam::fvVectorMatrix) ()’

where my Line77 refers to actuationDisks.addSu(UEqn());Does this mean that there is something wrong with the format of my UEqn?

I also tried to write my UEqn separately as UEqn.H, and replace the one in psioFoam,
Code:
 
  tmp<fvVectorMatrix> UEqn
    (
        fvm::div(phi, U)
      + turbulence->divDevReff(U)
    );
    // Add resistance on the actuation disks
actuationDisks.addSu(UEqn());
However, I got the following error message:

In file included from pisoFoam.C:81:
UEqn.H: In function ‘int main(int, char**)’:
UEqn.H:13: error: ‘class Foam::tmp<Foam::fvMatrix<Foam::Vector<double> > >’ has no member named ‘relax’
pisoFoam.C:97: error: ‘class Foam::tmp<Foam::fvMatrix<Foam::Vector<double> > >’ has no member named ‘A’
pisoFoam.C:99: error: ‘class Foam::tmp<Foam::fvMatrix<Foam::Vector<double> > >’ has no member named ‘H’


This one I think is because in piso loop it needs UEqn.A() and UEqn.H().
For now I just want to create a very simple example that I can involve actuationDisk in piso algorithm, anyone had this experience or any thoughts?

Thanks in advance.

Regards
Frank
frankyux is offline   Reply With Quote

Old   February 11, 2013, 14:54
Default
  #2
New Member
 
Frank Yu
Join Date: Jun 2011
Location: Toronto, ON
Posts: 15
Rep Power: 6
frankyux is on a distinguished road
I’m currently using OpenFoam 2.0.1. A typo.
frankyux is offline   Reply With Quote

Old   February 12, 2013, 01:51
Default
  #3
Member
 
Join Date: Nov 2010
Location: Tokyo / Japan
Posts: 40
Rep Power: 6
Hanzo is on a distinguished road
Quote:
Originally Posted by frankyux View Post

pisoFoam.C:77: error: no match for call to ‘(Foam::fvVectorMatrix) ()’

where my Line77 refers to actuationDisks.addSu(UEqn());Does this mean that there is something wrong with the format of my UEqn?
I am also not that skilled in c++ but I wonder what you want to access using
Code:
UEqn()
.

UEqn is a fvVectorMatrix, which itsel is defined as
in http://foam.sourceforge.net/docs/cpp/a04523_source.html

And here you can find a list of all public member functions of this type
http://foam.sourceforge.net/docs/cpp/a04525_source.html (starting line 115)

So you can access properties writing UEqn.source(), UEqn.internalCoeffs(), UEqn.psi() and so on. If your function addSu() expects a variable of type
fvVectorMatrix just try something like addSu(UEqn) or addSu(&UEqn).

Hope that helps.
Best,
Hanzo
Hanzo is offline   Reply With Quote

Old   February 12, 2013, 11:26
Default
  #4
New Member
 
Frank Yu
Join Date: Jun 2011
Location: Toronto, ON
Posts: 15
Rep Power: 6
frankyux is on a distinguished road
Thanks for your reply. Just wondering why it works fine with windSimpleFoam but doesn't work here.
frankyux is offline   Reply With Quote

Old   April 28, 2013, 10:11
Default
  #5
Senior Member
 
su_junwei's Avatar
 
su junwei
Join Date: Mar 2009
Location: Xi'an China
Posts: 151
Rep Power: 10
su_junwei is on a distinguished road
Send a message via MSN to su_junwei
Quote:
Originally Posted by frankyux View Post
Thanks for your reply. Just wondering why it works fine with windSimpleFoam but doesn't work here.
They different, in your implementation, UEqn is an fvMatrix type, however in the second implemenation, UEqn is an tmp type, you have to convert it to fvMatrix type to use actuationDisks.addSu, and thus, use UEqn()(to get its object of tmp)
su_junwei 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
different results between serial solver and parallel solver wlt_1985 FLUENT 10 April 11, 2012 15:25
Problem implementing CVODE ODE solver markusrehm OpenFOAM 20 October 13, 2010 17:02
Question abt. the Riemann analytic solver jinwon Main CFD Forum 0 July 16, 2007 14:11
question about implementing boundary conditions saygin Main CFD Forum 0 July 6, 2006 07:08
Poisson Solver question Suresh Main CFD Forum 3 August 12, 2005 04:37


All times are GMT -4. The time now is 08:58.