# Cylindrical 2d coordinate system

In geometric 2D it is desired to have an RZ cylindrical coordinate system capability.

Mathematically this adds a 2*pi*r to every term of an time+advection+

It is proposed here that this is best added in Transform_

Where appropriate code like the following will appear:

if (present(detwei) then

! If the coordinate system is cylindrical and the geometry dimension

! is 1 or 2 then include 2*pi*r into detwei, where r is the

! first geometry dimension variable. Similarly if the coordinate

! system is spherical and the geometric dimension is 1 then include

! 4*pi*r**2 into detwei, where r is the only geometric dimension variable.

if ( ((dim == 1) .or. (dim == 2)) .and. (coordinate_system == 2) ) then

detwei = detwei * ele_val_at_quad(X, ele, dim = 1) * two_pi

else if ( (dim == 1) .and. (coordinate_system == 3) ) then

detwei = detwei * ele_val_at_quad(X, ele, dim = 1) * ele_val_at_quad(X, ele, dim = 1) * four_pi

end if

end if

Note that this will also include it in 1D, as well as a spherical coordinate system (scale by 4*pi*r**2) for 1D again.

The variables two_pi and four_pi will be added to Global_

The variable coordinate_system will be set from an optional option that becomes available if the geometry dimension is set to 2 or 1 in the fluidity schema. Unselected and the default Cartesian coord system is used. The variable coordinate_system is perhaps best added to Global_Parameters also to avoid inspecting spud within Transform_

This will take the convention that XY --> RZ, as other parts of the options schema will still refer to X and Y (such as vector field boundary conditions).

Also a procedure to check that the first dimension coordinate (X-->R) has no negative values should also be included.

Suitable additions to the manual will be required as well as a some test cases (compared to analytic and MMS).

## Blueprint information

- Status:
- Not started

- Approver:
- None

- Priority:
- Undefined

- Drafter:
- Brendan Tollit

- Direction:
- Needs approval

- Assignee:
- Brendan Tollit

- Definition:
- Discussion

- Series goal:
- None

- Implementation:
- Unknown

- Milestone target:
- None

- Started by

- Completed by