Initial flow condition using DATASET

158 views
Skip to first unread message

Romain P.

unread,
Jun 4, 2013, 12:40:46 PM6/4/13
to pflotra...@googlegroups.com
   Hi everyone,

I am trying to initiate the temperature conditions in my TH simulations according to actual measurements from the field.
The geometry of the model is a simple regular 1x1x100 "column" and I have temperatures for each cell. I thought
that creating a dataset might be the right way to go, but I could not get it to work.

I tried slightly different approaches (i.e.loading a text file with cell IDs and values, a text file with (x y z values) and the h5 format).
In any case I keep getting the same error message:

"ERROR: temp_dataset data space dimension (       -1) does not match the dimensions of the domain (      100)."

here is a part of the code I run:

:========================== dataset  =================================
DATASET temp_dataset
  :!FILENAME ./profile.txt
  FILENAME profile.h5
END

:======================= flow conditions ===============================
FLOW_CONDITION initial
UNITS Pa, C, yr
TYPE
PRESSURE dirichlet
TEMPERATURE dirichlet
ENTHALPY dirichlet
/
PRESSURE 1.D5
TEMPERATURE DATASET temp_dataset
ENTHALPY 0.D0
END
============================================================================

Does someone know what I am doing wrong? How should an file look like to create a data set ?
Is there a better approach to do what I am trying to achieve?

I am grateful for any suggestion.

Regards
         /Romain


profile.h5
profile.txt
profile_2.txt
th_vertical.in

Gautam Bisht

unread,
Jun 4, 2013, 1:03:31 PM6/4/13
to pflotra...@googlegroups.com
Romain,

The name of HDF5 group does not match the name dataset in your inputfile.


:== dataset  ==============================================================
DATASET Temperature
  !FILENAME ./profile.txt
  !FILENAME ./profile_2.txt
  FILENAME profile.h5
END


:======================= flow conditions ===============================
FLOW_CONDITION initial
UNITS Pa, C, yr
TYPE
PRESSURE dirichlet
TEMPERATURE dirichlet
ENTHALPY dirichlet
/
PRESSURE 1.D5
TEMPERATURE DATASET Temperature
ENTHALPY 0.D0
END


-Gautam

Hammond, Glenn

unread,
Jun 4, 2013, 1:16:57 PM6/4/13
to pflotra...@googlegroups.com

Gautam,

 

Where is the linkage that assigns temperature on a cell by cell basis from a dataset?  I see time series being supported in PatchUpdateCouplerAuxVars(), but not datasets.

 

Glenn

Gautam Bisht

unread,
Jun 4, 2013, 1:43:05 PM6/4/13
to pflotra...@googlegroups.com
Glenn,

- CondControlAssignFlowInitCond()
 - ConditionControlMapDatasetToVec()
  - HDF5ReadCellIndexedRealArray()
  - VecStrideScatter()

Thus, I believe initial conditions from HDF5 via dataset for TH mode are supported. Are you concerned if time-varying BCs are supported via dataset?

-Gautam.

Hammond, Glenn

unread,
Jun 4, 2013, 1:49:45 PM6/4/13
to pflotra...@googlegroups.com

No, I am not concerned with the time varying component.  I just wanted to ensure that the approach is sufficiently general for TH, and it is.

Romain P.

unread,
Jun 5, 2013, 3:34:24 AM6/5/13
to pflotra...@googlegroups.com
      Gautam and Glenn,

Thank you for your fast and very helpful answers. Things work just fine now.
Do you know why it does not work with the ascii files? Is it meant to work?

Regards
   /Romain

Gautam Bisht

unread,
Jun 5, 2013, 10:35:18 AM6/5/13
to pflotra...@googlegroups.com
Romain,

Assignment of data values cell-by-cell is not supported by ASCII files and is only done via HDF5 datasets.

-Gautam.

Hammond, Glenn

unread,
Jun 5, 2013, 11:46:41 AM6/5/13
to pflotra...@googlegroups.com

Romain,

 

Reading large datasets from ASCII files does not scale well with large parallel jobs.  It is better to train/force everyone to use more scalable approaches such as HDF5.

 

Glenn

Romain P.

unread,
Jun 5, 2013, 2:24:33 PM6/5/13
to pflotra...@googlegroups.com
      Thanks again,


"Reading large datasets from ASCII files does not scale well with large parallel jobs. "

That makes perfectly sense. I was merely curious to know if it was supported.
Working with HDF5 is not much harder anyways, now that I understand the principle.

Best Regards
           /Romain

Romain P.

unread,
Oct 29, 2013, 9:47:47 AM10/29/13
to pflotra...@googlegroups.com
   Hi all,

sorry to take up this old thread again.
It seems to me that the way I could initialize a simulation with a given field of temperature using the DATASET card does not work any longer.
Is it supported for unstructured grids?

I have been trying the new approach to define datasets according to the wiki, with no luck. Attached is one of many attempts to create a h5 according to this standard.

Could someone send an example .h5 that could be used to define initial flow conditions?

Many thanks
           /Romain
workdir.tar

Hammond, Glenn E

unread,
Oct 29, 2013, 2:58:46 PM10/29/13
to pflotra...@googlegroups.com

Romain,

 

Gautam and I have discussed this.  You have uncovered an issue in our implementation.  For the time being, please create a new HDF5 file where you have two datasets at the top of the file (i.e. no group).  One named ‘Cell Ids’ with a list of all the cell ids in the domain (1-N) and another named ‘Temperature’ with the value of temperature at each grid cell.  Then, try running it again.   Send the new dataset file to pflotr...@googlegroups.com if that does not work.

 

I have created a new issue on the issue tracker where we can hopefully refactor the datasets to avoid this confusion in the future.  We need something that forces the users to declare what type of dataset they are using, but we need to define the approach.

 

Glenn

Romain P.

unread,
Oct 29, 2013, 4:36:28 PM10/29/13
to pflotra...@googlegroups.com, pflotr...@googlegroups.com

  Glenn,

For the time being, please create a new HDF5 file where you have two datasets at the top of the file (i.e. no group).  One named ‘Cell Ids’ with a list of all the cell ids in the domain (1-N) and another named ‘Temperature’ with the value of temperature at each grid cell.  Then, try running it again.   Send the new dataset file to pflotr...@googlegroups.com if that does not work.

This was actually my first approach.
I tried again, both with cell ids starting at 0 and at 1. Still no luck.
I attached my work directory, this time the hdf5 is called initial.h5.


hope this helps

Regards
         /Romain

workdir2.tar

Glenn Hammond

unread,
Oct 29, 2013, 5:08:31 PM10/29/13
to pflotra...@googlegroups.com
Forgot to tell you to pull the latest code. Did you do that? If so, I will look at your latest input deck tonight. I needed a new h5 file, which you sent.

Glenn

From: "Hammond, Glenn E" <geh...@sandia.gov>
Date: Tue, 29 Oct 2013 18:58:46 +0000
Subject: RE: [EXTERNAL] [pflotran-users: 1074] Re: Initial flow condition using DATASET

gastonphoebus8 .

unread,
Oct 29, 2013, 5:47:32 PM10/29/13
to pflotra...@googlegroups.com
  Glenn,

I just have tried to run the simulation at home on another computer after recompiling pflotran from the latest code.
It still does not work, the error message is different though:

"
 Testing group: Temperature
 Group "Temperature" in HDF5 file "./initial.h5" not found in file.  Therefore, assuming a cell-indexed dataset.

 ERROR: DatasetLoad not yet supported for base dataset class.
 Stopping!
"

Best regards
          /Romain

Hammond, Glenn E

unread,
Oct 29, 2013, 6:01:34 PM10/29/13
to pflotra...@googlegroups.com
Yes.  With the last h5 file that you send, I was able to get to the bottom of it.  Pull the latest and you should see that your time 0 temperatures in pflotran.h5 are the same as initial.h5.  We need a regression test to catch this use of the code, as it is clear that we do not presently have one.  Can you create a small test problem (small mesh, runs in 6 seconds) that we can add to our regression suite?  This will help us not break the "dataset" functionality that you use.  I don't know of anyone else using a cell-indexed dataset for temperature.

Regards,

Glenn


From: pflotra...@googlegroups.com [pflotra...@googlegroups.com] on behalf of gastonphoebus8 . [romain.pa...@gmail.com]
Sent: Tuesday, October 29, 2013 2:47 PM
To: pflotra...@googlegroups.com
Subject: Re: [EXTERNAL] [pflotran-users: 1077] Re: Initial flow condition using DATASET

Romain P.

unread,
Oct 30, 2013, 10:58:03 AM10/30/13
to pflotra...@googlegroups.com
   Glenn,

It works! great!
Thank you for your help and for being so quick.

I attached a small simulation that uses this function and runs in 6 seconds on my computer, using 4 cores.
Hope it suits your purpose for the regression test.

Will it also work for the new dataset approach? I get:
"ERROR: Dimension attribute must be included in hdf5 dataset file. Stopping!" ,
but that could be me who structured the file incorrectly.

Best regards
          /Romain

regression.tar

Hammond, Glenn E

unread,
Oct 30, 2013, 1:05:21 PM10/30/13
to pflotra...@googlegroups.com

Thanks.  I will take this further when I have a bit more time and iterate with you directly on it.  Having users send test cases that run fast (i.e.  <= 6 seconds) greatly improves our regression suite.

 

Glenn

 

From: pflotra...@googlegroups.com [mailto:pflotra...@googlegroups.com] On Behalf Of Romain P.


Sent: Wednesday, October 30, 2013 7:58 AM
To: pflotra...@googlegroups.com

Romain P.

unread,
Jan 8, 2014, 4:10:19 AM1/8/14
to pflotra...@googlegroups.com
  Hi,

It seems that the dataset-functionality I use to define initial flow conditions ceased to work in the version i pulled yesterday.
Is it an issue or is there a change in implementation?

I attached a slight modification of the regression test, with specified "no freezing" submode, which should comply with the recent changes in TH-mode.

Best regards
            /Romain
pflotran.in

Gautam Bisht

unread,
Jan 8, 2014, 8:49:28 AM1/8/14
to pflotra...@googlegroups.com
Romain,

Can you send us the dataset to reproduce the error?

-Gautam

Romain P.

unread,
Jan 8, 2014, 10:45:41 AM1/8/14
to pflotra...@googlegroups.com
   Gautam,

sorry, here is the test with related dataset.
I have the same problem with the simulation I am working on and another dataset.
Both run on a 2 month old version of pflotran but not with later ones.

Thanks for your help
     /Romain
regression_test.tar.gz

Hammond, Glenn E

unread,
Jan 8, 2014, 11:42:36 AM1/8/14
to pflotra...@googlegroups.com

Romain,

 

We discontinued the legacy support for the GRID,BOUNDS card.  The BOUNDS card now is formatted like the COORDINATES card in a REGION:

 

BOUNDS

  xmin ymin zmin

  xmax ymax zmax

/

 

Easy fix.  Change

 

GRID

TYPE structured

ORIGIN 0.d0 0.d0 0.d0

NXYZ 1 1 100

BOUNDS

0.d0 1.d0

0.d0 1.d0

0.d0 100.d0

/

END

 

To

 

GRID

TYPE structured

ORIGIN 0.d0 0.d0 0.d0

NXYZ 1 1 100

BOUNDS

0.d0 0.d0 0.d0

1.d0 1.d0 100.d0

/

END

 

Let us know if that solves the problem.

 

Glenn

 

 

From: pflotra...@googlegroups.com [mailto:pflotra...@googlegroups.com] On Behalf Of Romain P.


Sent: Wednesday, January 08, 2014 7:46 AM
To: pflotra...@googlegroups.com

Romain P.

unread,
Jan 8, 2014, 1:22:40 PM1/8/14
to pflotra...@googlegroups.com
   Hi,

thank you for your support.
Your suggestion solved the problem for the test case i sent, so it means that the dataset functionality is still working fine and that my other simulation fails for some other reason, much likely my own mistake.
Sorry for taking your time for this.

/Romain

Hammond, Glenn E

unread,
Jan 8, 2014, 1:23:59 PM1/8/14
to pflotra...@googlegroups.com

No worries Romain.

 

Glenn

 

From: pflotra...@googlegroups.com [mailto:pflotra...@googlegroups.com] On Behalf Of Romain P.


Sent: Wednesday, January 08, 2014 10:23 AM
To: pflotra...@googlegroups.com

Romain P.

unread,
Jan 9, 2014, 7:54:32 AM1/9/14
to pflotra...@googlegroups.com
  Hi again,

I found out where my problem came from.
It seems like PFLOTRAN do not allow me to define both an initial field of temperatures using a dataset and an initial water table using a datum dataset.
Both work separately though.

Regards
           /Romain

 

Hammond, Glenn E

unread,
Jan 9, 2014, 11:27:22 AM1/9/14
to pflotra...@googlegroups.com

Romain,

 

According to the code in patch.F90:PatchUpdateCouplerAuxVarsTH, you should be able to assign the following

 

CONDITION

  TYPE

    PRESSURE hydrostatic

    TEMPERATURE heterogeneous_dirichlet

  /

  …

/

 

and it should work.  However, I believe that I see a bug under the pressure conditional where the temperature dataset is being assigned to the PRESSURE_DOF:

 

      case(HET_DIRICHLET)

        call PatchUpdateHetroCouplerAuxVars(patch,coupler, &

                flow_condition%temperature%dataset, &

                num_connections,TH_PRESSURE_DOF,option)

 

Shouldn’t it be flow_condition%pressure%dataset, not %temperature% that is applied?  I believe that this has nothing to do with your question/statement, but Gautam should verify.

 

Glenn

 

From: pflotra...@googlegroups.com [mailto:pflotra...@googlegroups.com] On Behalf Of Romain P.


Sent: Thursday, January 09, 2014 4:55 AM
To: pflotra...@googlegroups.com

Gautam Bisht

unread,
Jan 9, 2014, 11:56:17 AM1/9/14
to pflotra...@googlegroups.com
Glenn: Yes, that is a bug. Pushed a fix for it in the repo.

Romain: Can pull latest changes from pflotran-dev and check if the code works for your problem? If not, can you send the input dataset and datasets to reproduce the issue?

-Gautam.
Reply all
Reply to author
Forward
0 new messages