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

Problems with startTime latestTime

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   February 16, 2005, 09:13
Default Where does runTime.writeObjec
  #1
Marco Kupiainen (Kupiainen)
Guest
 
Posts: n/a
Where does runTime.writeObjects() look for what to write to file? I am currently trying to keep running a case from the latest time I computed, but discovered that the variables needed in initial data
B muSgs muTilda
are not saved. Where does one control what variables are saved in each timestep?

best regards
Marco
  Reply With Quote

Old   February 16, 2005, 09:21
Default When you create each IOobject
  #2
Hrvoje Jasak (Hjasak)
Guest
 
Posts: n/a
When you create each IOobject you need to specify the properties which include NO_WRITE or AUTO_WRITE.

For example:

Info<< "Reading field U\n" << endl;
volVectorField U
(
IOobject
(
"U",
runTime.timeName(),
runTime,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);


If you want things to be written with runTime.writeObjects(), find where they are created and specify IOobject::AUTO_WRITE.

Alternatively, set the auto-write on IOobject (see the appropriate header) using the writeOpt() member.

Enjoy,

Hrv
  Reply With Quote

Old   February 16, 2005, 09:51
Default It seems that the program doe
  #3
Marco Kupiainen (Kupiainen)
Guest
 
Posts: n/a
It seems that the program doesn't do what it is supposed to do:
in e.g. ..../src/LESmodels/compressible/GenEddyVisc.C

...
muSgs_
(
IOobject
(
"muSgs",
runTime_.timeName(),
runTime_,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh_
)
...
the AUTO_WRITE is on, but still no output. Similarily with the other variables I am looking for. You mentioned something with setting the auto-write on IOobject using the writeOpt() member. How does one do this in practice?
M.
  Reply With Quote

Old   February 16, 2005, 10:17
Default muSgs_.writeOpt() = IOobject:
  #4
Mattijs Janssens (Mattijs)
Guest
 
Posts: n/a
muSgs_.writeOpt() = IOobject::AUTO_WRITE;

(haven't checked)

Mattijs
  Reply With Quote

Old   February 16, 2005, 10:41
Default This is weird, I wrote and ra
  #5
Eugene de Villiers (Eugene)
Guest
 
Posts: n/a
This is weird, I wrote and ran that LES code and it worked fine originally; I have the results to prove it.

What model are you running? I know of none that will solve for muSgs, muTilda and B as you seem to imply. Only Spalart-Allmaras will dump mutilda and only ReynoldsStress will dump B. What code did you use to compute the latest time? I suspect it wasnt the same code with the same LES models that you are trying to restart.

Note, oodles and coodles use different variables.
  Reply With Quote

Old   February 16, 2005, 11:50
Default I'm using coodles with the 1-
  #6
Marco Kupiainen (Kupiainen)
Guest
 
Posts: n/a
I'm using coodles with the 1-eqn model. It needs B and muSgs and muTilda in order to start.
This is also the same code I'm trying to restart.
  Reply With Quote

Old   February 16, 2005, 11:59
Default Maybe stupid question: do you
  #7
Mattijs Janssens (Mattijs)
Guest
 
Posts: n/a
Maybe stupid question: do you have your writeInterval set? writeObjects() only dumps changed variables and only if the writeInterval time has come.

If you want to force it just add it to coodles.C just before the writeObjects call.

Mattijs
  Reply With Quote

Old   February 16, 2005, 12:07
Default This is how my controlDict lo
  #8
Marco Kupiainen (Kupiainen)
Guest
 
Posts: n/a
This is how my controlDict looks like:
applicationClass coodles;

startFrom latestTime;

startTime 0;

stopAt endTime;

endTime 1;

deltaT 1e-07;

writeControl timeStep;

writeInterval 100;

cycleWrite 0;

writeFormat ascii;

writePrecision 6;

writeCompression uncompressed;

timeFormat general;

timePrecision 6;

runTimeModifiable yes;


but

h04n05:~>ls 0/
B T U k muSgs muTilda p
h04n05:~>ls 5e-05/
T U U_0 k k_0 p p_0 phi phi_0 rho rho_0 time
The other variables are printed, but not the turbulence model variables...

Marco
  Reply With Quote

Old   February 16, 2005, 12:14
Default While trying to make the code
  #9
Marco Kupiainen (Kupiainen)
Guest
 
Posts: n/a
While trying to make the code force writing by adding

muSgs.writeOpt() = IOobject::AUTO_WRITE;
muTilda.writeOpt() = IOobject::AUTO_WRITE;
B.writeOpt() = IOobject::AUTO_WRITE;

runTime.writeObjects();
to the coodles.C. However muSgs, muTilda and B are undefined giving rise to compiling errors...
coodles.C(73): error: identifier "muSgs" is undefined
muSgs.writeOpt() = IOobject::AUTO_WRITE;
^

coodles.C(74): error: identifier "muTilda" is undefined
muTilda.writeOpt() = IOobject::AUTO_WRITE;
^

coodles.C(75): error: identifier "B" is undefined
B.writeOpt() = IOobject::AUTO_WRITE;
^
What to do?
  Reply With Quote

Old   February 16, 2005, 12:19
Default The one-equation SGS model on
  #10
Eugene de Villiers (Eugene)
Guest
 
Posts: n/a
The one-equation SGS model only needs muSgs and k to restart. Check GenEddyVisc.C which is the base class for oneEqEddy. FoamX just creates all the possible fields a SGS model could use, thats why they appear in your starting time directory.

Change
writeControl timeStep;
writeInterval 10;

In your controlDict to write out data after 10 timesteps.
  Reply With Quote

Old   February 16, 2005, 12:22
Default turbulence->muSgs()().writeOp
  #11
Mattijs Janssens (Mattijs)
Guest
 
Posts: n/a
turbulence->muSgs()().writeOpt() = IOobject::AUTO_WRITE;

So
- get the muSgs field from the turbulence model
- use an extra bracket pair to get access to the raw volScalarField
- apply writeOpt()
  Reply With Quote

Old   February 16, 2005, 12:40
Default Added turbulence->muSgs()
  #12
Marco Kupiainen (Kupiainen)
Guest
 
Posts: n/a
Added

turbulence->muSgs()().writeOpt() = IOobject::AUTO_WRITE;

and now the code compiles, but to no vein. Problem still persists :-(

h04n05:~>ls 0/
B T U k muSgs muTilda p
h04n05:~>ls 1e-07/
T U k p p_0 phi rho time
h04n05:~>ls 2e-07/
T U U_0 k k_0 p p_0 phi phi_0 rho rho_0 time


I have already looked in the ..../src/LESmodels/compressible/GenEddyVisc.C

and everything is correct there. I really don't have any clues any more. There is something wrong with the code anyway, so much is clear to me.
  Reply With Quote

Old   February 16, 2005, 12:46
Default Curiouser and curiouser. I
  #13
Eugene de Villiers (Eugene)
Guest
 
Posts: n/a
Curiouser and curiouser.

If what Mattijs suggets doesnt work (the object was created using AUTO_WRITE after all), you can write the file using a more brute-force approach:

Near the bottom of your top level code put:

if(runTime.outputTime())
{
turbulence->muSgs()().write();
}

The real question is: "why is it not working in the first place?" All the code seems to be in order.
  Reply With Quote

Old   February 16, 2005, 12:53
Default Hmm, all of this should have
  #14
Hrvoje Jasak (Hjasak)
Guest
 
Posts: n/a
Hmm, all of this should have worked first time anyway and it's not too surprising that AUTO_WRITE; did not do the trick. I don't fancy digging through it myself but this is what you do:

switch on database debugging in ~/.OpenFOAM-1.0/controlDict:

database 1;

in the DebugSwitches section. Database will now tell you everything. :-)

I have checked the oodles tutorial and all is well (that's worth doing on your installation as well.

My guess is that due to a cock-up there are two IOobjects with the same name nuSgs, which messes up the database.

A progress report would be nice :-)

Hrv
  Reply With Quote

Old   February 17, 2005, 20:19
Default B T U k muSgs muTilda p are t
  #15
Henry Weller (Henry)
Guest
 
Posts: n/a
B T U k muSgs muTilda p are the fields FoamX writes out but not all are used, it depends on the choice of model. e.g. muTilda is only used by SpalartAllmares and hence is not written by during the code run unless you choose the SpalartAllmares model. So everything should be fine for restarting, is that the case? What missing fields is the code looking for during restart?

There will however be a problem running FoamX on the timesteps dumped by the code because it will expect these extra fields. The simple way out of this problem is to copy the missing fields (which are not used by the code) to the from the 0 directory to the timestep of interest. We will look into this limitation of FoamX in the future.
  Reply With Quote

Old   February 18, 2005, 03:52
Default It is looking for muSgs.
  #16
Marco Kupiainen (Kupiainen)
Guest
 
Posts: n/a
It is looking for muSgs.
  Reply With Quote

Old   February 18, 2005, 04:23
Default > I'm using coodles with the
  #17
Henry Weller (Henry)
Guest
 
Posts: n/a
> I'm using coodles with the 1-eqn model. It needs B > and muSgs and muTilda in order to start.

Are you sure it needs all these three in order to start? muTilda is only used by the SpalartAllmares and you say you are running the 1-eq model.
  Reply With Quote

Old   February 18, 2005, 04:48
Default I have just run coodles on th
  #18
Henry Weller (Henry)
Guest
 
Posts: n/a
I have just run coodles on the tutorial case and I get k k_0 muSgs p p_0 phi phi_0 rho rho_0 T time U U_0 dumped in the time directories and the restart is fine. The problem you are seeing appears to be a platform-dependent database registration failure. We have never seen such a problem on Linux but something possibly similar happened on the Itanium machine using the Intel compiler. What platfor and compiler are you using?
  Reply With Quote

Old   February 18, 2005, 08:22
Default It is an Itanium 2 platform,
  #19
Marco Kupiainen (Kupiainen)
Guest
 
Posts: n/a
It is an Itanium 2 platform, using Intel compiler
icpc 8.1.026 with -gcc-version=330 flag.
  Reply With Quote

Old   February 18, 2005, 08:52
Default OK then it does appear to be
  #20
Henry Weller (Henry)
Guest
 
Posts: n/a
OK then it does appear to be the problem seen before which is associated with the Intel compiler optimiser for the Itanium 2. I might be able to find a work-around but it might be better if you use gcc-3.4.3 instead which we know produces an exectuable which runs correctly on the Itanium 2.
  Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
DieselFoam does not restart from latestTime lord_kossity OpenFOAM Bugs 8 February 21, 2009 14:54
Problems with Fluent on simple 1D problems agg FLUENT 3 November 21, 2008 12:55
cfx problems on net ripudaman CFX 0 October 20, 2008 03:06
MPI PROBLEMS gtg627e OpenFOAM Running, Solving & CFD 20 October 5, 2007 04:02
problems in UDS selva FLUENT 0 September 18, 2006 00:07


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