|
[Sponsors] |
A question on implementing the actuationDisk to the pisoFoam solver |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
February 11, 2013, 14:52 |
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: 15 |
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()); 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 |
|
February 11, 2013, 14:54 |
|
#2 |
New Member
Frank Yu
Join Date: Jun 2011
Location: Toronto, ON
Posts: 15
Rep Power: 15 |
I’m currently using OpenFoam 2.0.1. A typo.
|
|
February 12, 2013, 01:51 |
|
#3 | |
Member
Join Date: Nov 2010
Location: Tokyo / Japan
Posts: 40
Rep Power: 16 |
Quote:
Code:
UEqn() UEqn is a fvVectorMatrix, which itsel is defined as Code:
00045 typedef fvMatrix<vector> fvVectorMatrix; 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 |
||
February 12, 2013, 11:26 |
|
#4 |
New Member
Frank Yu
Join Date: Jun 2011
Location: Toronto, ON
Posts: 15
Rep Power: 15 |
Thanks for your reply. Just wondering why it works fine with windSimpleFoam but doesn't work here.
|
|
April 28, 2013, 11:11 |
|
#5 |
Senior Member
|
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)
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
different results between serial solver and parallel solver | wlt_1985 | FLUENT | 11 | October 12, 2018 09:23 |
Problem implementing CVODE ODE solver | markusrehm | OpenFOAM | 20 | October 13, 2010 18:02 |
Question abt. the Riemann analytic solver | jinwon | Main CFD Forum | 0 | July 16, 2007 15:11 |
question about implementing boundary conditions | saygin | Main CFD Forum | 0 | July 6, 2006 08:08 |
Poisson Solver question | Suresh | Main CFD Forum | 3 | August 12, 2005 05:37 |