#!/usr/bin/env python # coding: utf-8 # In[1]: from TRIOMA.tools.Extractors.PAV import Component,Fluid,Membrane, Geometry from TRIOMA.tools.BreedingBlanket import BreedingBlanket from TRIOMA.tools.Circuit import Circuit import TRIOMA.tools.materials as materials # Let's define a Pipe component. A Component is made of a fluid class, flowing inside the pipe, and a membrane class, which is the pipe. To define a fluid class we can define all properties or use pre-built materials with the set_properties_from_fluid_material method (which takes as input a Fluid material class, here returned by the material.Flibe function). # Component specific properties of the fluid representation, such as Temperature, hydraulic diameter and fluid velocity, are not material independent, so they must be specified by the user. # In[2]: T=973.15 d_hyd=25.4E-3 U0=2.5 flibe=Fluid(d_Hyd=d_hyd,U0=U0) flibe.set_properties_from_fluid_material(materials.Flibe(T)) # With ease we can define a membrane, the solid material of the pipe. Geometric properties (not material-dependent) only include the thickness of the pipe. # In[3]: Steel = Membrane( thick=0.25E-3,k_r=1E9,k_d=1E9) Steel.set_properties_from_solid_material(materials.Steel(T)) # Now we define a component. It takes as input a fluid, a membrane and the inlet concentration of the component. The inlet concentration is not defined by the fluid class as some other components such as the Breeding Blanket may behave differently. The lenght is a characteristic of the component, but it can be evaluated with some component methods itself (e.g: heat exchangers), therefore it is used as argument of the methods which need it and is treated as an external variable (this may change) # In[4]: PAV_geom=Geometry(L=1,D=25.4E-3, thick=0.25E-3, n_pipes=1E3) c_in=1E-3 PAV = Component(c_in=c_in, geometry=PAV_geom,fluid=flibe, membrane=Steel, name='PAV') # Now we can use pre-built methods to evaluate the T extraction efficiency of the component and the outlet concentration. # In[5]: PAV.get_efficiency(c_guess=c_in/1E3) PAV.outlet_c_comp() # We can also inspect component variables. # In[6]: PAV.analytical_efficiency() PAV.inspect("eff") PAV.inspect("eff_an") print("Relative efficiency error",abs(PAV.eff-PAV.eff_an)/PAV.eff) # Or inspect the whole component together with the Fluid class and Membrane class by using the inspect method without an argument # In[7]: PAV.inspect() fig=PAV.plot_component() fig.show() # In[8]: PAV2 = Component(c_in=c_in, geometry=PAV_geom,fluid=flibe, membrane=Steel, name='PAV2',loss=True) PAV3 = Component(c_in=c_in, geometry=PAV_geom,fluid=flibe, membrane=Steel, name='PAV3',loss=True) BB=BreedingBlanket(Q=0.5E9,TBR=1.08,T_out=900,T_in=800,fluid=flibe, c_in=1,name="BB" ) Circuit=Circuit(components=[BB,PAV,PAV2,PAV3],closed=True) Circuit.solve_circuit() # Circuit.inspect_circuit() Circuit.get_gains_and_losses() print("Extracted the "+str(Circuit.extraction_perc*100) +"% of the Tritium") print("Extracted the "+str(Circuit.loss_perc*100) +"% of the Tritium") fig2=Circuit.plot_circuit() # In[9]: Circuit.get_circuit_pumping_power() print("The circuit requires "+str(Circuit.pumping_power/1E3)+" kW of pumping power")