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

Recalling an object of a library

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 28, 2018, 22:35
Default Recalling an object of a library
  #1
Senior Member
 
Elham
Join Date: Oct 2009
Posts: 184
Rep Power: 16
Elham is on a distinguished road
Hi,

I have created a library named phaseChangeTwoPhaseMixtureI and I calculate a parameter within this, called Spv. To recall it in createFields.H file I tried different options as following which all do not work:

1. phaseChangeTwoPhaseMixtureI Spv();

2. phaseChangeTwoPhaseMixtureI & Spv
{
return Spv_;
}

3.phaseChangeTwoPhaseMixturesI sourceI(U, phi);
volScalarField& Su = sourceTerm.Su();

4.volScalarField& Sp = phaseChangeTwoPhaseMixturesI Sp(typeName, U, phi);

I would appreciate if any one can help me to find the way.

Regards,

Elham
Elham is offline   Reply With Quote

Old   July 19, 2018, 00:46
Default
  #2
Senior Member
 
Elham
Join Date: Oct 2009
Posts: 184
Rep Power: 16
Elham is on a distinguished road
Quote:
Originally Posted by Elham View Post
Hi,

I have created a library named phaseChangeTwoPhaseMixtureI and I calculate a parameter within this, called Spv. To recall it in createFields.H file I tried different options as following which all do not work:

1. phaseChangeTwoPhaseMixtureI Spv();

2. phaseChangeTwoPhaseMixtureI & Spv
{
return Spv_;
}

3.phaseChangeTwoPhaseMixturesI sourceI(U, phi);
volScalarField& Su = sourceTerm.Su();

4.volScalarField& Sp = phaseChangeTwoPhaseMixturesI Sp(typeName, U, phi);

I would appreciate if any one can help me to find the way.

Regards,

Elham
Ok. I fixed it with the following expression in createFileds.H:

Code:
    autoPtr<phaseChangeTwoPhaseMixtureI> mixtureI =
        phaseChangeTwoPhaseMixtureI::New(U, phi, mixture);
and in the code that I needed to recall:

Code:
    tmp<volScalarField>  Sp =
        mixtureI->Sp();
    const volScalarField& Sp = Sp();
Elham 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
error in fireFoam, when running the case wallFireSpread2D zhoubiao1088 OpenFOAM Running, Solving & CFD 9 February 1, 2018 18:45
[foam-extend.org] Error compiling OpenFOAM-1.6-ext Canesin OpenFOAM Installation 137 January 20, 2016 14:56
Compilation error OF1.5-dev on Suse10.3 darenyang OpenFOAM Installation 0 April 29, 2009 04:55
[blockMesh] BlockMeshmergePatchPairs hjasak OpenFOAM Meshing & Mesh Conversion 11 August 15, 2008 07:36
OpenFOAM141dev linking error on IBM AIX 52 matthias OpenFOAM Installation 24 April 28, 2008 15:49


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