When adressing a model crash or bug, please remember to include an entire model setup in your post that reproduces the crash or exposes the bug. Also add the XBlog.txt file. This is necessary information for people that are trying to help you. Including your model setup can be achieved by adding the zipped run directory (excluding output) as an attachment to the post.

Forum

Back

RE: River discharges with curvilinear grid

MA
Mohd Shahrizal Ab Razak, modified 3 Years ago.

River discharges with curvilinear grid

Wind Posts: 43 Join Date: 3/26/12 Recent Posts
Hi all,

I am trying to simulate river discharge using the Xbeach model. I built several models (rectangular domain) and create a fix channel in the model to represent a river. The river discharge was imposed at the land boundary. The models run fine and I can see the flow currents in the channel flowing out to the sea.

However, when I tried to run a model with curvilinear grids and imposed the flow discharge at the land boundary, I did not see water flowing out to the sea.

Is this because of the curvilinear grid or my model setup.


Any advises are well appreciated.

Shah
MM
Marco Miani, modified 3 Years ago.

RE: River discharges with curvilinear grid

Wind Posts: 40 Join Date: 4/1/14 Recent Posts
Shah, I have faced the same problem in the past.

When using curvilinear grids, i.e. where grid lines are not straight lines (for instance they they might follow depth contours), you have to be careful with x coordinate matrix.

Bathymetries defined using a curvilinear grid will comprise 3 files:
  • X coordinate matrix
  • Y coordinate matrix
  • Depth values (Z matrix)


Assuming your along-shore direction is North -South, and assume also that you have land on the west and water east.
In this case, higher X coordinates are the ones at the open boundaries (at sea) and lower coordinates are on land.
if your coordinate matrix will grow from left to right, what XB will understand when assimilating data is: open boundary is on land (lower X values, lower X matrix indices) and land boundary is at sea (higher X values, and higher X matrix indices).

What you want to do is flip the X matrix coordinate from left to right , so that what I have outlined above inverts and things where they should belong. The model understands open boundary not from the x value but from the x matrix index.

Y and Z remain untouched.
X will be flipped (in MatLab: fliplr).


For creating and editing curvilinear grids, I use D3D software (quickin and refgrid). It is a great tool, and XB has an extra dedicated input format:
gridform = delft3d
depfile = Name_of_depth_file.dep
xyfile = Name_of_grid_file.grd


Did this help?

MA
Mohd Shahrizal Ab Razak, modified 3 Years ago.

RE: River discharges with curvilinear grid

Wind Posts: 43 Join Date: 3/26/12 Recent Posts
Hi Marco,

Thank you for your reply.

I also created the grids and bathymetry using the Delft3D refgrid and Delf3D quickin. The advantage of these modules is that we do not need to specify x and y coordinates in a separated file.

In Xbeach, if we already defined the (1,1) matrix at the offshore boundary corner Xbeach will automatically define that as sea and (nx,1)matrix defined as land.

I attached a figure containing sketches of my hypothetical model for better illustration and you may edit the picture, if I am wrong. I include also my model setup for your reference.

Shah
AF
ann fan, modified 10 Months ago.

RE: River discharges with curvilinear grid

Capillary Posts: 9 Join Date: 4/11/17 Recent Posts
Hello, Miani

May I ask you how to flip the X matrix coordinate in detail?

My bathymetry is land on the left and sea on the right.

I have tried to flip the x matrix coordinate in Matlab, or just flip the value of the 'ETA' in grid file before the value of x coordinates, but they doesn't work.

In the fomer situation, it reports error that 'Quit XBeach since computational time implodes/explodes'.

In the latter situation, the model can run, but there's no wave in the output file.

The model related files are attached.

Could you please help me with this problem? Thank you very much!

Ann
curvilinear
CS
Constantin Schweiger, modified 10 Months ago.

RE: River discharges with curvilinear grid

Capillary Posts: 18 Join Date: 1/20/17 Recent Posts
Hello Ann,

I think the easiest way to rotate your grid is using Delft3D RGFGrid. As you are using a Delft Grid, I assume that you have access to the software.

So, In RGFGRID, frist import your grid and then just click on Coordinate System -> Translation and Rotation. Be aware that you also have to rotate your dep file. For this, if the basis for your dep file are samples for instance, import your sample files as well before rotating your grid. After this, you can import your rorated data to Delft-QUICKIN and generate your dep-file.

Hope this helps!

Best regards,

Constantin
AF
ann fan, modified 10 Months ago.

RE: River discharges with curvilinear grid

Capillary Posts: 9 Join Date: 4/11/17 Recent Posts
Hello Constantin,

Thank you so much for your reply!

I have imported the sample file before rotating the grid as you said. Here comes a problem that I only know how to save the grid file but not the sample file.

Do I misunderstand you that I can rotate the sample file with the grid file so I don't need to rotate the dep file after interpolation?

Could you help me with this? Thanks a lot??

Ann
CS
Constantin Schweiger, modified 10 Months ago.

RE: River discharges with curvilinear grid

Capillary Posts: 18 Join Date: 1/20/17 Recent Posts
Hello Ann,

you're welcome! You can save your rotated samples right under File -> Attribute Files -> Save Samples - so right below "Open Samples".

You didn't misunderstand me. When you import your rotated grid and samples in QUICKIN you just need to interpolate your dep file. This will have the rotation of your grid file!

Best regards,

Constantin
AF
ann fan, modified 10 Months ago.

RE: River discharges with curvilinear grid

Capillary Posts: 9 Join Date: 4/11/17 Recent Posts
Hello Constantin?

Thanks again! I think maybe my 4.01.00 version of D3D is too old, so I don't have this function.
What version do you use?

Best regards,

Ann
CS
Constantin Schweiger, modified 10 Months ago.

RE: River discharges with curvilinear grid

Capillary Posts: 18 Join Date: 1/20/17 Recent Posts
Hello Ann,

I'm using Delft 5.02.00.

Best regards,

Constantin
AF
ann fan, modified 10 Months ago.

RE: River discharges with curvilinear grid

Capillary Posts: 9 Join Date: 4/11/17 Recent Posts
Hello Constantin,

I'm sorry that I can't get access to your version...

Would you mind sending the set-up files to me? My e-mail address is fanwzh_smile@163.com.

This is really important for me. Thank you soooo much!

Best regards,

Ann
CS
Constantin Schweiger, modified 10 Months ago.

RE: River discharges with curvilinear grid

Capillary Posts: 18 Join Date: 1/20/17 Recent Posts
Hello Ann,

what do you mean with set-up files? If you mean the rotated data of your model I would need the samples (.xyz) files..

Best regards,

Constantin
AF
ann fan, modified 10 Months ago.

RE: River discharges with curvilinear grid

Capillary Posts: 9 Join Date: 4/11/17 Recent Posts
Hello Constantin,

Actually, I mean the installation package of your version of Delft3D. Could you please e-mail it to me?
If it's inconvenient, the sample file is attached. Please help me to rotate it 180 degrees.
It is really appreciated that you are willing to help me.

Best regards,

Ann

Attachments: