m6
This commit is contained in:
59
tests/ResolvabilityTest.cs
Normal file
59
tests/ResolvabilityTest.cs
Normal file
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using System.Numerics;
|
||||
using VirtualChemistry.Chemistry.Atoms.Implements;
|
||||
using VirtualChemistry.Chemistry.Atoms.Resolver;
|
||||
using VirtualChemistry.Chemistry.Compounds.Implements;
|
||||
using VirtualChemistry.Chemistry.Containers;
|
||||
using VirtualChemistry.Chemistry.Mixtures.Implements;
|
||||
|
||||
namespace VirtualChemistryTest;
|
||||
|
||||
public static class ResolvabilityTest
|
||||
{
|
||||
private class Container : IChemicalContainer
|
||||
{
|
||||
public Container(HeterogeneousMixture h) => Content = h;
|
||||
public double Volume() => 200;
|
||||
public HeterogeneousMixture Content { get; set; }
|
||||
public double EnvironmentPressure { get; set; }
|
||||
public double EnvironmentTemperature { get; set; }
|
||||
}
|
||||
[Test]
|
||||
public static void SelfResolvabilityTest()
|
||||
{
|
||||
HeterogeneousMixture h = new ();
|
||||
h.Container = new Container(h);
|
||||
HomogeneousMixture m = new();
|
||||
h.AddLayer(m);
|
||||
BaseAtom a = AtomResolver.Resolve(1);
|
||||
BaseAtom a2 = AtomResolver.Resolve(1);
|
||||
Compound c1 = a.GrabCompound;
|
||||
c1.Amount = 1;
|
||||
Compound c2 = a2.GrabCompound;
|
||||
c2.Amount = 2;
|
||||
m.AddCompound(c1);
|
||||
Console.WriteLine(m.Resolvability(c2));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public static void InverseResolvabilityTest()
|
||||
{
|
||||
HeterogeneousMixture h = new ();
|
||||
h.Container = new Container(h);
|
||||
HomogeneousMixture m = new();
|
||||
h.AddLayer(m);
|
||||
HomogeneousMixture m2 = new();
|
||||
BaseAtom a = AtomResolver.Resolve(1);
|
||||
BaseAtom a2 = AtomResolver.Resolve(2);
|
||||
Compound c1 = a.GrabCompound;
|
||||
c1.Amount = 1;
|
||||
Compound c2 = a2.GrabCompound;
|
||||
c2.Amount = 2;
|
||||
m.AddCompound(c1);
|
||||
m2.AddCompound(c2);
|
||||
Console.WriteLine(m.Resolvability(c2));
|
||||
Console.WriteLine(m2.Resolvability(c1));
|
||||
Complex sa = 0;
|
||||
Console.WriteLine(sa.Phase);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user