aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2009-11-27 15:18:55 +0100
committerThomas White <taw@physics.org>2009-11-27 15:18:55 +0100
commit3a6f08ad10aa901d3c75165c3c2e47361c719847 (patch)
tree78f7a1c6a1c794f169bb6ca2bf73e4d53856f68d
parent7fb6226e91449278537f4bf71a8ccd35cda02e02 (diff)
Slightly better water calculation
-rw-r--r--src/diffraction.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/diffraction.c b/src/diffraction.c
index 80232210..11f82397 100644
--- a/src/diffraction.c
+++ b/src/diffraction.c
@@ -94,14 +94,22 @@ double water_intensity(struct threevec q, double en,
{
double complex fH, fO;
double s, modq;
+ double width;
double complex ifac;
/* Interatomic distances in water molecule */
const double rOH = 0.09584e-9;
const double rHH = 0.1515e-9;
- /* Volume of water column */
- const double water_v = M_PI*pow(water_r, 2.0) * 2.0 * beam_r;
+ /* Volume of water column, approximated as:
+ * (2water_r) * (2beam_r) * smallest(2beam_r, 2water_r)
+ * neglecting the curvature of the faces of the volume */
+ if ( beam_r > water_r ) {
+ width = 2.0 * water_r;
+ } else {
+ width = 2.0 * beam_r;
+ }
+ const double water_v = 2.0*beam_r * 2.0*water_r * width;
/* Number of water molecules */
const double n_water = water_v * WATER_DENSITY