Minimum on the Gibbs energy

10 views
Skip to first unread message

Evgenii Rudnyi

unread,
Sep 8, 2007, 3:27:18 AM9/8/07
to thermody...@googlegroups.com
Hello Wee Nien,

> 1. I cannot get a minimum for the Gibbs energy by using the reference
> object like before.

Actually it is okay and minimum is there. In order to see it, look at
Gmix. So

G = Gref + Gmix

Gref is just a plane without any minimum. The minimum comes from Gmix and
you can clearly see it when you look at Gmix. It is a bit difficult to
observe minimum on G though. The reason is that you have a straight line
coming from Gref with steep descent and on top of this a relatively small
minimum coming from Gmix. I guess it is necessary to make more steps to
see it. But look at the equation above: when Gmix has a minimum and Gref
is a straight line, then there must be a minimum on G.

Best wishes,

Evgenii


WNien

unread,
Sep 19, 2007, 4:36:31 AM9/19/07
to thermodynamicslib
Hello Evgenii,

I can see a minimum in Gmix but not in G. Is it possible to let tdlib
find the minimum position for me?

Best wishes,
Wee Nien


Evgenii Rudnyi

unread,
Sep 19, 2007, 2:18:14 PM9/19/07
to thermody...@googlegroups.com
> I can see a minimum in Gmix but not in G. Is it possible to let tdlib
> find the minimum position for me?

Hello Wee Nien,

I should say, I am not sure if I understand what you exactly want.

Usually one wants to find a minimum in order to determine an equilibrium
composition. However, this can be also done by solving a system of
equations through chemical potentials (see eq. 2.26 in the manual). The
object PhaseEquilibrium implements it in the case of several phase. In
the object associated_solution this is done internally for one phase -
ideal associated solution.

However, you should be careful, as to find an equilibrium composition
through minimization we should fix external variables, that is, T, P and
number of moles of independent components. Otherwise it does not make sense.

Let us consider a two component solution A-B. The molar Gibbs energy is
a function of p, T, and mole fraction xB. At constant T and p we have
G(xB). However, it does not make sense to search for the minimum of
G(xB), as A and B are independent components and before finding the
minimum we should fix there mole numbers, that is, xB.

Well, we may need to minimize the Gibbs energy when G(x2) is not convex,
that is, there is a miscibility gap. But in this case we need to
introduce two phases, L1 and L2, and I am afraid, this is not what you
want. By the way PhaseEquilibrium may be used to find a miscibility gap.

Do you want just to show that there is a minimum on the Gibbs energy for
a reaction N2 + 3H2 = 2NH3? This should be possible, but note that the
equilibrium composition in this case can be computed by associated_solution.

Please just describe your original goal in more detail and I will help
you to find the best way to implement it.

Best wishes,

Evgenii

WNien

unread,
Oct 23, 2007, 10:41:41 AM10/23/07
to thermodynamicslib
Hallo Evgenii,

> However, you should be careful, as to find an equilibrium composition
> through minimization we should fix external variables, that is, T, P and
> number of moles of independent components. Otherwise it does not make sense.
>

> ... before finding the


> minimum we should fix there mole numbers, that is, xB.

Why should we fix the number of moles of one independent component? In
the file out.mod, you have fixed the variable x2 = 0.5 and the
internal x(N2) remains constant throughout the computation, i.e. x(N2)
= 0.5. When I change x2 to some other amount, for example x2 = 0.25,
the internal x(N2) is no longer constant. Why is this the case? Can I
fix x1 instead or is it arbitrary?


Best wishes,

Wee Nien

Evgenii Rudnyi

unread,
Oct 24, 2007, 2:39:56 PM10/24/07
to thermody...@googlegroups.com
Hi Wee Nien,

>> However, you should be careful, as to find an equilibrium composition
>> through minimization we should fix external variables, that is, T, P and
>> number of moles of independent components. Otherwise it does not make sense.
>>
>> ... before finding the
>> minimum we should fix there mole numbers, that is, xB.
>
> Why should we fix the number of moles of one independent component?

The equilibrium criteria are defined for the closed system. This means
that when we search for the minimum of the Gibbs energy for the two
component system we should fix the mole number of A and B. This in turn
means that xB is also fixed. In this case, we do not have internal
variables as such, everything that can happen is miscibility.

> In
> the file out.mod, you have fixed the variable x2 = 0.5 and the
> internal x(N2) remains constant throughout the computation, i.e. x(N2)
> = 0.5. When I change x2 to some other amount, for example x2 = 0.25,
> the internal x(N2) is no longer constant. Why is this the case? Can I
> fix x1 instead or is it arbitrary?

Could you please send this example once more? I am not sure if I
remember this now.

Best wishes,

Evgenii

WNien

unread,
Oct 26, 2007, 6:30:54 AM10/26/07
to thermodynamicslib
Hi Evgenii,

> Could you please send this example once more? I am not sure if I
> remember this now.

I have uploaded the file composition.mod where I have changed the
external x2 to 0.25. The original one is in the file out.mod that you
have upload here in the post "equilibrium compositions N2, H2 , NH3".
By running the file composition.mod, one will see that the internal x2
is no longer constant.


Best wishes,

Wee Nien

Evgenii Rudnyi

unread,
Oct 27, 2007, 6:07:46 AM10/27/07
to thermody...@googlegroups.com
Hi Wee Nien,

This is another case as compared with what I have described. Here we have
a two component solution with internal variables. Externally we have
defined two components N2 and H2. And the mole fraction of external
components is fixed when VCS computes the equilibrium composition.
However, internal mole fractions are not directly related to the external
ones, that is

xN2_ex != xN2_in

This is by nature in this case. They are related to each other according
to the mass balance - see eq. 3.51 in the manual.

For simplicity I will write it in the case when we would define N and H as
components

nH_ex = 3*nNH3_in + 2*nH2_in
nN_ex = nNH3_in + 2*nN2_in

This says that the number of atoms are constant, it does not change during
the chemical reaction.

Best wishes,

Evgenii

WNien

unread,
Nov 6, 2007, 5:46:40 PM11/6/07
to thermodynamicslib
Hallo Evgenii,

> xN2_ex != xN2_in


>
> nH_ex = 3*nNH3_in + 2*nH2_in
> nN_ex = nNH3_in + 2*nN2_in

from the equations above, is nN_ex = nN2_ex?

And what is the relationship of internal(ntot) with these parameters?


Best wishes,

Wee Nien

Evgenii Rudnyi

unread,
Nov 8, 2007, 3:58:08 PM11/8/07
to thermody...@googlegroups.com
Hallo Wee Nien,

>> xN2_ex != xN2_in
>>
>> nH_ex = 3*nNH3_in + 2*nH2_in
>> nN_ex = nNH3_in + 2*nN2_in
>
> from the equations above, is nN_ex = nN2_ex?
>
> And what is the relationship of internal(ntot) with these parameters?

This is just a mass balance expressed in terms of number of moles of
atomic N and H. It says that number of atoms of both N and H is constant.

If we introduce molecular external components N2 and H2, then nN_ex =
2*nN2_ex and nH_ex = 2*nH2_ex. Again, you have just to count atoms.

The mass balance is written in term of mole numbers. However, in my
functions I use mole fractions. So, I use a transformation

n1, ..., nN -> n, x1, ..., xN

where n = Sum_i n_i is a total number of moles. Note that number of
variables are the same, as the sum of mole fractions is always one.

So, nNH3 = n*xNH3 and so on. Then

2*nH2_ex = n(3*xNH3_in + 2*xH2_in)
2*nN2_ex = n(xNH3_in + 2*xN2_in)

However, n as well as mole fractions is unknown.

Actually VCS solves the problems in terms of mole numbers and at the end
I just recompute them to the total number of moles and mole fractions.

If you use debug=1, then you should receive some listing where you will
find some extra information on how the solution has been done.

Best wishes,

Evgenii

WNien

unread,
Nov 12, 2007, 7:04:01 PM11/12/07
to thermodynamicslib
Hallo Evgenii,

> However, n as well as mole fractions is unknown.

I want to fix the external variables, xH2=0.75 and xN2=0.25, i.e.
nH2=3 and nN2=1. So n = 4, but I don't understand why is it unknown. I
am confused. In tdlib, the ntot is always less than 1. I don't know if
I entered the correct value for what I want. What should I do, if I
want to compute the equilibrium composition for the proportion of N2 :
H2 = 1: 3?

> If you use debug=1, then you should receive some listing where you will
> find some extra information on how the solution has been done.

debug=1 by default. I could not see anything, either debug=0 or
debug=1, the results are the same.


Best Regards,

Wee Nien

Evgenii Rudnyi

unread,
Nov 13, 2007, 3:24:11 PM11/13/07
to thermody...@googlegroups.com
Hi Wee Nien,

> I want to fix the external variables, xH2=0.75 and xN2=0.25, i.e.
> nH2=3 and nN2=1. So n = 4, but I don't understand why is it unknown.

This concerns external variables and here everything is known. n here is
also known and fixed. Actually in associated_solution n for external
components is always 1, as we use molar Gibbs energy. Think that you
take 0.75 moles of H2 and 0.25 moles of N2. The equilibrium composition
is the same.

>I
> am confused. In tdlib, the ntot is always less than 1. I don't know if
> I entered the correct value for what I want. What should I do, if I
> want to compute the equilibrium composition for the proportion of N2 :
> H2 = 1: 3?

ntot is for internal components, so I guess that you have done
everything correctly. ntot is already unknown as it is defined

ntot = nN2_in + nH2_in + nNH3_in

and the goal is to compute these numbers. I think that it is less than
one as in the reaction

N2 + 3H2 = 2NH3

the total number of moles is reduced.

>> If you use debug=1, then you should receive some listing where you will
>> find some extra information on how the solution has been done.
>
> debug=1 by default. I could not see anything, either debug=0 or
> debug=1, the results are the same.

Yes, the results are the same in the output. However, when debug=1 there
should be extra file on the disk debug.phase.* and there there should be
VCS output.


In general, it is a good idea to start writing equations. Along this way
it will be easier to understand what happens.

Best wishes,

Evgenii

Reply all
Reply to author
Forward
0 new messages