Geometrical approaches to Class group of Dedekind Rings I premise that I do not know anything about fractionary ideals and class groups of Dedekind domains. But I know the theory of divisors on regular schemes, as treated in Hartshorne. What I would like to know is if there exist some geometric approaches to calculate the class group of a Dedekind domain.
In fact, for an algebraic variety $X$, the usual method consists of choosing an open subset $U$ of $X$ such that it is easy to prove that $Cl \ U = 0$ and then finding $1$-codimension points of $X \setminus U$. These points are generators of the group $Cl \ X$ and, with rational functions, one finds the relations among them.
But, what must I do to calculate the class group of $\mathbb{Z}[\sqrt{-5}]$, for example? To me it is not easy to choose an affine subset that is the spectrum of a UFD. (I know only $\mathbb{Z}$ and $\mathbb{Z}[i]$.)
 A: One point to bear in mind is that it is not typically possible to choose an open subset $U$ of Spec $A$, for a Dedekind domain $A$, so that $Cl U$ is trivial.  Indeed, this is possible if and only if $Cl A$ is finitely generated.  (The complement of $U$ in Spec $A$ will then be a finite set of generators of $Cl A$.)
For example, if $A$ is the affine ring of a smooth curve over $\mathbb C$ whose
completion has positive genus, e.g. $A = \mathbb C[x,y]/(y^2 - x^3 - x)$,
then $Cl A$ is infinitely generated, and so no such $U$ exists.
If $Cl A$ is finitely generated, then the problem of finding $U$ is equivalent (as you already note in your question) to the problem of finding generators for $Cl A$, and I think it is fairly standard to do this via height bounds/geometry of numbers, as in the approach via Minkowski that Qiaochu suggests.  
For a related, but different, arithmetic context, one can consider the proof of the Mordell--Weil theorem and the problem of finding explicitly generators for the group of rational points on an elliptic curve or abelian varieties --- here one uses height arguments.  For a geometric analogue, one can consider the Neron--Severi Theorem of the Base, about finite generation of the Neron--Severi group.  In one of Lang's book, he presents a unified account of these various theorems.
Note that the connection with the Theorem of the Base is more than superficial:
if $X$ is a smooth and projective variety, then Pic $X$ will be finitely generated if and only if its connected component is trivial (so that Pic $X$ coincides with the Neron--Severi group of $X$).  Then the problem of computing
a finite set of generators (which is the same as computing an open $U$ such that Pic $U$ is trivial) is the problem of making the Theorem of the Base effective for $X$.  I don't know how to do this in practice, but I'd be surprised if  it's easy to find $U$ just by inspection in general.
E.g. if $X$ is a K$3$ surface, then we know that Pic $X = NS(X)$, but the free rank of Pic $X$ can be as high as $20$.  Is it possible just by inspection to find a $U$ inside $X$ with trivial Pic?  I would guess that in practice one would use some kind of geometric analogue of a Minkowski bound to find generators for Pic $X$ --- i.e. some effective version of the Theorem of the Base --- and, having done this, one could then compute $U$ if one was so inclined.  (In other words, computing Pic $X$ would come first, and computing $U$ would come second.)
I guess I can summarize this post by asking a question of my own: are there really that many $U$ for which it's easy to prove that $Cl U = 0$?
A: I guess the analogue for number fields is the following. The Minkowski bound furnishes, for every number field $K$, an explicit number 
$$M_K = \sqrt{|D_K|} \left( \frac{4}{\pi} \right)^s \frac{n^n}{n!}$$ 
such that $\text{Cl}(\mathcal{O}_K)$ is generated by prime ideals of norm at most $M_K$, where


*

*$D_K$ is the discriminant,

*$s$ is the number of pairs of complex embeddings,

*$n = [K : \mathbb{Q}]$.


In particular, it follows that one can write down an explicit list $S$ of primes (the primes less than or equal to $M_K$) such that $S^{-1} \mathcal{O}_K$ has trivial class group (recall that the localization of a Dedekind domain is a Dedekind domain). The inclusion $\text{Spec } S^{-1} \mathcal{O}_K \to \text{Spec } \mathcal{O}_K$ is the analogue of the inclusion of the open subset $U$ in the function field case. Then, as you say, finding rational functions is how one finds relations among the generators.
For $K = \mathbb{Q}(\sqrt{-5})$ we have $|D_K| = 20, s = 1, n = 2$, so the Minkowski bound is $\frac{4 \sqrt{5}}{\pi} < 3$. It follows that the class group is generated by ideals of norm at most $2$, so we only have to consider prime ideals above $2$. Since $x^2 + 5 \equiv (x + 1)^2 \bmod 2$, we have
$$(2) = P^2$$
for some prime ideal $P$ of norm $2$, hence the class group is either trivial or the cyclic group $C_2$ generated by $P$, and by inspection $\mathcal{O}_K$ does not have unique factorization so it is the latter. (A more generalizable way to end this argument is that $\mathcal{O}_K$ does not contain an element of norm $2$.) 
