CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   A question on implementing the actuationDisk to the pisoFoam solver (https://www.cfd-online.com/Forums/openfoam-programming-development/115013-question-implementing-actuationdisk-pisofoam-solver.html)

frankyux March 21, 2013 13:58

A question on implementing the actuationDisk to the pisoFoam solver
 
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.1, 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 disksactuationDisks.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


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