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

.oldTime() question

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By kathrin_kissling
  • 1 Post By chaolian

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 6, 2012, 20:02
Question .oldTime() question
  #1
New Member
 
Chad
Join Date: Sep 2011
Posts: 16
Rep Power: 14
chaolian is on a distinguished road
Info<< "Reading field alphaL\n" << endl;
volScalarField alphaL
(
IOobject
(
"alphaL",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
alphaL.oldTime();
mesh,
dimensionedScalar("alphaL", dimless, scalar(0.0))
);
--------------------------
When compiled, error:
createFields.H:42: error: expected `)' before ';' token
createFields.H:44: warning: left-hand operand of comma has no effect
createFields.H:45: error: expected `;' before ')' token
--------------------------
I cannot figure out where the problem is. Thanks.
chaolian is offline   Reply With Quote

Old   November 7, 2012, 02:36
Default
  #2
Senior Member
 
Kathrin Kissling
Join Date: Mar 2009
Location: Besigheim, Germany
Posts: 134
Rep Power: 17
kathrin_kissling is on a distinguished road
Hey,

first thing is a general one:

you should not use a ; (semicolon) inside a constructor. These are comma-seperated lists.

second: Check GeometricField class for constructors, I think there is none like the one you stated. What are you trying to do?

Best

Kathrin
Action.Kamen likes this.
kathrin_kissling is offline   Reply With Quote

Old   November 7, 2012, 06:51
Default
  #3
New Member
 
Chad
Join Date: Sep 2011
Posts: 16
Rep Power: 14
chaolian is on a distinguished road
Hi, Kathrin
Thanks for pointing out this mistake.
----------------
volScalarField alphaTemp
(
IOobject
(
"alphaTemp",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("alphaTemp", dimless, 0)
);
alphaTemp.oldTime();
-------------------
Maybe this is the correct way to use. I am trying to store alphaTemp's old value for each time, since I want to use ddt(alphaTemp) later. I am not quite sure whether this is correct.
Kummi likes this.
chaolian is offline   Reply With Quote

Old   November 7, 2012, 06:53
Default
  #4
New Member
 
Chad
Join Date: Sep 2011
Posts: 16
Rep Power: 14
chaolian is on a distinguished road
Hi, Kathrin
Thanks for pointing out this mistake.
----------------
volScalarField alphaTemp
(
IOobject
(
"alphaTemp",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("alphaTemp", dimless, 0)
);
alphaTemp.oldTime();
-------------------
Maybe this is the correct way to use. I am trying to store alphaTemp's old value for each time, since I want to use ddt(alphaTemp) later. I am not quite sure whether this is correct.
chaolian is offline   Reply With Quote

Reply

Tags
oldtime()


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
Question Re Engineering Data Source imnull ANSYS 0 March 5, 2012 13:51
internal field question - PitzDaily Case atareen64 OpenFOAM Running, Solving & CFD 2 January 26, 2011 15:26
question on bounday layer modeling Wen Long Main CFD Forum 2 November 12, 2005 17:29
Poisson Solver question Suresh Main CFD Forum 3 August 12, 2005 04:37
Philosophical CFD question Richard Howe Main CFD Forum 14 June 17, 2001 14:41


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