|
[Sponsors] |
June 28, 2005, 12:49 |
Is it possible to read in a vo
|
#1 |
New Member
Klaus Schnitzlein
Join Date: Mar 2009
Posts: 7
Rep Power: 17 |
Is it possible to read in a volScalarfield from a
data file (in the constant directory) during the run and if yes, how can this be achieved? Thanks in advance. |
|
June 28, 2005, 12:55 |
Yes, instead of say
vol
|
#2 |
Senior Member
Join Date: Mar 2009
Posts: 854
Rep Power: 22 |
Yes, instead of say
volScalarField p ( IOobject ( "p", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); use volScalarField p ( IOobject ( "p", "constant", mesh, IOobject::MUST_READ, IOobject::NO_WRITE ), mesh ); |
|
June 29, 2005, 05:56 |
Thank you very much for your h
|
#3 |
New Member
Klaus Schnitzlein
Join Date: Mar 2009
Posts: 7
Rep Power: 17 |
Thank you very much for your help. Originally I replaced runTime.timeName() by runTime.constant(). The results are identical.
I set up the file defining the field beginning with: dimensions [...]; internalField nonuniform ( .. here the values are inserted ) What I know is that I have to insert the values for the interior cells. But, in what order? And how do they relate to the cells and their indices, respectively. I would like to specify the values in the same ordering as for the cells (polyMesh/cells). Is it possible? Is there a chance to define the values for the entire mesh, not only for the internal and boundary fields, e.g. by using a different keyword, e.g. Field ...? |
|
June 29, 2005, 06:01 |
Come on, this is trivial: the
|
#4 |
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33 |
Come on, this is trivial: the list of values is in the same order as the list of cells: first value into first cell, second value into a second cell etc. Anything else would be madness.
Hrv P.S. For future reference, think about your problems: if it is logical, it is probably right!
__________________
Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk |
|
June 29, 2005, 06:03 |
BTW, before you ask, the same
|
#5 |
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33 |
BTW, before you ask, the same applies for points, edges, faces, faces in patch etc.
Hrv
__________________
Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk |
|
November 23, 2022, 13:40 |
|
#6 |
New Member
Raphael Santos
Join Date: Oct 2013
Posts: 20
Rep Power: 13 |
Hello,
I've asked about how to create and use a new volScalarField on a drag model. But now, I solved. I did it creating the variable on createFields.H, and later, calling it on the drag model file using lookup, command. Last edited by Raphael_Santos; November 27, 2022 at 20:53. Reason: solved |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to create initiate a volScalarField p without reading from disk NO_READ does not seem to work | dbxmcf | OpenFOAM Running, Solving & CFD | 14 | March 25, 2022 07:08 |
Error reading trn file | OliH | CFX | 3 | March 4, 2010 09:24 |
Error reading msh file | ANIL | FLUENT | 1 | January 22, 2009 01:45 |
error reading file | limingtiger | Siemens | 3 | September 21, 2005 21:31 |
prob reading in .neu file | jemteo | FLUENT | 0 | June 15, 2004 14:00 |