CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

volScalarField Issue

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 21, 2013, 10:03
Default volScalarField Issue
  #1
otq
New Member
 
Christopher Hughes
Join Date: Oct 2012
Posts: 27
Rep Power: 13
otq is on a distinguished road
I am modifying the chtmultiregionfoam solver and need to reference the temperature field to setup my density. My createfluidfields.H file looks like this

forAll(fluidRegions, i)
{
Info<< "Reading field T\n" << endl;
TFluid.set
(
i,
new volScalarField
(
IOobject
(
"T",
runTime.timeName(),
fluidRegions[i],
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
fluidRegions[i]
)
);


Info<< " Adding to pFluid\n" << endl;
pFluid.set
(
i,
new volScalarField
(
IOobject
(
"p",
runTime.timeName(),
fluidRegions[i],
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
fluidRegions[i]
)
);

Info<< " Adding to rhoFluid\n" << endl;
if (TFluid[i].value()< 644)
{
double a[i]=-0.00022293*pow(TFluid[i],3)+1.9731e-09*pow(TFluid[i],2)*pFluid[i]+0.33433*pow(TFluid[i],2)-7.5161e-15*TFluid[i]*pow(pFluid[i],2)-1.9062e-06*TFluid[i]*pFluid[i]-169.5286*TFluid[i]+2.2902e-20*pow(pFluid[i],3)+2.6378e-12*pow(pFluid[i],2)+0.0004861378*pFluid[i]+29695.2331;
}
else if (TFluid[i] > 650)
{
double a[i]=-0.0057583*pow(TFluid[i],3)+1.6699e-09*pow(TFluid[i],2)*pFluid[i]+11.8606*pow(TFluid[i],2)+1.6565e-13*TFluid[i]*pow(pFluid[i],2)-1.1593e-05*TFluid[i]*pFluid[i]-8014.6607*TFluid[i]-2.3615e-20*pow(pFluid[i],3)-1.1073e-10*pow(pFluid[i],2)+.0070842*pFluid[i]+1776203.1923;
}
else
{
double a[i]=(-0.00022293*pow(TFluid[i],3)+1.9731e-09*pow(TFluid[i],2)*pFluid[i]+0.33433*pow(TFluid[i],2)-7.5161e-15*TFluid[i]*pow(pFluid[i],2)-1.9062e-06*T[i]*pFluid[i]-169.5286*TFluid[i]+2.2902e-20*pow(pFluid[i],3)+2.6378e-12*pow(pFluid[i],2)+0.0004861378*pFluid[i]+29695.2331)*(TFluid[i]-644)/6+(-0.0057583*pow(TFluid[i],3)+1.6699e-09*pow(TFluid[i],2)*pFluid[i]+11.8606*pow(TFluid[i],2)+1.6565e-13*TFluid[i]*pow(pFluid[i],2)-1.1593e-05*TFluid[i]*pFluid[i]-8014.6607*TFluid[i]-2.3615e-20*pow(pFluid[i],3)-1.1073e-10*pow(pFluid[i],2)+.0070842*pFluid[i]+1776203.1923)*(650-TFluid[i])/6;
}

rhoFluid.set
(
i,
new volScalarField
(
IOobject
(
"rho",
runTime.timeName(),
fluidRegions[i],
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
a[i]
)
);

When I wmake all I receive the following error
fluid/createFluidFields.H: In function ‘int main(int, char**)’:
fluid/createFluidFields.H:69:31: error: ‘struct Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>’ has no member named ‘value’

I am unclear as to how to properly call it so that for each cell within each region I take out the temperature value of that cell, then determine which of the three polynomials to use. Finally getting a density value for that cell based on that cell's temperature and pressure. Any help would be greatly appreciated.
otq 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
[openSmoke] libOpenSMOKE Tobi OpenFOAM Community Contributions 562 January 25, 2023 09:21
if-loop, volScalarField comparison volker OpenFOAM 7 March 6, 2020 20:03
Problem with pow and volScalarField _Stefan_ OpenFOAM Programming & Development 15 April 14, 2019 22:20
CyclicAMI Issue In OpenFOAM 2.2.0 prasant OpenFOAM Running, Solving & CFD 17 March 16, 2013 02:00
dimensionedScalar + volScalarField is evaluated elementwisely ? tianyikillua OpenFOAM Programming & Development 1 March 30, 2012 03:12


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