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

Pasing VolScalarField pointer to solve(), is this possible?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 15, 2011, 13:07
Default Pasing VolScalarField pointer to solve(), is this possible?
  #1
Member
 
O R
Join Date: Mar 2009
Posts: 50
Rep Power: 17
arkangel is on a distinguished road
Dear FOAMERS ,

I don't think this was asked before. I am using another pakage to link against the OpenFOAM lib , I decided that the best way would be to use a pointer to the fields. so far all seems to be working well but I think (i hope I am wrong) I reach a deadlock


Code:
volScalarField *pT;
Time *pRT ;

//Function 1
void Init(){
    pT=new Foam::volScalarField
    (
        IOobject
        (
            "T",
            pRT->timeName(),
            *pMesh
          ...
        ),
        *pMesh
    );
// This woks so far perfectly  i e: pT->internalField, pMesh->C(), etc
}


// Function 2
void solveEQ(){
  while (pRT->loop())
    {
       solve(
                fvm::laplacian(1.0, *pT)  //DOES NOT WORK
            );
      pRT->write();
       }
}
I tried with the LaplacianFoam and I got this:

finiteVolume/lnInclude/fvmLaplacian.C:185: error: in passing argument 2 of ‘Foam::tmp<Foam::fvMatrix<Type> > Foam::fvm::laplacian(const Foam::dimensioned<Type2>&, Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&) [with Type = double, GType = double]

So the Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>& thinks that *pT is other type. In fact is volScalarField (or VolVectorField if i have to use vec filed)


Is there A way to force laplacian (or other operator) to accept my syntax

Thanks for you Help
arkangel 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
if-loop, volScalarField comparison volker OpenFOAM 7 March 6, 2020 20:03
Problems with creating a volScalarField georlade OpenFOAM Programming & Development 4 December 4, 2016 12:31
Linearized NS euqations: how to solve them?(problem with Matrix operations..) matteoL OpenFOAM Running, Solving & CFD 0 November 18, 2009 06:58
Solve for two or more "Temperatures" Rui CFX 12 September 9, 2008 21:58
How to solve another continuum and momentum eqn? west_wing FLUENT 0 August 25, 2003 10:00


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