From 53e198583549e7edc37a46f4707e664668464681 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 1 Apr 2025 13:42:07 +0100 Subject: [PATCH 01/11] :fire: Remove divert method, associated functions and tests --- process/divertor.py | 686 ------------------------------------ tests/unit/test_divertor.py | 215 ----------- 2 files changed, 901 deletions(-) diff --git a/process/divertor.py b/process/divertor.py index 02bac08915..3f9c52e551 100644 --- a/process/divertor.py +++ b/process/divertor.py @@ -61,692 +61,6 @@ def run(self, output: bool) -> None: ) return - # Scale geometric quantities - - # Perpendicular diffusivity in the plasma scrapeoff (m2/s) - # Assume ions transport 33% of electron power - - xperp = dv.xpertin * 1.33e0 - - # Reference null to strike distances - # Only set up for outer divertor for double-null - - # plsep = min(plsepo,pi*rminor) # Obscure reason to set a limit... - plsep = bv.plsepo - - # Scale plasma quantities - - delne = dv.prn1 * pv.dene * 1.0e-20 # scrapeoff density by main plasma - pwr = pv.pdivt # power flow to divertor (MW) - aionso = pv.m_fuel_amu # scrape-off layer ion mass - - # Divertor Zeff: either scaled or use input value - zeffso = (1.0e0 + 0.8e0 * (pv.zeff - 1.0e0)) if dv.divdum == 0 else dv.zeffdiv - - # Strike point field values - - bpstk = pv.bp * 0.45e0 - btstk = pv.bt * pv.rmajor / bv.rspo - rbpbt = bpstk / btstk - - # Parallel diffusivity in the plasma scrapeoff (m2/s) - - xpara = dv.xparain / zeffso - - # Null radius - - rnull = pv.rmajor - pv.rminor * pv.triang - - # Divertor area and radius ratio - - rsrd = (rnull + pv.rmajor + pv.rminor) / (rnull + bv.rspo) - diva = constants.pi * (rnull + bv.rspo) * plsep - adas = diva / pv.a_plasma_surface - - # Main plasma separatrix area to divertor (and power fraction) - # +PJK Is the 2 related to 2 divertors (i.e. double-null assumed)? - frgd = (pv.a_plasma_surface_outboard) / (2.0e0 * pv.a_plasma_surface) - # -PJK - # Power flow to divertor - - pdiv = pwr * dv.ksic / 2.0e0 - qdiv = pdiv / (pv.a_plasma_surface * frgd) - - # Connection length scalings - # (2.5 factor comes from normalization to ITER 1990) - - tconl = ( - 2.5e0 - * pv.rmajor - * pv.q95 - * (1.0e0 + 1.0e0 / (pv.q95 * pv.aspect) ** 2) ** 0.5 - ) - dtheta = plsep / pv.rminor - dconl = ( - 2.5e0 - * bv.rspo - * pv.q95 - * dtheta - * (1.0e0 + 1.0e0 / (pv.q95 * pv.aspect) ** 2) ** 0.5 - ) - rconl = dconl / tconl - - # Minimum strike angle - - minstang = 0.5e0 - - # Call divertor routine - - ( - delta, - delw, - dv.dendiv, - dv.densin, - gamdt, - dv.lamp, - omlarg, - dv.ppdiv, - dv.ppdivr, - dv.ptpdiv, - dv.tdiv, - dv.tsep, - ) = self.divert( - adas, - aionso, - dv.anginc, - delne, - dv.c1div, - dv.c2div, - dv.c3div, - dv.c4div, - dv.c5div, - dv.delld, - dv.fdfs, - dv.fififi, - frgd, - dv.frrp, - minstang, - dv.omegan, - qdiv, - pdiv, - rbpbt, - rconl, - pv.rmajor, - rsrd, - tconl, - xpara, - xperp, - ) - - # Heat load - - dv.hldiv = dv.ppdivr - - # Ratio of collision length to connection length - - dv.rlclolcn = 1.44e-3 * dv.tsep**2 / (delne * 15.0e0 * tconl) - - # output deleted as per discussion in #242. - # tnunn: 19/01/2022 - - def divert( - self, - adas, - m_ions_total_amu, - anginc, - delne, - c1div, - c2div, - c3div, - c4div, - c5div, - delld, - fdfs, - fififi, - frgd, - frrp, - minstang, - omegan, - qdiv, - pdiv, - rbpbt, - rconl, - rmaj, - rsrd, - tconl, - xpara, - xperp, - ): - """Harrison-Kukushkin analytic ITER divertor model - author: J Galambos, ORNL - author: P J Knight, CCFE, Culham Science Centre - - This subroutine performs the iteration described in M. Harrison's - and Kukushkin's analytic ITER divertor model. - Report ITER-IL-PH-13-9-e12 - - :param adas: divertor flux area / main plasma area (long separatrix) - :type adas: float - - :param m_ions_total_amu: ion mass (assumes fuel only) (AMU) - :type m_ions_total_amu: float - - - :param anginc: pol. angle of incidence of field line on plate (rad) - :type anginc: float - - :param c1div: fitting coefficient for plate temperature - :type c1div: float - - :param c2div: fitting coefficient for plate temperature - :type c2div: float - - :param c3div: fitting coefficient for heat load - :type c3div: float - - :param c4div: fitting coefficient for heat load - :type c4div: float - - :param c5div: fitting coefficient for 'omlarg' - :type c5div: float - - :param delld: coeff. for power distribution flow into scrapeoff - :type delld: float - - :param delne: scrapeoff density by main plasma (10**20 m-3) - :type delne: float - - :param fdfs: gradient ratio (private flux side/other side) in 'omlarg' - :type fdfs: float - - :param fififi: coeff. used in sheath energy transfer factor calc. - :type fififi: float - - :param frgd: separatrix area to divertor / total separatrix area - :type frgd: float - - :param frrp: fraction of radiated power to plate - :type frrp: float - - :param minstang: minimum strike angle (total) for heat flux calc. - :type minstang: float - - :param omegan: pressure ratio of (plate / main plasma) - :type omegan: float - - :param qdiv: heat flux across separatrix to divertor (MW/m2) - :type qdiv: float - - :param pdiv: power flow to plate (MW) - :type pdiv: float - - :param rbpbt: ratio of toroidal / poloidal field at strike point - :type rbpbt: float - - :param rconl: connection length ratio (divertor region/main plasma region) - :type rconl: float - - :param rmaj: major radius (m) - :type rmaj: float - - :param rsrd: ratio of separatrix radius / divertor radius - :type rsrd: float - - :param tconl: connection length along field line by main plasma (m) - :type tconl: float - - :param xpara: parallel diffusivity in the plasma scrapeoff (m2/s) - :type xpara: float - - :param xperp: perpend. diffusivity in the plasma scrapeoff (m2/s) - :type xperp: float - - :returns: - - delta (`float`) iteration relative error - - delw (`float`) energy flow thickness in scrape-off (m) - - dendiv (`float`) plasma density at divertor (10**20 m-3) - - densin (`float`) peak plasma density at divertor (on separatrix) (10**20 m-3) - - gamdt (`float`) plasma flow to plate (10**20/s) - - lamp (`float`) power flow width (m) - - omlarg (`float`) factor accounting for power flow to private flux region - - ppdiv (`float`) divertor heat load without radiation (MW/m2) - - ppdivr (`float`) divertor heat load with radiation (MW/m2) - - ptpdiv (`float`) peak plasma temperature at the divertor plate (eV) - - tdiv (`float`) temperature at the plate (eV) - - tsep (`float`) temperature at the separatrix (eV) - """ - - c27 = 0.2857143e0 - ei = 13.6e0 - epsilon = 0.001e0 - relerr = 1.0e-9 - - fprime = c5div * fdfs - facdenom = fprime * rsrd * (adas / frgd) ** 2 / rconl - facdenom = max(facdenom, 0.04e0) - omlarg = 1.0e0 / (rsrd * math.exp(-facdenom)) - omlarg = min(omlarg, 2.0e0) - coefl = 1.0e0 / delld + rconl / omlarg # little 'l' in Harrison model - - # Start iteration on 2 simultaneous equations (Newton's method) - - tdivges = 150.0e0 - tptsges = 0.9e0 - tdiv = tdivges - tpts = tptsges - - for _i in range(15): - # Find derivatives for Newton's method - - tptsp = tpts * (1.0e0 + epsilon) - deltx = tpts * epsilon - tdivp = tdiv * (1.0e0 + epsilon) - delty = tdiv * epsilon - - f1 = self.ftpts( - m_ions_total_amu, - coefl, - delne, - fififi, - omegan, - omlarg, - qdiv, - tconl, - xpara, - xperp, - tpts, - tdiv, - ) - f2 = self.ftdiv( - m_ions_total_amu, - coefl, - delne, - fififi, - omegan, - omlarg, - qdiv, - tconl, - xpara, - xperp, - tpts, - tdiv, - ) - - f1dx = ( - self.ftpts( - m_ions_total_amu, - coefl, - delne, - fififi, - omegan, - omlarg, - qdiv, - tconl, - xpara, - xperp, - tptsp, - tdiv, - ) - - f1 - ) / deltx - f1dy = ( - self.ftpts( - m_ions_total_amu, - coefl, - delne, - fififi, - omegan, - omlarg, - qdiv, - tconl, - xpara, - xperp, - tpts, - tdivp, - ) - - f1 - ) / delty - f2dx = ( - self.ftdiv( - m_ions_total_amu, - coefl, - delne, - fififi, - omegan, - omlarg, - qdiv, - tconl, - xpara, - xperp, - tptsp, - tdiv, - ) - - f2 - ) / deltx - f2dy = ( - self.ftdiv( - m_ions_total_amu, - coefl, - delne, - fififi, - omegan, - omlarg, - qdiv, - tconl, - xpara, - xperp, - tpts, - tdivp, - ) - - f2 - ) / delty - - denom = f1dx * f2dy - f1dy * f2dx - if denom == 0.0e0: - denom = 1.0e-10 - deltpts = (-f2dy * f1 + f1dy * f2) / denom - deltdiv = (f2dx * f1 - f1dx * f2) / denom - - # New guess - - tdiv = tdiv + deltdiv - tpts = tpts + deltpts - delta = abs(deltdiv / tdiv + deltpts / tpts) - - if delta < relerr: - break - - tdiv = max(tdiv, 0.1000e0) - tpts = max(tpts, 0.0010e0) - tpts = min(tpts, 0.9999e0) - - # Some other quantities - - ct = max(0.1e0, (c1div + c2div / (tdiv))) - ptpdiv = tdiv * ct - gamdiv = self.gammash(fififi, tdiv) # sheath coefficient - dendiv = delne / (omegan * tpts) - eier = self.erprcy( - tdiv, dendiv - ) # ionization + radiation energy / recycle event - - tsep = ( - 251.0e0 - * ( - (qdiv * tconl) ** 2 - / (c27 * xpara * (1.0e0 - tpts**3.5e0)) - * coefl - / (xperp * delne) - ) - ** 0.2222222e0 - ) - - cp = max(0.1e0, (c3div + c4div / (tdiv))) - angle = math.sin(anginc) * rbpbt - - if minstang != 0.0e0: - angle = max(angle, (minstang / 57.3e0)) - - ppdiv = ( - 2.48e2 - * (qdiv) ** 1.55556e0 - / (xperp * delne) ** 0.777778e0 - * (c27 * xpara) ** 0.2222222e0 - * tconl**0.555556e0 - * ((1.0e0 - tpts**3.5e0) / coefl) ** 0.222222e0 - / omlarg - * (1.0e0 + ei / (gamdiv * tdiv)) - / (1.0e0 + eier / (gamdiv * tdiv)) - * angle - * cp - ) - ppdivr = ppdiv * (1.0e0 + frrp * (eier - ei) / (gamdiv * tdiv)) - gamdt = 6.25e4 * ppdiv / (gamdiv * ptpdiv) - densin = omegan * tsep * delne / ptpdiv - delw = ( - 4.01e-3 - * (delne * xperp) ** 0.7777778e0 - * tconl**0.4444444e0 - * coefl**0.2222222e0 - / ( - (qdiv) ** 0.55555556e0 - * (c27 * xpara * (1.0e0 - tpts**3.5e0)) ** 0.22222e0 - ) - ) - lamp = pdiv * rsrd / (2.0e0 * constants.pi * rmaj * ppdiv) - - return ( - delta, - delw, - dendiv, - densin, - gamdt, - lamp, - omlarg, - ppdiv, - ppdivr, - ptpdiv, - tdiv, - tsep, - ) - - def erprcy(self, tdiv: float, ndiv: float) -> float: - """Function providing the (energy radiated + ionized) per neutral - recycle event from the Harrison / Kukushkin ITER model - author: J Galambos, ORNL - author: P J Knight, CCFE, Culham Science Centre - - - This function calculates the total energy (in eV) radiated and - ionized, per neutral recycle event, from the Harrison / Kukushkin - ITER model. - Report ITER-IL-PH-13-9-e12 - - :param tdiv: electron temperature at the plate (eV) - :type tdiv: float - - :param ndiv: electron density at the plate (10**20 m-3) - :type ndiv: float - - :returns: the total energy (in eV) radiated and ionized, per neutral recycle event, from the Harrison / Kukushkin ITER model. - :rtype: float - """ - - return max(17.5e0 + (5.0e0 + 37.5e0 / tdiv) * math.log10(10.0e0 / ndiv), 0.001) - - def ftdiv( - self, - m_ions_total_amu: float, - coefl: float, - delne: float, - fififi: float, - omegan: float, - omlarg: float, - qdiv: float, - tconl: float, - xpara: float, - xperp: float, - xx: float, - yy: float, - ) -> float: - """Function for divertor temperature solution - author: J Galambos, ORNL - author: P J Knight, CCFE, Culham Science Centre - - This function calculates an estimate for the divertor temperature (eV). - Report ITER-IL-PH-13-9-e12 - - :param m_ions_total_amu: ion mass (assumes fuel only) (AMU) - :type m_ions_total_amu: float - - :param coefl: little 'l' in Harrison model - :type coefl: float - - :param delne: scrapeoff density by main plasma (10**20 m-3) - :type delne: float - - :param fififi: coeff. used in sheath energy transfer factor calc. - :type fififi: float - - :param omegan: pressure ratio of (plate / main plasma) - :type omegan: float - - :param omlarg: factor accounting for power flow - :type omlarg: float - - :param qdiv: heat flux across separatrix to divertor (MW/m2) - :type qdiv: float - - :param tconl: connection length along field line by main plasma (m) - :type tconl: float - - :param xpara: parallel diffusivity in the plasma scrapeoff (m2/s) - :type xpara: float - - :param xperp: perpend. diffusivity in the plasma scrapeoff (m2/s) - :type xperp: float - - :param xx: T_plate / T_separatrix guess - :type xx: float - - :param yy: T_plate guess (eV) - :type yy: float - - :returns: an estimate for the divertor temperature (eV) - :rtype: float - """ - - c27 = 0.28571428e0 - - xxs = max(xx, 0.001e0) - xxs = min(xxs, 0.99999e0) - yys = max(yy, 0.1e0) - - dendiv = delne * omegan / xxs - gamdiv = self.gammash(fififi, yys) - eier = self.erprcy(yys, dendiv) - ff = ( - 20.16e0 - * m_ions_total_amu - * ( - (qdiv) ** 10 - * (c27 * xpara) ** 4 - / (xperp**5 * delne**14) - * tconl - * (1.0e0 - xxs**3.5e0) ** 4 - / coefl**4 - ) - ** 0.22222e0 - / (omegan * gamdiv * omlarg * (1.0e0 + eier / (gamdiv * yys))) ** 2 - ) - - return yys - ff - - def ftpts( - self, - m_ions_total_amu: float, - coefl: float, - delne: float, - fififi: float, - omegan: float, - omlarg: float, - qdiv: float, - tconl: float, - xpara: float, - xperp: float, - xx: float, - yy: float, - ) -> float: - """Function for divertor model temperature ratio solution - author: J Galambos, ORNL - author: P J Knight, CCFE, Culham Science Centre - - This function updates the divertor model temperature ratio solution. - Report ITER-IL-PH-13-9-e12 - - :param m_ions_total_amu: ion mass (assumes fuel only) (AMU) - :type m_ions_total_amu: float - - :param coefl: little 'l' in Harrison model - :type coefl: float - - :param delne: scrapeoff density by main plasma (10**20 m-3) - :type delne: float - - :param fififi: coeff. used in sheath energy transfer factor calc. - :type fififi: float - - :param omegan: pressure ratio of (plate / main plasma) - :type omegan: float - - :param omlarg: factor accounting for power flow - :type omlarg: float - - :param qdiv: heat flux across separatrix to divertor (MW/m2) - :type qdiv: float - - :param tconl: connection length along field line by main plasma (m) - :type tconl: float - - :param xpara: parallel diffusivity in the plasma scrapeoff (m2/s) - :type xpara: float - - :param xperp: perpend. diffusivity in the plasma scrapeoff (m2/s) - :type xperp: float - - :param xx: T_plate / T_separatrix guess - :type xx: float - - :param yy: T_plate guess (eV) - :type yy: float - - :returns: an estimate for the divertor temperature (eV) - :rtype: float - """ - - xxs = max(xx, 0.001e0) - xxs = min(xxs, 0.99999e0) - yys = max(yy, 0.1e0) - - dendiv = delne * omegan / xxs - gamdiv = self.gammash(fififi, yys) - eier = self.erprcy(yys, dendiv) - - ff = ( - xxs**3.5e0 - + 9.66e0 - * (xxs / m_ions_total_amu) ** 0.9e0 - * (xperp / (qdiv) ** 2) ** 0.8e0 - * coefl - / (2.0e0 * xpara / 7.0e0) - * tconl**0.2e0 - * (omlarg * omegan * gamdiv * (1.0e0 + eier / (gamdiv * yys))) ** 1.8e0 - * delne**2.6e0 - ) - - return 1.0e0 - ff - - def gammash(self, gcoef: float, tdiv: float) -> float: - """Function to provide the plasma sheath energy transfer coefficient - author: J Galambos, ORNL - author: P J Knight, CCFE, Culham Science Centre - - This function provides the plasma sheath energy transfer coefficient - from the Harrison / Kukushkin ITER model. - Report ITER-IL-PH-13-9-e12 - - :param gcoef: coefficient - :type gcoef: float - - :param tdiv: electron temperature at the plate (eV) - :type tdiv: float - - :returns: plasma sheath energy transfer coefficient - :rtype: float - """ - - return 8.3e0 - 6.0e0 * (0.07e0 - 0.18e0 * math.log10(3.0e0 * tdiv * gcoef)) - def divtart( self, rmajor: float, diff --git a/tests/unit/test_divertor.py b/tests/unit/test_divertor.py index 76a3e4558b..b44a027890 100644 --- a/tests/unit/test_divertor.py +++ b/tests/unit/test_divertor.py @@ -18,107 +18,6 @@ def divertor(): class TestDivertor: - def test_divert(self, divertor): - """Test the divert subroutine. - - Uses test data from the first call of this subroutine by baseline 2018. - - :param divertor: fixture containing an initialised `Divertor` object - :type divertor: tests.unit.test_divertor.divertor (functional fixture) - """ - adas = 0.052617908173833536 - m_ions_total_amu = 2.5 - anginc = 0.262 - c1div = 0.45 - c2div = -7 - c3div = 0.54 - c4div = -3.6 - c5div = 0.7 - delld = 1 - delne = 0.34294618459618942 - fdfs = 10 - fififi = 0.004 - frgd = 0.33822011777067068 - frrp = 0.4 - minstang = 0.5 - omegan = 1 - qdiv = 0.21095478076086721 - pdiv = 100.12226393133213 - rbpbt = 0.067124908423896915 - rconl = 0.48318885267795408 - rmaj = 8.8901 - rsrd = 1.2262681695075397 - tconl = 78.118065070110475 - xpara = 600 - xperp = 2.66 - - expected_delta = 1.9073843835398801e-12 - expected_delw = 0.021077486208183741 - expected_dendiv = 3.7696864807168677 - expected_densin = 19.136765450021365 - expected_gamdt = 6663.1765788767079 - expected_lamp = 0.51210900896428913 - expected_omlarg = 1.2535646368097362 - expected_ppdiv = 4.2920738515450783 - expected_ppdivr = 4.3475484299911091 - expected_ptpdiv = 5.4674204940995681 - expected_tdiv = 27.70537887577682 - expected_tsep = 305.08793598453673 - - ( - delta, - delw, - dendiv, - densin, - gamdt, - lamp, - omlarg, - ppdiv, - ppdivr, - ptpdiv, - tdiv, - tsep, - ) = divertor.divert( - adas, - m_ions_total_amu, - anginc, - delne, - c1div, - c2div, - c3div, - c4div, - c5div, - delld, - fdfs, - fififi, - frgd, - frrp, - minstang, - omegan, - qdiv, - pdiv, - rbpbt, - rconl, - rmaj, - rsrd, - tconl, - xpara, - xperp, - ) - - assert delta == pytest.approx(expected_delta) - assert delw == pytest.approx(expected_delw) - assert dendiv == pytest.approx(expected_dendiv) - assert densin == pytest.approx(expected_densin) - assert gamdt == pytest.approx(expected_gamdt) - assert lamp == pytest.approx(expected_lamp) - assert omlarg == pytest.approx(expected_omlarg) - assert ppdiv == pytest.approx(expected_ppdiv) - assert ppdivr == pytest.approx(expected_ppdivr) - assert ptpdiv == pytest.approx(expected_ptpdiv) - assert tdiv == pytest.approx(expected_tdiv) - assert tsep == pytest.approx(expected_tsep) - def test_divtart(self, monkeypatch, divertor): """Test the divtart subroutine. @@ -199,117 +98,3 @@ def test_divwade(self, monkeypatch, divertor): ) assert hldiv == pytest.approx(expected_hldiv) - - def test_erprcy(self, divertor): - """Test the erprcy subroutine. - - Uses test data from the first call of this subroutine by baseline 2018. - - :param divertor: fixture containing an initialised `Divertor` object - :type divertor: tests.unit.test_divertor.divertor (functional fixture) - """ - tdiv = 150 - ndiv = 0.38105131621798821 - - expected_erprcy = 24.949836803003997 - - erprcy = divertor.erprcy(tdiv, ndiv) - - assert erprcy == pytest.approx(expected_erprcy) - - def test_ftdiv(self, divertor): - """Test the ftdiv subroutine. - - Uses test data from the first call of this subroutine by baseline 2018. - - :param divertor: fixture containing an initialised `Divertor` object - :type divertor: tests.unit.test_divertor.divertor (functional fixture) - """ - m_ions_total_amu = 2.5 - coefl = 1.3854518853592164 - delne = 0.34294618459618942 - fififi = 0.0040000000000000001 - omegan = 1 - omlarg = 1.2535646368097362 - qdiv = 0.21095478076086721 - tconl = 78.118065070110475 - xpara = 600 - xperp = 2.6600000000000001 - xx = 0.90000000000000002 - yy = 150 - - expected_ftdiv = 140.7905577701393 - - ftdiv = divertor.ftdiv( - m_ions_total_amu, - coefl, - delne, - fififi, - omegan, - omlarg, - qdiv, - tconl, - xpara, - xperp, - xx, - yy, - ) - - assert ftdiv == pytest.approx(expected_ftdiv) - - def test_ftpts(self, divertor): - """Test the ftpts subroutine. - - Uses test data from the first call of this subroutine by baseline 2018. - - :param divertor: fixture containing an initialised `Divertor` object - :type divertor: tests.unit.test_divertor.divertor (functional fixture) - """ - m_ions_total_amu = 2.5 - coefl = 1.3854518853592164 - delne = 0.34294618459618942 - fififi = 0.0040000000000000001 - omegan = 1 - omlarg = 1.2535646368097362 - qdiv = 0.21095478076086721 - tconl = 78.118065070110475 - xpara = 600 - xperp = 2.6600000000000001 - xx = 0.90000000000000002 - yy = 150 - - expected_ftpts = -7.962899353691732 - - ftpts = divertor.ftpts( - m_ions_total_amu, - coefl, - delne, - fififi, - omegan, - omlarg, - qdiv, - tconl, - xpara, - xperp, - xx, - yy, - ) - - assert ftpts == pytest.approx(expected_ftpts) - - def test_gammash(self, divertor): - """Test the gammash subroutine. - - Uses test data from the first call of this subroutine by baseline 2018. - - :param divertor: fixture containing an initialised `Divertor` object - :type divertor: tests.unit.test_divertor.divertor (functional fixture) - """ - gcoef = 0.0040000000000000001 - tdiv = 150 - - expected_gammash = 8.155694305511572 - - gammash = divertor.gammash(gcoef, tdiv) - - assert gammash == pytest.approx(expected_gammash) From efb2bb298eacf1a101176a56d04a1064949b8fbc Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 1 Apr 2025 14:54:45 +0100 Subject: [PATCH 02/11] :fire: Remove unused output variable from divert function --- source/fortran/divertor_variables.f90 | 18 ------------------ tests/integration/ref_dicts.json | 18 ------------------ 2 files changed, 36 deletions(-) diff --git a/source/fortran/divertor_variables.f90 b/source/fortran/divertor_variables.f90 index c150eade29..d061831f6b 100644 --- a/source/fortran/divertor_variables.f90 +++ b/source/fortran/divertor_variables.f90 @@ -53,11 +53,7 @@ module divertor_variables real(dp) :: delld !! coeff for power distribution along main plasma - real(dp) :: dendiv - !! plasma density at divertor (10**20 /m3) - real(dp) :: densin - !! density at plate (on separatrix) (10**20 /m3) real(dp) :: divclfr !! divertor coolant fraction @@ -119,8 +115,6 @@ module divertor_variables real(dp) :: ksic !! power fraction for outboard double-null scrape-off plasma - real(dp) :: lamp - !! power flow width (m) real(dp) :: minstang !! minimum strike angle for heat flux calculation @@ -131,14 +125,10 @@ module divertor_variables real(dp) :: omlarg !! power spillage to private flux factor - real(dp) :: ppdivr - !! peak heat load at plate (with radiation) (MW/m2) real(dp) :: prn1 !! n-scrape-off / n-average plasma; (input for `ipedestal=0`, = nesep/dene if `ipedestal>=1`) - real(dp) :: ptpdiv - !! peak temperature at the plate (eV) real(dp) :: rconl !! connection length ratio, outboard side @@ -158,8 +148,6 @@ module divertor_variables real(dp) :: tdiv !! temperature at divertor (eV) (input for stellarator only, calculated for tokamaks) - real(dp) :: tsep - !! temperature at the separatrix (eV) real(dp) :: xparain !! parallel heat transport coefficient (m2/s) @@ -189,8 +177,6 @@ subroutine init_divertor_variables c5div = 0.7D0 c6div = 0.0D0 delld = 1.0D0 - dendiv = 0.0D0 - densin = 0.0D0 divclfr = 0.3D0 divdens = 1.0D4 divdum = 0 @@ -208,20 +194,16 @@ subroutine init_divertor_variables i_hldiv = 0 hldivlim = 5.0D0 ksic = 0.8D0 - lamp = 0.0D0 minstang = 0.0D0 omegan = 1.0D0 omlarg = 0.0D0 - ppdivr = 0.0D0 prn1 = 0.285D0 - ptpdiv = 0.0D0 rconl = 0.0D0 rlclolcn = 0.0D0 rlenmax = 0.5D0 rsrd = 0.0D0 tconl = 0.0D0 tdiv = 2.0D0 - tsep = 0.0D0 xparain = 2.1D3 xpertin = 2.0D0 zeffdiv = 1.0D0 diff --git a/tests/integration/ref_dicts.json b/tests/integration/ref_dicts.json index b4e902fdd7..260e024339 100644 --- a/tests/integration/ref_dicts.json +++ b/tests/integration/ref_dicts.json @@ -1619,14 +1619,12 @@ "delta": null, "delta_eta": 0.0, "delta_var": null, - "dendiv": 0.0, "dene": 9.8e+19, "denh2o": 985.0, "denhe": 5.4, "nd_fuel_ions": 0.0, "denpbli": 9839.0, "densbreed": 0.0, - "densin": 0.0, "denstl": 7800.0, "denwc": 15630.0, "dewmkg": 0.0, @@ -3198,7 +3196,6 @@ "lambda_q_VV": 6.92, "lambda_q_omp": 0.002, "lambdaio": 0.0, - "lamp": 0.0, "latentheat": 2257000.0, "layer_ins": 0.0, "lb": null, @@ -3597,7 +3594,6 @@ "fusion_power": 0.0, "p_cs_resistive_flat_top": 0.0, "p_pf_coil_resistive_total_flat_top": 0.0, - "ppdivr": 0.0, "len_plasma_poloidal": 0.0, "ppump": 0.0, "ppumpmw": 0.0, @@ -3673,7 +3669,6 @@ 0.0, 0.0 ], - "ptpdiv": 0.0, "p_electron_transport_loss_mw": 0.0, "pden_electron_transport_loss_mw": 0.0, "p_ion_transport_loss_mw": 0.0, @@ -7638,7 +7633,6 @@ "trithtmw": 15.0, "tritprate": 0.0, "triv": 40000.0, - "tsep": 0.0, "ttarget": 5.0, "tturb": 0.0, "turbine_hall_h": 15.0, @@ -9268,14 +9262,12 @@ "delta": "", "delta_eta": "", "delta_var": "", - "dendiv": "plasma density at divertor (10**20 /m3)", "dene": "electron density (/m3) (`iteration variable 6`) (calculated if `ipedestal=3`)", "denh2o": "density of water (kg/m3)", "denhe": "", "nd_fuel_ions": "fuel ion density (/m3)", "denpbli": "", "densbreed": "density of breeder material (kg/m3) (`i_blanket_type=2` (KIT HCPB))", - "densin": "density at plate (on separatrix) (10**20 /m3)", "denstl": "density of steel (kg/m3)", "denwc": "density of tungsten carbide (kg/m3)", "dewmkg": "total mass of vacuum vessel + cryostat (kg) (calculated if blktmodel>0)", @@ -9970,7 +9962,6 @@ "lambda_q_VV": "Decay length in Vacuum Vessel [cm]", "lambda_q_omp": "SOL power fall-off length at the outer midplane, perpendicular to field [m]", "lambdaio": "", - "lamp": "power flow width (m)", "latentheat": "latent heat of vaporization (J/kg)\n for simplicity, set to static value applicable at 1 atm (100 kPa) air pressure", "layer_ins": "Additional insulation thickness between layers (m)", "lb": "", @@ -10346,7 +10337,6 @@ "fusion_power": "fusion power (MW)", "p_cs_resistive_flat_top": "central solenoid resistive power during flattop (W)", "p_pf_coil_resistive_total_flat_top": "total PF coil resistive losses during flattop (W)", - "ppdivr": "peak heat load at plate (with radiation) (MW/m2)", "len_plasma_poloidal": "plasma poloidal perimeter (m)", "ppump": "centrepost coolant pump power (W)", "ppumpmw": "", @@ -10400,7 +10390,6 @@ "pthermmw": "High-grade heat useful for electric production (MW)", "pthermshld": "", "l_h_threshold_powers": "L-H power threshold for various scalings (MW)\n", - "ptpdiv": "peak temperature at the plate (eV)", "p_electron_transport_loss_mw": "electron transport power (MW)", "pden_electron_transport_loss_mw": "electron transport power per volume (MW/m3)", "p_ion_transport_loss_mw": "ion transport power (MW)", @@ -10866,7 +10855,6 @@ "trithtmw": "power required for tritium processing (MW)", "tritprate": "tritium production rate (g/day) (`i_blanket_type=2` (KIT HCPB))", "triv": "volume of tritium, fuel handling and health physics buildings (m3)", - "tsep": "temperature at the separatrix (eV)", "ttarget": "Plasma temperature adjacent to divertor sheath [eV] (`iteration variable 120`)\n Rem : 5 eV is the current limit for tungsten sputtering from argon impurity", "tturb": "coolant temperature at turbine inlet (K) (`i_thermal_electric_conversion = 3,4`)", "turbine_hall_h": "turbine hall length, width, height (m)", @@ -17885,8 +17873,6 @@ "c5div", "c6div", "delld", - "dendiv", - "densin", "divclfr", "divdens", "divdum", @@ -17902,20 +17888,16 @@ "hldiv", "hldivlim", "ksic", - "lamp", "minstang", "omegan", "omlarg", - "ppdivr", "prn1", - "ptpdiv", "rconl", "rlclolcn", "rlenmax", "rsrd", "tconl", "tdiv", - "tsep", "xparain", "xpertin", "zeffdiv" From 3aa2118ff9edd6da08b452b33ff0ddb813475db6 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 1 Apr 2025 15:01:30 +0100 Subject: [PATCH 03/11] :fire: Remove unused divert function input variables --- process/input.py | 11 --- source/fortran/divertor_variables.f90 | 43 --------- tests/integration/ref_dicts.json | 88 ------------------- .../input_files/st_regression.IN.DAT | 24 ----- 4 files changed, 166 deletions(-) diff --git a/process/input.py b/process/input.py index bfdcee41c7..7b829db1e3 100644 --- a/process/input.py +++ b/process/input.py @@ -236,12 +236,6 @@ def __post_init__(self): "bz_channel_conduct_liq": InputVariable( fortran.fwbs_variables, float, range=(1e-06, 1000000.0) ), - "c1div": InputVariable(fortran.divertor_variables, float, range=(-100.0, 100.0)), - "c2div": InputVariable(fortran.divertor_variables, float, range=(-100.0, 100.0)), - "c3div": InputVariable(fortran.divertor_variables, float, range=(-100.0, 100.0)), - "c4div": InputVariable(fortran.divertor_variables, float, range=(-100.0, 100.0)), - "c5div": InputVariable(fortran.divertor_variables, float, range=(-100.0, 100.0)), - "c6div": InputVariable(fortran.divertor_variables, float, range=(-100.0, 100.0)), "casthi": InputVariable(fortran.tfcoil_variables, float, range=(0.0, 1.0)), "casthi_fraction": InputVariable(fortran.tfcoil_variables, float, range=(0.0, 1.0)), "casths": InputVariable(fortran.tfcoil_variables, float, range=(0.0, 1.0)), @@ -359,7 +353,6 @@ def __post_init__(self): "declfw": InputVariable(fortran.fwbs_variables, float, range=(0.01, 0.2)), "declshld": InputVariable(fortran.fwbs_variables, float, range=(0.01, 0.2)), "decomf": InputVariable(fortran.cost_variables, float, range=(0.0, 1.0)), - "delld": InputVariable(fortran.divertor_variables, float, range=(0.1, 2.0)), "denstl": InputVariable(fortran.fwbs_variables, float, range=(5000.0, 10000.0)), "dhecoil": InputVariable(fortran.tfcoil_variables, float, range=(0.0, 0.1)), "dintrt": InputVariable(fortran.cost_variables, float, range=(0.0, 0.1)), @@ -590,7 +583,6 @@ def __post_init__(self): "fcupfsu": InputVariable(fortran.pfcoil_variables, float, range=(0.0, 1.0)), "fcutfsu": InputVariable(fortran.tfcoil_variables, float, range=(0.0, 1.0)), "fdene": InputVariable(fortran.constraint_variables, float, range=(0.001, 10.0)), - "fdfs": InputVariable(fortran.divertor_variables, float, range=(0.0, 20.0)), "f_ster_div_single": InputVariable(fortran.fwbs_variables, float, range=(0.0, 1.0)), "fdiva": InputVariable(fortran.divertor_variables, float, range=(0.1, 2.0)), "fdivcol": InputVariable(fortran.constraint_variables, float, range=(0.001, 10.0)), @@ -607,7 +599,6 @@ def __post_init__(self): "fhldiv": InputVariable(fortran.constraint_variables, float, range=(0.001, 10.0)), "fhole": InputVariable(fortran.fwbs_variables, float, range=(0.0, 1.0)), "fhts": InputVariable(fortran.tfcoil_variables, float, range=(0.01, 1.0)), - "fififi": InputVariable(fortran.divertor_variables, float, range=(1e-06, 1.0)), "fiooic": InputVariable(fortran.constraint_variables, float, range=(0.001, 10.0)), "fipir": InputVariable(fortran.constraint_variables, float, range=(0.001, 10.0)), "fjohc": InputVariable(fortran.constraint_variables, float, range=(0.001, 10.0)), @@ -683,7 +674,6 @@ def __post_init__(self): "frholeg": InputVariable(fortran.tfcoil_variables, float, range=(0.01, 5.0)), "frminor": InputVariable(fortran.constraint_variables, float, range=(0.001, 10.0)), "frrmax": InputVariable(fortran.ife_variables, float, range=(1e-06, 1.0)), - "frrp": InputVariable(fortran.divertor_variables, float, range=(0.0, 1.0)), "fseppc": InputVariable( fortran.build_variables, float, range=(1000000.0, 1000000000.0) ), @@ -936,7 +926,6 @@ def __post_init__(self): "f_z_cs_tf_internal": InputVariable( fortran.pfcoil_variables, float, range=(0.0, 2.0) ), - "omegan": InputVariable(fortran.divertor_variables, float, range=(0.1, 10.0)), "outgasfactor": InputVariable( fortran.vacuum_variables, float, range=(1e-06, 1000.0) ), diff --git a/source/fortran/divertor_variables.f90 b/source/fortran/divertor_variables.f90 index d061831f6b..f6287ca718 100644 --- a/source/fortran/divertor_variables.f90 +++ b/source/fortran/divertor_variables.f90 @@ -32,26 +32,7 @@ module divertor_variables real(dp) :: bpsout !! reference B_p at outboard divertor strike point (T) - real(dp) :: c1div - !! fitting coefficient to adjust ptpdiv, ppdiv - real(dp) :: c2div - !! fitting coefficient to adjust ptpdiv, ppdiv - - real(dp) :: c3div - !! fitting coefficient to adjust ptpdiv, ppdiv - - real(dp) :: c4div - !! fitting coefficient to adjust ptpdiv, ppdiv - - real(dp) :: c5div - !! fitting coefficient to adjust ptpdiv, ppdiv - - real(dp) :: c6div - !! fitting coefficient to adjust ptpdiv, ppdiv - - real(dp) :: delld - !! coeff for power distribution along main plasma @@ -80,25 +61,15 @@ module divertor_variables real(dp) :: divsur !! divertor surface area (m2) - real(dp) :: fdfs - !! radial gradient ratio - real(dp) :: fdiva !! divertor area fudge factor (for ITER, Sept 1990) real(dp) :: fhout !! fraction of power to outboard divertor (for single null) - real(dp) :: fififi - !! coefficient for gamdiv - !#TODO: what the hell is this variable name... - real(dp) :: flux_exp !! The plasma flux expansion in the divertor (default 2; Wade 2020) - real(dp) :: frrp - !! fraction of radiated power to plate - real(dp) :: hldiv !! divertor heat load (MW/m2) @@ -119,9 +90,6 @@ module divertor_variables real(dp) :: minstang !! minimum strike angle for heat flux calculation - real(dp) :: omegan - !! pressure ratio (nT)_plasma / (nT)_scrape-off - real(dp) :: omlarg !! power spillage to private flux factor @@ -170,13 +138,6 @@ subroutine init_divertor_variables betai = 1.0D0 betao = 1.0D0 bpsout = 0.60D0 - c1div = 0.45D0 - c2div = -7.0D0 - c3div = 0.54D0 - c4div = -3.6D0 - c5div = 0.7D0 - c6div = 0.0D0 - delld = 1.0D0 divclfr = 0.3D0 divdens = 1.0D4 divdum = 0 @@ -184,18 +145,14 @@ subroutine init_divertor_variables divmas = 0.0D0 divplt = 0.035D0 divsur = 0.0D0 - fdfs = 10.0D0 fdiva = 1.11D0 fhout = 0.0D0 - fififi = 4.0D-3 flux_exp = 2.0D0 - frrp = 0.4D0 hldiv = 0.0D0 i_hldiv = 0 hldivlim = 5.0D0 ksic = 0.8D0 minstang = 0.0D0 - omegan = 1.0D0 omlarg = 0.0D0 prn1 = 0.285D0 rconl = 0.0D0 diff --git a/tests/integration/ref_dicts.json b/tests/integration/ref_dicts.json index 260e024339..b470c2e99c 100644 --- a/tests/integration/ref_dicts.json +++ b/tests/integration/ref_dicts.json @@ -1178,7 +1178,6 @@ "len_blkt_inboard_channel_total": 0.0, "len_blkt_outboard_channel_total": 0.0, "c": "2.99792458e10_rkind", - "c1div": 0.45, "c21": 0.0, "c211": 0.0, "c212": 0.0, @@ -1271,11 +1270,6 @@ "c245": 0.0, "c25": 0.0, "c26": 0.0, - "c2div": -7.0, - "c3div": 0.54, - "c4div": -3.6, - "c5div": 0.7, - "c6div": 0.0, "c_": 299792500.0, "calpha": null, "capcost": 0.0, @@ -1615,7 +1609,6 @@ "deflect": 0.0, "degrad": 0.01745329251, "degree": "pi/180.0D0", - "delld": 1.0, "delta": null, "delta_eta": 0.0, "delta_var": null, @@ -1905,7 +1898,6 @@ "fcwr": 1.0, "fdene": 1.0, "f_deuterium": 0.5, - "fdfs": 10.0, "fdiags": [ "FLT_DEFAULT", "FLT_DEFAULT", @@ -1940,7 +1932,6 @@ "fhole": 0.0, "fhout": 0.0, "fhts": 0.5, - "fififi": 0.004, "figmer": 0.0, "fileprefix": "", "fimp": [ @@ -2029,7 +2020,6 @@ "frholeg": 1.0, "frminor": 1.0, "frrmax": 1.0, - "frrp": 0.4, "fseppc": 350000000.0, "fstr_wp": 1.0, "fstrcase": 1.0, @@ -3445,7 +3435,6 @@ "dr_cs": 0.811, "f_z_cs_tf_internal": 0.71, "om": null, - "omegan": 1.0, "omlarg": 0.0, "one": 1.0, "opt_file": 15.0, @@ -8956,7 +8945,6 @@ "len_blkt_inboard_channel_total": "Inboard/outboard blanket flow lengths (m)", "len_blkt_outboard_channel_total": "Inboard/outboard blanket flow lengths (m)", "c": "", - "c1div": "fitting coefficient to adjust ptpdiv, ppdiv", "c21": "", "c211": "", "c212": "", @@ -9049,11 +9037,6 @@ "c245": "", "c25": "", "c26": "", - "c2div": "fitting coefficient to adjust ptpdiv, ppdiv", - "c3div": "fitting coefficient to adjust ptpdiv, ppdiv", - "c4div": "fitting coefficient to adjust ptpdiv, ppdiv", - "c5div": "fitting coefficient to adjust ptpdiv, ppdiv", - "c6div": "fitting coefficient to adjust ptpdiv, ppdiv", "c_": "", "calpha": "", "capcost": "total capital cost including interest (M$)", @@ -9258,7 +9241,6 @@ "deflect": "TF coil radial deflection (displacement) radial distribution [m]", "degrad": "degrees to radians, = pi/180", "degree": "", - "delld": "coeff for power distribution along main plasma", "delta": "", "delta_eta": "", "delta_var": "", @@ -9512,7 +9494,6 @@ "fcwr": "f-value for conducting wall radius / rminor limit\n (`constraint equation 23`, `iteration variable 104`)", "fdene": "f-value for density limit (`constraint equation 5`, `iteration variable 9`)\n (invalid if `ipedestal=3`)", "f_deuterium": "deuterium fuel fraction", - "fdfs": "radial gradient ratio", "fdiags": "", "f_ster_div_single": "Solid angle fraction taken by one divertor", "fdiva": "divertor area fudge factor (for ITER, Sept 1990)", @@ -9538,7 +9519,6 @@ "fhole": "area fraction taken up by other holes (IFE)", "fhout": "fraction of power to outboard divertor (for single null)", "fhts": "technology adjustment factor for critical current density fit for isumat..=2\n Bi-2212 superconductor, to describe the level of technology assumed (i.e. to\n account for stress, fatigue, radiation, AC losses, joints or manufacturing\n variations; 1.0 would be very optimistic)", - "fififi": "coefficient for gamdiv", "figmer": "physics figure of merit (= plasma_currentaspect*sbar, where `sbar=1`)", "fileprefix": "input file prefix", "fimp": "", @@ -9612,7 +9592,6 @@ "frholeg": "Ouboard legs resistivity enhancement factor. Only used for `itart=1`.", "frminor": "f-value for minor radius limit (`constraint equation 21`, `iteration variable 32`)", "frrmax": "f-value for maximum IFE repetition rate (`constraint equation 50`, `iteration variable 86`)", - "frrp": "fraction of radiated power to plate", "fseppc": "Separation force in CS coil pre-compression structure", "fstr_wp": "f-value for maxiumum TF coil strain absolute value\n (`constraint equation 88`, `iteration variable 165`)", "fstrcase": "f-value for maximum TF coil case Tresca yield criterion\n (`constraint equation 31`, `iteration variable 48`)", @@ -10195,7 +10174,6 @@ "dr_cs": "Central solenoid thickness (m) (`iteration variable 16`)", "f_z_cs_tf_internal": "Central solenoid height / TF coil internal height", "om": "", - "omegan": "pressure ratio (nT)_plasma / (nT)_scrape-off", "omlarg": "power spillage to private flux factor", "one": "", "opt_file": "Optimisation information output file number", @@ -11775,30 +11753,6 @@ "lb": 0.0, "ub": 30.0 }, - "c1div": { - "lb": -100.0, - "ub": 100.0 - }, - "c2div": { - "lb": -100.0, - "ub": 100.0 - }, - "c3div": { - "lb": -100.0, - "ub": 100.0 - }, - "c4div": { - "lb": -100.0, - "ub": 100.0 - }, - "c5div": { - "lb": -100.0, - "ub": 100.0 - }, - "c6div": { - "lb": -100.0, - "ub": 100.0 - }, "cable_helium_fraction": { "lb": 0.215, "ub": 0.99 @@ -12155,10 +12109,6 @@ "lb": 0.0, "ub": 1.0 }, - "delld": { - "lb": 0.1, - "ub": 2.0 - }, "dene": { "lb": 1e+18, "ub": 1e+22 @@ -12591,10 +12541,6 @@ "lb": 0.0, "ub": 1.0 }, - "fdfs": { - "lb": 0.0, - "ub": 20.0 - }, "f_ster_div_single": { "lb": 0.0, "ub": 1.0 @@ -12667,10 +12613,6 @@ "lb": 0.01, "ub": 1.0 }, - "fififi": { - "lb": 1e-06, - "ub": 1.0 - }, "fiooic": { "lb": 0.001, "ub": 10.0 @@ -12851,10 +12793,6 @@ "lb": 1e-06, "ub": 1.0 }, - "frrp": { - "lb": 0.0, - "ub": 1.0 - }, "fseppc": { "lb": 1000000.0, "ub": 1000000000.0 @@ -13799,10 +13737,6 @@ "lb": 0.0, "ub": 2.0 }, - "omegan": { - "lb": 0.1, - "ub": 10.0 - }, "outgasfactor": { "lb": 1e-06, "ub": 1000.0 @@ -17866,13 +17800,6 @@ "betai", "betao", "bpsout", - "c1div", - "c2div", - "c3div", - "c4div", - "c5div", - "c6div", - "delld", "divclfr", "divdens", "divdum", @@ -17880,16 +17807,12 @@ "divmas", "divplt", "divsur", - "fdfs", "fdiva", "fhout", - "fififi", - "frrp", "hldiv", "hldivlim", "ksic", "minstang", - "omegan", "omlarg", "prn1", "rconl", @@ -20010,12 +19933,6 @@ "breedmat": "int_variable", "bootstrap_current_fraction_max": "real_variable", "bt": "real_variable", - "c1div": "real_variable", - "c2div": "real_variable", - "c3div": "real_variable", - "c4div": "real_variable", - "c5div": "real_variable", - "c6div": "real_variable", "cable_helium_fraction": "real_variable", "casthi": "real_variable", "casthi_fraction": "real_variable", @@ -20111,7 +20028,6 @@ "declfw": "real_variable", "declshld": "real_variable", "decomf": "real_variable", - "delld": "real_variable", "dene": "real_variable", "denstl": "real_variable", "dhecoil": "real_variable", @@ -20221,7 +20137,6 @@ "fcwr": "real_variable", "fdene": "real_variable", "f_deuterium": "real_variable", - "fdfs": "real_variable", "f_ster_div_single": "real_variable", "fdiva": "real_variable", "fdivcol": "real_variable", @@ -20240,7 +20155,6 @@ "fhldiv": "real_variable", "fhole": "real_variable", "fhts": "real_variable", - "fififi": "real_variable", "fimp": "real_array", "fiooic": "real_variable", "fipir": "real_variable", @@ -20286,7 +20200,6 @@ "frholeg": "real_variable", "frminor": "real_variable", "frrmax": "real_variable", - "frrp": "real_variable", "fseppc": "real_variable", "fstr_wp": "real_variable", "fstrcase": "real_variable", @@ -20541,7 +20454,6 @@ "f_a_cs_steel": "real_variable", "dr_cs": "real_variable", "f_z_cs_tf_internal": "real_variable", - "omegan": "real_variable", "outgasfactor": "real_variable", "outgasindex": "real_variable", "temp_blkt_coolant_out": "real_variable", diff --git a/tests/regression/input_files/st_regression.IN.DAT b/tests/regression/input_files/st_regression.IN.DAT index 6862e1ceca..5432afe228 100644 --- a/tests/regression/input_files/st_regression.IN.DAT +++ b/tests/regression/input_files/st_regression.IN.DAT @@ -837,14 +837,6 @@ boundu(97) = 1.0 * DESCRIPTION: Angle of incidence of field line on plate (rad) (default = 0.262) * JUSTIFICATION: Not yet set -*c1div- c6div = -* DESCRIPTION: Divertor model fitting coefficients -* JUSTIFICATION: Leaving as default - -*delld = -* DESCRIPTION: Coeff for power distribution along main plasma (default = 1.0) -* JUSTIFICATION: Leaving as default - *divdum = * DESCRIPTION: switch for divertor Zeff model: (default = 0) * =0 calc @@ -855,30 +847,14 @@ boundu(97) = 1.0 * DESCRIPTION: Zeff in the divertor region (if `divdum/=0`) (default = 1.0) * JUSTIFICATION: Not yet set -*fdfs = -* DESCRIPTION: Radial gradient ratio (default = 10.0) -* JUSTIFICATION: Not yet set - -*fififi = -* DESCRIPTION: Coefficient for gamdiv (default = 4.0D-3) -* JUSTIFICATION: Not yet set - *flux_exp = * DESCRIPTION: The plasma flux expansion in the divertor (default 2; Wade 2020) * JUSTIFICATION: Not yet set -*frrp = -* DESCRIPTION: Fraction of radiated power to plate (default = 0.4) -* JUSTIFICATION: Not yet set - *ksic = * DESCRIPTION: Power fraction for outboard double-null scrape-off plasma (default = 0.8) * JUSTIFICATION: Not yet set -*omegan = -* DESCRIPTION: Pressure ratio (nT)_plasma / (nT)_scrape-off (default = 1.0) -* JUSTIFICATION: Not yet set - *prn1 = * DESCRIPTION: n-scrape-off / n-average plasma; (input for `ipedestal=0`, = nesep/dene if `ipedestal==1`) (default = 0.285) * JUSTIFICATION: Not yet set From 73ae4a78a49df9d72fd18912a50631aabcab3dce Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 1 Apr 2025 15:51:52 +0100 Subject: [PATCH 04/11] :fire: Remove other unused divertor parameters --- process/input.py | 5 -- source/fortran/divertor_variables.f90 | 47 --------------- tests/integration/ref_dicts.json | 58 ------------------- tests/regression/input_files/helias_5b.IN.DAT | 2 - .../input_files/st_regression.IN.DAT | 18 ------ .../stellarator_helias_once_through.IN.DAT | 2 - 6 files changed, 132 deletions(-) diff --git a/process/input.py b/process/input.py index 7b829db1e3..777497a2ef 100644 --- a/process/input.py +++ b/process/input.py @@ -228,7 +228,6 @@ def __post_init__(self): "bootstrap_current_fraction_max": InputVariable( fortran.current_drive_variables, float, range=(-0.999, 0.999) ), - "bpsout": InputVariable(fortran.divertor_variables, float, range=(0.0, 10.0)), "breeder_f": InputVariable(fortran.fwbs_variables, float, range=(0.0, 1.0)), "breeder_multiplier": InputVariable( fortran.fwbs_variables, float, range=(0.0, 1.0) @@ -831,7 +830,6 @@ def __post_init__(self): ), "kappa": InputVariable(fortran.physics_variables, float, range=(0.99, 5.0)), "kappa95": InputVariable(fortran.physics_variables, float, range=(0.99, 5.0)), - "ksic": InputVariable(fortran.divertor_variables, float, range=(0.0, 2.0)), "layer_ins": InputVariable(fortran.tfcoil_variables, float, range=(0.0, 0.1)), "ld_ratio_cst": InputVariable(fortran.pfcoil_variables, float, range=(0.0, 5.0)), "len_fw_channel": InputVariable( @@ -1418,9 +1416,7 @@ def __post_init__(self): ), "wsvfac": InputVariable(fortran.buildings_variables, float, range=(0.9, 3.0)), "xi_ebw": InputVariable(fortran.current_drive_variables, float, range=(0.0, 1.0)), - "xparain": InputVariable(fortran.divertor_variables, float, range=(0.01, 10000.0)), "xpertin": InputVariable(fortran.divertor_variables, float, range=(0.0, 10.0)), - "zeffdiv": InputVariable(fortran.divertor_variables, float, range=(0.01, 100.0)), "zeffmax": InputVariable(fortran.constraint_variables, float, range=(1.0, 10.0)), "blktmodel": InputVariable(fortran.fwbs_variables, int, choices=[0, 1]), "blkttype": InputVariable(fortran.fwbs_variables, int, choices=[1, 2, 3]), @@ -1433,7 +1429,6 @@ def __post_init__(self): fortran.rebco_variables, float, range=(1.0e6, 1.0e10) ), "cost_model": InputVariable(fortran.cost_variables, int, choices=[0, 1]), - "divdum": InputVariable(fortran.divertor_variables, int, choices=[0, 1]), "dwell_pump": InputVariable(fortran.vacuum_variables, int, choices=[0, 1, 2]), "i_fw_blkt_vv_shape": InputVariable(fortran.fwbs_variables, int, range=(1, 2)), "hcdportsize": InputVariable(fortran.fwbs_variables, int, range=(1, 2)), diff --git a/source/fortran/divertor_variables.f90 b/source/fortran/divertor_variables.f90 index f6287ca718..09ba6d7a21 100644 --- a/source/fortran/divertor_variables.f90 +++ b/source/fortran/divertor_variables.f90 @@ -14,9 +14,6 @@ module divertor_variables public - real(dp) :: adas - !! area divertor / area main plasma (along separatrix) - real(dp) :: anginc !! angle of incidence of field line on plate (rad) @@ -29,26 +26,12 @@ module divertor_variables real(dp) :: betao !! poloidal plane angle between divertor plate and leg, outboard (rad) - real(dp) :: bpsout - !! reference B_p at outboard divertor strike point (T) - - - - - real(dp) :: divclfr !! divertor coolant fraction real(dp) :: divdens !! divertor structure density (kg/m3) - integer :: divdum - !! switch for divertor Zeff model: - !! - !! - =0 calc - !! - =1 input - !#TODO: switch name should be changed to i_ - real(dp) :: dz_divertor !! divertor structure vertical thickness (m) @@ -64,9 +47,6 @@ module divertor_variables real(dp) :: fdiva !! divertor area fudge factor (for ITER, Sept 1990) - real(dp) :: fhout - !! fraction of power to outboard divertor (for single null) - real(dp) :: flux_exp !! The plasma flux expansion in the divertor (default 2; Wade 2020) @@ -83,17 +63,6 @@ module divertor_variables real(dp) :: hldivlim !! heat load limit (MW/m2) - real(dp) :: ksic - !! power fraction for outboard double-null scrape-off plasma - - - real(dp) :: minstang - !! minimum strike angle for heat flux calculation - - real(dp) :: omlarg - !! power spillage to private flux factor - - real(dp) :: prn1 !! n-scrape-off / n-average plasma; (input for `ipedestal=0`, = nesep/dene if `ipedestal>=1`) @@ -116,44 +85,30 @@ module divertor_variables real(dp) :: tdiv !! temperature at divertor (eV) (input for stellarator only, calculated for tokamaks) - - real(dp) :: xparain - !! parallel heat transport coefficient (m2/s) - real(dp) :: xpertin !! perpendicular heat transport coefficient (m2/s) - real(dp) :: zeffdiv - !! Zeff in the divertor region (if `divdum/=0`) - contains subroutine init_divertor_variables !! Initialise divertor_variables implicit none - adas = 0.0D0 anginc = 0.262D0 beta_div = 1.0D0 betai = 1.0D0 betao = 1.0D0 - bpsout = 0.60D0 divclfr = 0.3D0 divdens = 1.0D4 - divdum = 0 dz_divertor = 0.2D0 divmas = 0.0D0 divplt = 0.035D0 divsur = 0.0D0 fdiva = 1.11D0 - fhout = 0.0D0 flux_exp = 2.0D0 hldiv = 0.0D0 i_hldiv = 0 hldivlim = 5.0D0 - ksic = 0.8D0 - minstang = 0.0D0 - omlarg = 0.0D0 prn1 = 0.285D0 rconl = 0.0D0 rlclolcn = 0.0D0 @@ -161,8 +116,6 @@ subroutine init_divertor_variables rsrd = 0.0D0 tconl = 0.0D0 tdiv = 2.0D0 - xparain = 2.1D3 xpertin = 2.0D0 - zeffdiv = 1.0D0 end subroutine init_divertor_variables end module divertor_variables diff --git a/tests/integration/ref_dicts.json b/tests/integration/ref_dicts.json index b470c2e99c..2057d4f647 100644 --- a/tests/integration/ref_dicts.json +++ b/tests/integration/ref_dicts.json @@ -209,7 +209,6 @@ ".false.", ".false." ], - "adas": 0.0, "adivflnc": 7.0, "adj_appr": [ "", @@ -1152,7 +1151,6 @@ 0.0, 0.0 ], - "bpsout": 0.6, "breeder": "'Orthosilicate'", "breeder_f": 0.5, "breeder_multiplier": 0.75, @@ -1637,7 +1635,6 @@ "divclfr": 0.3, "divcst": 0.0, "divdens": 10000.0, - "divdum": 0.0, "dz_divertor": 0.2, "divlife": 0.0, "divmas": 0.0, @@ -1930,7 +1927,6 @@ "f_helium3": 0.0, "fhldiv": 1.0, "fhole": 0.0, - "fhout": 0.0, "fhts": 0.5, "figmer": 0.0, "fileprefix": "", @@ -2877,7 +2873,6 @@ "kh2o": 0.651, "ki": null, "kron": "reshape((/unit, zero, zero, zero, unit, zero, zero, zero, unit/), (/3, 3/))", - "ksic": 0.8, "lablcc": [ "Betaconsistency", "Globalpowerbalanceconsistency", @@ -3293,7 +3288,6 @@ "mhd": null, "mi": 0.0, "minmax": 7.0, - "minstang": 0.0, "ml": null, "mlp1": null, "mode": null, @@ -3435,7 +3429,6 @@ "dr_cs": 0.811, "f_z_cs_tf_internal": 0.71, "om": null, - "omlarg": 0.0, "one": 1.0, "opt_file": 15.0, "outfile": 0.0, @@ -3925,7 +3918,6 @@ 0.0, 0.0 ], - "rconl": 0.0, "rcool": 0.005, "r_cryostat_inboard": 0.0, "reactor_clrnc": 4.0, @@ -4260,7 +4252,6 @@ "rsldi": 0.0, "rsldo": 0.0, "rspo": 0.0, - "rsrd": 0.0, "rtanbeam": 0.0, "rtanmax": 0.0, "run_tests": 0.0, @@ -7471,7 +7462,6 @@ "t_burn": 1000.0, "t_burn_0": 0.0, "tcomrepl": 0.5, - "tconl": 0.0, "tcoolin": 313.15, "temp_cp_average": 373.15, "tcpav2": 0.0, @@ -8538,7 +8528,6 @@ "xk0": null, "xlabel": "", "xlabel_2": "", - "xparain": 2100.0, "xpertin": 2.0, "yarc": [ 0.0, @@ -8562,7 +8551,6 @@ "zeff": 0.0, "zeff_div": 0.0, "zeffai": 0.0, - "zeffdiv": 1.0, "zeffmax": 3.6, "zero": 0.0, "zfxf": [ @@ -8766,7 +8754,6 @@ "acs": "Area of space inside conductor (m2)", "acstf": "Cable space area (per turn) [m2]\n Includes the area of voids and central helium channel", "active_constraints": "active_constraints(ipeqns) : Logical array showing which constraints are active", - "adas": "area divertor / area main plasma (along separatrix)", "adivflnc": "allowable divertor heat fluence (MW-yr/m2)", "adj_appr": "", "admv": "administration building volume (m3)", @@ -8919,7 +8906,6 @@ "bp_ratio_ob": "", "b_pf_coil_peak": "peak field at coil i (T)", "bpf2": "", - "bpsout": "reference B_p at outboard divertor strike point (T)", "breeder": "Breeder type (allowed values are Orthosilicate, Metatitanate or Zirconate)", "breeder_f": "Volume ratio: Li4SiO4/(Be12Ti+Li4SiO4) (`iteration variable 108`)", "breeder_multiplier": "combined breeder/multipler fraction of blanket by volume", @@ -9269,7 +9255,6 @@ "divclfr": "divertor coolant fraction", "divcst": "divertor direct cost (M$)", "divdens": "divertor structure density (kg/m3)", - "divdum": "switch for divertor Zeff model:\n
    \n
  • =0 calc
  • \n
  • =1 input
  • \n
", "dz_divertor": "divertor structure vertical thickness (m)", "divlife": "Full power lifetime of divertor (y)", "divmas": "divertor plate mass (kg)", @@ -9517,7 +9502,6 @@ "f_helium3": "helium-3 fuel fraction", "fhldiv": "f-value for divertor heat load (`constraint equation 18`, `iteration variable 27`)", "fhole": "area fraction taken up by other holes (IFE)", - "fhout": "fraction of power to outboard divertor (for single null)", "fhts": "technology adjustment factor for critical current density fit for isumat..=2\n Bi-2212 superconductor, to describe the level of technology assumed (i.e. to\n account for stress, fatigue, radiation, AC losses, joints or manufacturing\n variations; 1.0 would be very optimistic)", "figmer": "physics figure of merit (= plasma_currentaspect*sbar, where `sbar=1`)", "fileprefix": "input file prefix", @@ -9918,7 +9902,6 @@ "kh2o": "thermal conductivity of water (W/m/K)", "ki": "", "kron": "", - "ksic": "power fraction for outboard double-null scrape-off plasma", "lablcc": "lablcc(ipeqns) : labels describing constraint equations (corresponding itvs)
    \n
    \n
  • ( 1) Beta (consistency equation) (itv 5)\n
  • ( 2) Global power balance (consistency equation) (itv 10,1,2,3,4,6,11)\n
  • ( 3) Ion power balance DEPRECATED (itv 10,1,2,3,4,6,11)\n
  • ( 4) Electron power balance DEPRECATED (itv 10,1,2,3,4,6,11)\n
  • ( 5) Density upper limit (itv 9,1,2,3,4,5,6)\n
  • ( 6) (Epsilon x beta poloidal) upper limit (itv 8,1,2,3,4,6)\n
  • ( 7) Beam ion density (NBI) (consistency equation) (itv 7)\n
  • ( 8) Neutron wall load upper limit (itv 14,1,2,3,4,6)\n
  • ( 9) Fusion power upper limit (itv 26,1,2,3,4,6)\n
  • (10) Toroidal field 1/R (consistency equation) (itv 12,1,2,3,13 )\n
  • (11) Radial build (consistency equation) (itv 3,1,13,16,29,42,61)\n
  • (12) Volt second lower limit (STEADY STATE) (itv 15,1,2,3)\n
  • (13) Burn time lower limit (PULSE) (itv 21,1,16,17,29,42,44,61)\n (itv 19,1,2,3,6)\n
  • (14) Neutral beam decay lengths to plasma centre (NBI) (consistency equation)\n
  • (15) LH power threshold limit (itv 103)\n
  • (16) Net electric power lower limit (itv 25,1,2,3)\n
  • (17) Radiation fraction upper limit (itv 28)\n
  • (18) Divertor heat load upper limit (itv 27)\n
  • (19) MVA upper limit (itv 30)\n
  • (20) Neutral beam tangency radius upper limit (NBI) (itv 33,31,3,13)\n
  • (21) Plasma minor radius lower limit (itv 32)\n
  • (22) Divertor collisionality upper limit (itv 34,43)\n
  • (23) Conducting shell to plasma minor radius ratio upper limit\n (itv 104,1,74)\n
  • (24) Beta upper limit (itv 36,1,2,3,4,6,18)\n
  • (25) Peak toroidal field upper limit (itv 35,3,13,29)\n
  • (26) Central solenoid EOF current density upper limit (i_pf_conductor=0)\n (itv 38,37,41,12)\n
  • (27) Central solenoid BOP current density upper limit (i_pf_conductor=0)\n (itv 39,37,41,12)\n
  • (28) Fusion gain Q lower limit (itv 45,47,40)\n
  • (29) Inboard radial build consistency (itv 3,1,13,16,29,42,61)\n
  • (30) Injection power upper limit (itv 46,47,11)\n
  • (31) TF coil case stress upper limit (SCTF) (itv 48,56,57,58,59,60,24)\n
  • (32) TF coil conduit stress upper limit (SCTF) (itv 49,56,57,58,59,60,24)\n
  • (33) I_op / I_critical (TF coil) (SCTF) (itv 50,56,57,58,59,60,24)\n
  • (34) Dump voltage upper limit (SCTF) (itv 51,52,56,57,58,59,60,24)\n
  • (35) J_winding pack/J_protection upper limit (SCTF) (itv 53,56,57,58,59,60,24)\n
  • (36) TF coil temperature margin lower limit (SCTF) (itv 54,55,56,57,58,59,60,24)\n
  • (37) Current drive gamma upper limit (itv 40,47)\n
  • (38) First wall coolant temperature rise upper limit (itv 62)\n
  • (39) First wall peak temperature upper limit (itv 63)\n
  • (40) Start-up injection power lower limit (PULSE) (itv 64)\n
  • (41) Plasma current ramp-up time lower limit (PULSE) (itv 66,65)\n
  • (42) Cycle time lower limit (PULSE) (itv 17,67,65)\n
  • (43) Average centrepost temperature\n (TART) (consistency equation) (itv 13,20,69,70)\n
  • (44) Peak centrepost temperature upper limit (TART) (itv 68,69,70)\n
  • (45) Edge safety factor lower limit (TART) (itv 71,1,2,3)\n
  • (46) Equation for Ip/Irod upper limit (TART) (itv 72,2,60)\n
  • (47) NOT USED\n
  • (48) Poloidal beta upper limit (itv 79,2,3,18)\n
  • (49) NOT USED\n
  • (50) IFE repetition rate upper limit (IFE)\n
  • (51) Startup volt-seconds consistency (PULSE) (itv 16,29,3,1)\n
  • (52) Tritium breeding ratio lower limit (itv 89,90,91)\n
  • (53) Neutron fluence on TF coil upper limit (itv 92,93,94)\n
  • (54) Peak TF coil nuclear heating upper limit (itv 95,93,94)\n
  • (55) Vacuum vessel helium concentration upper limit i_blanket_type =2 (itv 96,93,94)\n
  • (56) Pseparatrix/Rmajor upper limit (itv 97,1,3)\n
  • (57) NOT USED\n
  • (58) NOT USED\n
  • (59) Neutral beam shine-through fraction upper limit (NBI) (itv 105,6,19,4 )\n
  • (60) Central solenoid temperature margin lower limit (SCTF) (itv 106)\n
  • (61) Minimum availability value (itv 107)\n
  • (62) f_alpha_energy_confinement the ratio of particle to energy confinement times (itv 110)\n
  • (63) The number of ITER-like vacuum pumps niterpump < tfno (itv 111)\n
  • (64) Zeff less than or equal to zeffmax (itv 112)\n
  • (65) Dump time set by VV loads (itv 56, 113)\n
  • (66) Limit on rate of change of energy in poloidal field\n (Use iteration variable 65(t_current_ramp_up), 115)\n
  • (67) Simple Radiation Wall load limit (itv 116, 4,6)\n
  • (68) Psep * Bt / qAR upper limit (itv 117)\n
  • (69) ensure separatrix power = the value from Kallenbach divertor (itv 118)\n
  • (70) ensure that teomp = separatrix temperature in the pedestal profile,\n (itv 119 (tesep))\n
  • (71) ensure that neomp = separatrix density (nesep) x neratio\n
  • (72) central solenoid shear stress limit (Tresca yield criterion) (itv 123 foh_stress)\n
  • (73) Psep >= Plh + Paux (itv 137 (fplhsep))\n
  • (74) TFC quench < tmax_croco (itv 141 (fcqt))\n
  • (75) TFC current/copper area < Maximum (itv 143 f_coppera_m2)\n
  • (76) Eich critical separatrix density\n
  • (77) TF coil current per turn upper limit\n
  • (78) Reinke criterion impurity fraction lower limit (itv 147 freinke)\n
  • (79) Peak CS field upper limit (itv 149 fb_cs_limit_max)\n
  • (80) Divertor power lower limit pdivt (itv 153 fpdivlim)\n
  • (81) Ne(0) > ne(ped) constraint (itv 154 fne0)\n
  • (82) toroidalgap > tftort constraint (itv 171 ftoroidalgap)\n
  • (83) Radial build consistency for stellarators (itv 172 f_avspace)\n
  • (84) Lower limit for beta (itv 173 fbeta_min)\n
  • (85) Constraint for CP lifetime\n
  • (86) Constraint for TF coil turn dimension\n
  • (87) Constraint for cryogenic power\n
  • (88) Constraint for TF coil strain absolute value\n
  • (89) Constraint for CS coil quench protection\n
  • (90) Checking if the design point is ECRH ignitable (itv 164 fecrh_ignition)
\n\n\n\n", "lablmm": "lablmm(ipnfoms) : labels describing figures of merit:
    \n
    \n
  • ( 1) major radius\n
  • ( 2) not used\n
  • ( 3) neutron wall load\n
  • ( 4) P_tf + P_pf\n
  • ( 5) fusion gain Q\n
  • ( 6) cost of electricity\n
  • ( 7) capital cost (direct cost if ireactor=0,\n constructed cost otherwise)\n
  • ( 8) aspect ratio\n
  • ( 9) divertor heat load\n
  • (10) toroidal field\n
  • (11) total injected power\n
  • (12) hydrogen plant capital cost OBSOLETE\n
  • (13) hydrogen production rate OBSOLETE\n
  • (14) pulse length\n
  • (15) plant availability factor (N.B. requires\n iavail=1 to be set)\n
  • (16) linear combination of major radius (minimised) and pulse length (maximised)\n note: FoM should be minimised only!\n
  • (17) net electrical output\n
  • (18) Null Figure of Merit\n
  • (19) linear combination of big Q and pulse length (maximised)\n note: FoM should be minimised only!
\n\n\n", "lablxc": "lablxc(ipnvars) : labels describing iteration variables
    \n
    \n
  • ( 1) aspect\n
  • ( 2) bt\n
  • ( 3) rmajor\n
  • ( 4) te\n
  • ( 5) beta\n
  • ( 6) dene\n
  • ( 7) f_nd_beam_electron\n
  • ( 8) fbeta_poloidal_eps (f-value for equation 6)\n
  • ( 9) fdene (f-value for equation 5)\n
  • (10) hfact\n
  • (11) pheat\n
  • (12) oacdcp\n
  • (13) dr_tf_inboard (NOT RECOMMENDED)\n
  • (14) fwalld (f-value for equation 8)\n
  • (15) fvs (f-value for equation 12)\n
  • (16) dr_cs\n
  • (17) tdwell\n
  • (18) q\n
  • (19) beam_energy\n
  • (20) temp_cp_average\n
  • (21) ftburn (f-value for equation 13)\n
  • (22) NOT USED\n
  • (23) fcoolcp\n
  • (24) NOT USED\n
  • (25) fpnetel (f-value for equation 16)\n
  • (26) ffuspow (f-value for equation 9)\n
  • (27) fhldiv (f-value for equation 18)\n
  • (28) fradpwr (f-value for equation 17), total radiation fraction\n
  • (29) dr_bore\n
  • (30) fmva (f-value for equation 19)\n
  • (31) gapomin\n
  • (32) frminor (f-value for equation 21)\n
  • (33) fportsz (f-value for equation 20)\n
  • (34) fdivcol (f-value for equation 22)\n
  • (35) fpeakb (f-value for equation 25)\n
  • (36) fbeta_max (f-value for equation 24)\n
  • (37) j_cs_flat_top_end\n
  • (38) fjohc (f-value for equation 26)\n
  • (39) fjohc0 (f-value for equation 27)\n
  • (40) fgamcd (f-value for equation 37)\n
  • (41) f_j_cs_start_pulse_end_flat_top\n
  • (42) dr_cs_tf_gap\n
  • (43) NOT USED\n
  • (44) fvsbrnni\n
  • (45) fqval (f-value for equation 28)\n
  • (46) fpinj (f-value for equation 30)\n
  • (47) feffcd\n
  • (48) fstrcase (f-value for equation 31)\n
  • (49) fstrcond (f-value for equation 32)\n
  • (50) fiooic (f-value for equation 33)\n
  • (51) fvdump (f-value for equation 34)\n
  • (52) vdalw\n
  • (53) fjprot (f-value for equation 35)\n
  • (54) ftmargtf (f-value for equation 36)\n
  • (55) NOT USED\n
  • (56) tdmptf\n
  • (57) thkcas\n
  • (58) thwcndut\n
  • (59) fcutfsu\n
  • (60) cpttf\n
  • (61) dr_shld_vv_gap_inboard\n
  • (62) fdtmp (f-value for equation 38)\n
  • (63) ftpeak (f-value for equation 39)\n
  • (64) fauxmn (f-value for equation 40)\n
  • (65) tohs\n
  • (66) ftohs (f-value for equation 41)\n
  • (67) ftcycl (f-value for equation 42)\n
  • (68) fptemp (f-value for equation 44)\n
  • (69) rcool\n
  • (70) vcool\n
  • (71) fq (f-value for equation 45)\n
  • (72) fipir (f-value for equation 46)\n
  • (73) dr_fw_plasma_gap_inboard\n
  • (74) dr_fw_plasma_gap_outboard\n
  • (75) tfootfi\n
  • (76) NOT USED\n
  • (77) NOT USED\n
  • (78) NOT USED\n
  • (79) fbeta_poloidal (f-value for equation 48)\n
  • (80) NOT USED\n
  • (81) edrive\n
  • (82) drveff\n
  • (83) tgain\n
  • (84) chrad\n
  • (85) pdrive\n
  • (86) frrmax (f-value for equation 50)\n
  • (87) NOT USED\n
  • (88) NOT USED\n
  • (89) ftbr (f-value for equation 52)\n
  • (90) blbuith\n
  • (91) blbuoth\n
  • (92) fflutf (f-value for equation 53)\n
  • (93) dr_shld_inboard\n
  • (94) dr_shld_outboard\n
  • (95) fptfnuc (f-value for equation 54)\n
  • (96) fvvhe (f-value for equation 55)\n
  • (97) fpsepr (f-value for equation 56)\n
  • (98) f_blkt_li6_enrichment\n
  • (99) NOT USED\n
  • (100) NOT USED\n
  • (101) NOT USED\n
  • (102) fimpvar\n
  • (103) fl_h_threshold (f-value for equation 15)\n
  • (104)fr_conducting_wall (f-value for equation 23)\n
  • (105) fnbshinef (f-value for equation 59)\n
  • (106) ftmargoh (f-value for equation 60)\n
  • (107) favail (f-value for equation 61)\n
  • (108) breeder_f: Volume of Li4SiO4 / (Volume of Be12Ti + Li4SiO4)\n
  • (109) f_nd_alpha_electron: thermal alpha density / electron density\n
  • (110) falpha_energy_confinement: Lower limit on f_alpha_energy_confinement the ratio of alpha\n
  • (111) fniterpump: f-value for constraint that number\n
  • (112) fzeffmax: f-value for max Zeff (f-value for equation 64)\n
  • (113) ftaucq: f-value for minimum quench time (f-value for equation 65)\n
  • (114) len_fw_channel: Length of a single first wall channel\n
  • (115) fpoloidalpower: f-value for max rate of change of\n
  • (116) fradwall: f-value for radiation wall load limit (eq. 67)\n
  • (117) fpsepbqar: f-value for Psep*Bt/qar upper limit (eq. 68)\n
  • (118) fpsep: f-value to ensure separatrix power is less than\n
  • (119) tesep: separatrix temperature calculated by the Kallenbach divertor model\n
  • (120) ttarget: Plasma temperature adjacent to divertor sheath [eV]\n
  • (121) neratio: ratio of mean SOL density at OMP to separatrix density at OMP\n
  • (122) f_a_cs_steel : streel fraction of Central Solenoid\n
  • (123) foh_stress : f-value for CS coil Tresca yield criterion (f-value for eq. 72)\n
  • (124) qtargettotal : Power density on target including surface recombination [W/m2]\n
  • (125) fimp(3) : Beryllium density fraction relative to electron density\n
  • (126) fimp(4) : Carbon density fraction relative to electron density\n
  • (127) fimp(5) : Nitrogen fraction relative to electron density\n
  • (128) fimp(6) : Oxygen density fraction relative to electron density\n
  • (129) fimp(7) : Neon density fraction relative to electron density\n
  • (130) fimp(8) : Silicon density fraction relative to electron density\n
  • (131) fimp(9) : Argon density fraction relative to electron density\n
  • (132) fimp(10) : Iron density fraction relative to electron density\n
  • (133) fimp(11) : Nickel density fraction relative to electron density\n
  • (134) fimp(12) : Krypton density fraction relative to electron density\n
  • (135) fimp(13) : Xenon density fraction relative to electron density\n
  • (136) fimp(14) : Tungsten density fraction relative to electron density\n
  • (137) fplhsep (f-value for equation 73)\n
  • (138) rebco_thickness : thickness of REBCO layer in tape (m)\n
  • (139) copper_thick : thickness of copper layer in tape (m)\n
  • (140) dr_tf_wp : radial thickness of TFC winding pack (m)\n
  • (141) fcqt : TF coil quench temperature < tmax_croco (f-value for equation 74)\n
  • (142) nesep : electron density at separatrix [m-3]\n
  • (143) f_copperA_m2 : TF coil current / copper area < Maximum value\n
  • (144) fnesep : Eich critical electron density at separatrix\n
  • (145) fgwped : fraction of Greenwald density to set as pedestal-top density\n
  • (146) fcpttf : F-value for TF coil current per turn limit (constraint equation 77)\n
  • (147) freinke : F-value for Reinke detachment criterion (constraint equation 78)\n
  • (148) fzactual : fraction of impurity at SOL with Reinke detachment criterion\n
  • (149) fb_cs_limit_max : F-value for max peak CS field (con. 79, itvar 149)\n
  • (152) fb_cs_limit_max : Ratio of separatrix density to Greenwald density\n
  • (153) fpdivlim : F-value for minimum pdivt (con. 80)\n
  • (154) fne0 : F-value for ne(0) > ne(ped) (con. 81)\n
  • (155) pfusife : IFE input fusion power (MW) (ifedrv=3 only)\n
  • (156) rrin : Input IFE repetition rate (Hz) (ifedrv=3 only)\n
  • (157) fvs_cs_pf_total_ramp : F-value for available to required start up flux (con. 51)\n
  • (158) croco_thick : Thickness of CroCo copper tube (m)\n
  • (159) ftoroidalgap : F-value for toroidalgap > tftort constraint (con. 82)\n
  • (160) f_avspace (f-value for equation 83)\n
  • (161) fbeta_min (f-value for equation 84)\n
  • (162) r_cp_top : Top outer radius of the centropost (ST only) (m)\n
  • (163) f_t_turn_tf : f-value for TF coils WP trurn squared dimension constraint\n
  • (164) f_crypmw : f-value for cryogenic plant power\n
  • (165) fstr_wp : f-value for TF coil strain absolute value\n
  • (166) f_copperaoh_m2 : CS coil current /copper area < Maximum value\n
  • (167) fecrh_ignition: f-value for equation 90\n
  • (168) EMPTY : Description\n
  • (169) EMPTY : Description\n
  • (170) EMPTY : Description\n
  • (171) EMPTY : Description\n
  • (172) EMPTY : Description\n
  • (173) EMPTY : Description\n
  • (174) EMPTY : Description\n
  • (175) EMPTY : Description\n\n\n\n", @@ -10046,7 +10029,6 @@ "mftotal": "Total mass flow rate for coolant (kg/s)", "mi": "", "minmax": "", - "minstang": "minimum strike angle for heat flux calculation", "ml": "", "mlp1": "", "mode": "", @@ -10174,7 +10156,6 @@ "dr_cs": "Central solenoid thickness (m) (`iteration variable 16`)", "f_z_cs_tf_internal": "Central solenoid height / TF coil internal height", "om": "", - "omlarg": "power spillage to private flux factor", "one": "", "opt_file": "Optimisation information output file number", "outfile": "", @@ -10453,7 +10434,6 @@ "rbwt": "reactor building wall thickness (m)", "rcls": "", "rcm": "", - "rconl": "connection length ratio, outboard side", "rcool": "average radius of coolant channel (m) (`iteration variable 69`)", "r_cryostat_inboard": "cryostat radius (m)", "reactor_clrnc": "clearance around reactor (m)", @@ -10536,7 +10516,6 @@ "rsldi": "radius to inboard shield (inside point) (m)", "rsldo": "radius to outboard shield (outside point) (m)", "rspo": "outboard strike point radius (m)", - "rsrd": "effective separatrix/divertor radius ratio", "rtanbeam": "neutral beam centreline tangency radius (m)", "rtanmax": "maximum tangency radius for centreline of beam (m)", "run_tests": "turns on built-in tests if set to 1", @@ -10706,7 +10685,6 @@ "t_burn": "burn time (s) (calculated if `i_pulsed_plant=1`)", "t_burn_0": "burn time (s) - used for internal consistency", "tcomrepl": "time taken to replace both blanket and divertor (y) (`iavail=1`)", - "tconl": "main plasma connection length (m)", "tcoolin": "centrepost coolant inlet temperature (K)", "temp_cp_average": "Average temperature of centrepost called CP (K). Only used for resistive coils\n to compute the resisitive heating. Must be an iteration variable for\n ST (`itart=1`) (`iteration variable 20`)", "tcpav2": "Computed centrepost average temperature (K) (for consistency)", @@ -11175,7 +11153,6 @@ "xk0": "", "xlabel": "scan parameter description label", "xlabel_2": "scan parameter description label (2nd dimension)", - "xparain": "parallel heat transport coefficient (m2/s)", "xpertin": "perpendicular heat transport coefficient (m2/s)", "yarc": "y location of arc point i on surface (m)", "yctfc": "y location of arc centre i (m)", @@ -11188,7 +11165,6 @@ "zeff": "plasma effective charge", "zeff_div": "", "zeffai": "mass weighted plasma effective charge", - "zeffdiv": "Zeff in the divertor region (if `divdum/=0`)", "zeffmax": "maximum value for Zeff (`constraint equation 64`)", "zero": "", "zfxf": "", @@ -11729,10 +11705,6 @@ "lb": 0.0, "ub": 50.0 }, - "bpsout": { - "lb": 0.0, - "ub": 10.0 - }, "breeder_f": { "lb": 0.0, "ub": 1.0 @@ -12153,10 +12125,6 @@ "lb": 0.1, "ub": 100000.0 }, - "divdum": { - "lb": 0, - "ub": 1 - }, "dz_divertor": { "lb": 0.1, "ub": 5.0 @@ -13481,10 +13449,6 @@ "lb": 0.99, "ub": 5.0 }, - "ksic": { - "lb": 0.0, - "ub": 2.0 - }, "lambda_q_omp": { "lb": 0.0001, "ub": 1.0 @@ -14965,18 +14929,10 @@ "lb": 0.0, "ub": 1.0 }, - "xparain": { - "lb": 0.01, - "ub": 10000.0 - }, "xpertin": { "lb": 0.0, "ub": 10.0 }, - "zeffdiv": { - "lb": 0.01, - "ub": 100.0 - }, "zeffmax": { "lb": 1.0, "ub": 10.0 @@ -17795,25 +17751,18 @@ "impurity_concs" ], "divertor_variables": [ - "adas", "anginc", "betai", "betao", - "bpsout", "divclfr", "divdens", - "divdum", "dz_divertor", "divmas", "divplt", "divsur", "fdiva", - "fhout", "hldiv", "hldivlim", - "ksic", - "minstang", - "omlarg", "prn1", "rconl", "rlclolcn", @@ -17821,9 +17770,7 @@ "rsrd", "tconl", "tdiv", - "xparain", "xpertin", - "zeffdiv" ], "error_handling": [ "errors_on", @@ -19927,7 +19874,6 @@ "dr_bore": "real_variable", "boundl": "real_array", "boundu": "real_array", - "bpsout": "real_variable", "breeder_f": "real_variable", "breeder_multiplier": "real_variable", "breedmat": "int_variable", @@ -20039,7 +19985,6 @@ "div_umain_time": "real_variable", "divclfr": "real_variable", "divdens": "real_variable", - "divdum": "int_variable", "dz_divertor": "real_variable", "divplt": "real_variable", "beta_norm_max": "real_variable", @@ -20381,7 +20326,6 @@ "kallenbach_tests": "int_variable", "kappa": "real_variable", "kappa95": "real_variable", - "ksic": "real_variable", "lambda_q_omp": "real_variable", "layer_ins": "real_variable", "lcon_factor": "real_variable", @@ -20774,9 +20718,7 @@ "workshop_w": "real_variable", "wsvfac": "real_variable", "xi_ebw": "real_variable", - "xparain": "real_variable", "xpertin": "real_variable", - "zeffdiv": "real_variable", "zeffmax": "real_variable", "zref": "real_array" }, diff --git a/tests/regression/input_files/helias_5b.IN.DAT b/tests/regression/input_files/helias_5b.IN.DAT index 8c5accaa58..73caa93e69 100644 --- a/tests/regression/input_files/helias_5b.IN.DAT +++ b/tests/regression/input_files/helias_5b.IN.DAT @@ -110,10 +110,8 @@ pheat = 0.0 *Heating power not used for current drive (MW) *----------------Divertor Variables----------------* anginc = 0.035 *Angle of incidence of field line on plate (rad) -divdum = 1 *Switch for divertor zeff model (1: input) tdiv = 3.0 *Temperature at divertor (eV) xpertin = 1.5 *Perpendicular heat transport coefficient (m2/s) -zeffdiv = 3.0 *Zeff in the divertor region (if divdum /= 0) *------------------FWBs Variables------------------* diff --git a/tests/regression/input_files/st_regression.IN.DAT b/tests/regression/input_files/st_regression.IN.DAT index 5432afe228..7e6926bd3a 100644 --- a/tests/regression/input_files/st_regression.IN.DAT +++ b/tests/regression/input_files/st_regression.IN.DAT @@ -837,24 +837,10 @@ boundu(97) = 1.0 * DESCRIPTION: Angle of incidence of field line on plate (rad) (default = 0.262) * JUSTIFICATION: Not yet set -*divdum = -* DESCRIPTION: switch for divertor Zeff model: (default = 0) -* =0 calc -* =1 input -* JUSTIFICATION: Not yet set - -*zeffdiv = -* DESCRIPTION: Zeff in the divertor region (if `divdum/=0`) (default = 1.0) -* JUSTIFICATION: Not yet set - *flux_exp = * DESCRIPTION: The plasma flux expansion in the divertor (default 2; Wade 2020) * JUSTIFICATION: Not yet set -*ksic = -* DESCRIPTION: Power fraction for outboard double-null scrape-off plasma (default = 0.8) -* JUSTIFICATION: Not yet set - *prn1 = * DESCRIPTION: n-scrape-off / n-average plasma; (input for `ipedestal=0`, = nesep/dene if `ipedestal==1`) (default = 0.285) * JUSTIFICATION: Not yet set @@ -863,10 +849,6 @@ boundu(97) = 1.0 * DESCRIPTION: Plasma temperature at divertor (eV) (default = 2.0) * JUSTIFICATION: Not yet set -*xparain = -* DESCRIPTION: Parallel heat transport coefficient (m2/s) (default = 2.1D3) -* JUSTIFICATION: Not yet set - *xpertin = * DESCRIPTION: perpendicular heat transport coefficient (m2/s) (default = 2.0) * JUSTIFICATION: Not yet set diff --git a/tests/regression/input_files/stellarator_helias_once_through.IN.DAT b/tests/regression/input_files/stellarator_helias_once_through.IN.DAT index 55c8efc302..884c8c391c 100644 --- a/tests/regression/input_files/stellarator_helias_once_through.IN.DAT +++ b/tests/regression/input_files/stellarator_helias_once_through.IN.DAT @@ -165,11 +165,9 @@ pheat = 0. * heating power not used for current drive (MW) (`iteration variab *----------------Divertor Variables----------------* anginc = 0.035 * angle of incidence of field line on plate (rad) -divdum = 1 * switch for divertor Zeff model; hldivlim = 15 * heat load limit (MW/m2) tdiv = 3. * temperature at divertor (eV) (input for stellarator only; calculated for tokamaks) xpertin = 1.5 * perpendicular heat transport coefficient (m2/s) -zeffdiv = 3. * Zeff in the divertor region (if `divdum/=0`) *------------------Error Handling------------------* From 94e354e2a354cd00333342d6ff42f3d86a940a81 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Tue, 1 Apr 2025 16:56:08 +0100 Subject: [PATCH 05/11] :bulb: Add Wade divertor heat load model large tokamak regression --- tests/regression/input_files/large_tokamak.IN.DAT | 3 +++ tests/regression/input_files/large_tokamak_nof.IN.DAT | 3 +++ tests/regression/input_files/large_tokamak_once_through.IN.DAT | 3 +++ 3 files changed, 9 insertions(+) diff --git a/tests/regression/input_files/large_tokamak.IN.DAT b/tests/regression/input_files/large_tokamak.IN.DAT index ba34c63182..846775f3c2 100644 --- a/tests/regression/input_files/large_tokamak.IN.DAT +++ b/tests/regression/input_files/large_tokamak.IN.DAT @@ -335,6 +335,9 @@ dr_shld_outboard = 0.800 * Divertor structure vertical thickness [m] dz_divertor = 0.62 +* Use Wade divertor heat load model +i_hldiv = 2 + * Coolant void fraction in shield vfshld = 0.60 diff --git a/tests/regression/input_files/large_tokamak_nof.IN.DAT b/tests/regression/input_files/large_tokamak_nof.IN.DAT index 5b24176e74..f166bd039f 100644 --- a/tests/regression/input_files/large_tokamak_nof.IN.DAT +++ b/tests/regression/input_files/large_tokamak_nof.IN.DAT @@ -317,6 +317,9 @@ dr_shld_outboard = 0.800 * Divertor structure vertical thickness [m] dz_divertor = 0.62 +* Use Wade divertor heat load model +i_hldiv = 2 + * Coolant void fraction in shield vfshld = 0.60 diff --git a/tests/regression/input_files/large_tokamak_once_through.IN.DAT b/tests/regression/input_files/large_tokamak_once_through.IN.DAT index 40a12964b9..5161cf5407 100644 --- a/tests/regression/input_files/large_tokamak_once_through.IN.DAT +++ b/tests/regression/input_files/large_tokamak_once_through.IN.DAT @@ -177,6 +177,9 @@ pinjalw = 200.0 * maximum allowable value for injected power (MW) (`constraint dz_divertor = 0.62 * divertor structure vertical thickness (m) +* Use Wade divertor heat load model +i_hldiv = 2 + *------------------Error Handling------------------* From 78a52debed1199b482ee43d88903f4ef459f7fd9 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Wed, 2 Apr 2025 08:54:34 +0100 Subject: [PATCH 06/11] :fire: Deprecate constraint equation 22 and update error reporting --- process/utilities/errorlist.json | 7 ++++++- source/fortran/constraint_equations.f90 | 17 ++++++++++------- .../regression/input_files/st_regression.IN.DAT | 5 ----- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/process/utilities/errorlist.json b/process/utilities/errorlist.json index a904309d60..790e476653 100644 --- a/process/utilities/errorlist.json +++ b/process/utilities/errorlist.json @@ -8,7 +8,7 @@ "comment2": [ "Increment n_errortypes if an error is added to this list" ], - "n_errortypes": 288, + "n_errortypes": 289, "errors": [ { "no": 1, @@ -1449,6 +1449,11 @@ "no": 288, "level": 3, "message": "PFCOIL: i_pf_location(i) should not be 1 if iohcl=0" + }, + { + "no": 289, + "level": 3, + "message": "CHECK: Constraint equation 22 has been deprecated." } ] } diff --git a/source/fortran/constraint_equations.f90 b/source/fortran/constraint_equations.f90 index 3858412ab6..e9032293e8 100755 --- a/source/fortran/constraint_equations.f90 +++ b/source/fortran/constraint_equations.f90 @@ -148,7 +148,7 @@ subroutine constraint_eqns(m,ieqn,cc,con,err,symbol,units) case (20); call constraint_eqn_020(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) ! Equation for minor radius lower limit case (21); call constraint_eqn_021(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) - ! Equation for divertor collision/connection length ratio upper limit + ! Obsolete case (22); call constraint_eqn_022(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) ! Equation for conducting shell radius / rminor upper limit case (23); call constraint_eqn_023(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) @@ -1195,19 +1195,22 @@ subroutine constraint_eqn_022(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) !! fdivcol : input real : f-value for divertor collisionality !! rlenmax : input real : maximum value for length ratio (rlclolcn) !! rlclolcn : input real : ratio of collision length / connection length - use constraint_variables, only: fdivcol - use divertor_variables, only: rlenmax, rlclolcn + implicit none + real(dp), intent(out) :: tmp_cc real(dp), intent(out) :: tmp_con real(dp), intent(out) :: tmp_err character(len=1), intent(out) :: tmp_symbol character(len=10), intent(out) :: tmp_units + !! Constraints output - tmp_cc = rlclolcn / rlenmax - 1.0D0 * fdivcol - tmp_con = rlenmax * (1.0D0 - tmp_cc) - tmp_err = rlclolcn * tmp_cc - tmp_symbol = '<' + ! This constraint is depreciated + call report_error(289) + + tmp_con = 1.0D0 + tmp_err = 0.0D0 + tmp_symbol = '=' tmp_units = '' end subroutine constraint_eqn_022 diff --git a/tests/regression/input_files/st_regression.IN.DAT b/tests/regression/input_files/st_regression.IN.DAT index 7e6926bd3a..2980905a4b 100644 --- a/tests/regression/input_files/st_regression.IN.DAT +++ b/tests/regression/input_files/st_regression.IN.DAT @@ -799,11 +799,6 @@ boundu(97) = 1.0 *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Divertor Heat Model ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -*icc = 22 -* DESCRIPTION: Constraint equation for divertor collision/connection length ratio upper limit -* JUSTIFICATION: Turned off, dont care about connection length -* VARIABLES: rlenmax (maximum value for length ratio (rlclolcn)), rlclolcn calculated in-situ - *rlenmax = * DESCRIPTION: Maximum value for length ratio (rlclolcn) (`constraintg eqn 22`) * JUSTIFICATION: Turned off, not using icc =22 From fedb738eb06f80a70af79341cc515361844f7561 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Wed, 2 Apr 2025 08:59:31 +0100 Subject: [PATCH 07/11] :fire: Remove unused divertor collisionality variable and related references --- process/input.py | 1 - source/fortran/constraint_variables.f90 | 4 ---- source/fortran/iteration_variables.f90 | 23 +++-------------------- source/fortran/numerics.f90 | 2 +- tests/integration/ref_dicts.json | 10 ---------- 5 files changed, 4 insertions(+), 36 deletions(-) diff --git a/process/input.py b/process/input.py index 777497a2ef..b42e2a1de0 100644 --- a/process/input.py +++ b/process/input.py @@ -584,7 +584,6 @@ def __post_init__(self): "fdene": InputVariable(fortran.constraint_variables, float, range=(0.001, 10.0)), "f_ster_div_single": InputVariable(fortran.fwbs_variables, float, range=(0.0, 1.0)), "fdiva": InputVariable(fortran.divertor_variables, float, range=(0.1, 2.0)), - "fdivcol": InputVariable(fortran.constraint_variables, float, range=(0.001, 10.0)), "fdivwet": InputVariable(fortran.stellarator_variables, float, range=(0.01, 1.0)), "fdtmp": InputVariable(fortran.constraint_variables, float, range=(0.001, 10.0)), "fecrh_ignition": InputVariable( diff --git a/source/fortran/constraint_variables.f90 b/source/fortran/constraint_variables.f90 index f96f696dea..ffb4df99ec 100644 --- a/source/fortran/constraint_variables.f90 +++ b/source/fortran/constraint_variables.f90 @@ -54,9 +54,6 @@ module constraint_variables !! f-value for density limit (`constraint equation 5`, `iteration variable 9`) !! (invalid if `ipedestal=3`) - real(dp) :: fdivcol - !! f-value for divertor collisionality (`constraint equation 22`, `iteration variable 34`) - real(dp) :: fdtmp !! f-value for first wall coolant temperature rise !! (`constraint equation 38`, `iteration variable 62`) @@ -332,7 +329,6 @@ subroutine init_constraint_variables fcpttf = 1.0D0 fr_conducting_wall = 1.0D0 fdene = 1.0D0 - fdivcol = 1.0D0 fdtmp = 1.0D0 fflutf = 1.0D0 ffuspow = 1.0D0 diff --git a/source/fortran/iteration_variables.f90 b/source/fortran/iteration_variables.f90 index 30e8d84628..34540907ed 100755 --- a/source/fortran/iteration_variables.f90 +++ b/source/fortran/iteration_variables.f90 @@ -788,28 +788,11 @@ end subroutine set_itv_33 !--------------------------------- - subroutine init_itv_34 - !!
  • (34) fdivcol (f-value for equation 22) - use numerics, only: lablxc, boundl, boundu - implicit none - lablxc(34) = 'fdivcol ' - boundl(34) = 0.001D0 - boundu(34) = 1.000D0 - end subroutine init_itv_34 - real(kind(1.d0)) function itv_34() - use constraint_variables, only: fdivcol implicit none - itv_34 = fdivcol + write(*,*) 'Iteration variable 34 is no longer in use.' end function itv_34 - subroutine set_itv_34(ratio) - use constraint_variables, only: fdivcol - implicit none - real(kind(1.d0)) :: ratio - fdivcol = ratio - end subroutine set_itv_34 - !--------------------------------- subroutine init_itv_35 @@ -4021,7 +4004,7 @@ subroutine loadxc case (31); xcm(i) = itv_31() case (32); xcm(i) = itv_32() case (33); xcm(i) = itv_33() - case (34); xcm(i) = itv_34() + case (34); case (35); xcm(i) = itv_35() case (36); xcm(i) = itv_36() case (37); xcm(i) = itv_37() @@ -4286,7 +4269,7 @@ subroutine convxc(xc,nn) case (31); call set_itv_31(ratio) case (32); call set_itv_32(ratio) case (33); call set_itv_33(ratio) - case (34); call set_itv_34(ratio) + case (34); case (35); call set_itv_35(ratio) case (36); call set_itv_36(ratio) case (37); call set_itv_37(ratio) diff --git a/source/fortran/numerics.f90 b/source/fortran/numerics.f90 index 55d872c6d9..707ed262e0 100755 --- a/source/fortran/numerics.f90 +++ b/source/fortran/numerics.f90 @@ -239,7 +239,7 @@ module numerics !!
  • (31) gapomin !!
  • (32) frminor (f-value for equation 21) !!
  • (33) fportsz (f-value for equation 20) - !!
  • (34) fdivcol (f-value for equation 22) + !!
  • (34) NOT USED !!
  • (35) fpeakb (f-value for equation 25) !!
  • (36) fbeta_max (f-value for equation 24) !!
  • (37) j_cs_flat_top_end diff --git a/tests/integration/ref_dicts.json b/tests/integration/ref_dicts.json index 2057d4f647..1b901bf9c1 100644 --- a/tests/integration/ref_dicts.json +++ b/tests/integration/ref_dicts.json @@ -1907,7 +1907,6 @@ ], "f_ster_div_single": 0.115, "fdiva": 1.11, - "fdivcol": 1.0, "fdivwet": 0.333333333333333, "fdtmp": 1.0, "fe2": null, @@ -9482,7 +9481,6 @@ "fdiags": "", "f_ster_div_single": "Solid angle fraction taken by one divertor", "fdiva": "divertor area fudge factor (for ITER, Sept 1990)", - "fdivcol": "f-value for divertor collisionality (`constraint equation 22`, `iteration variable 34`)", "fdivwet": "wetted fraction of the divertor area", "fdtmp": "f-value for first wall coolant temperature rise\n (`constraint equation 38`, `iteration variable 62`)", "fe2": "", @@ -12517,10 +12515,6 @@ "lb": 0.1, "ub": 2.0 }, - "fdivcol": { - "lb": 0.001, - "ub": 10.0 - }, "fdivwet": { "lb": 0.01, "ub": 1.0 @@ -15106,10 +15100,6 @@ "lb": 0.001, "ub": 1.0 }, - "fdivcol": { - "lb": 0.001, - "ub": 1.0 - }, "fdtmp": { "lb": 0.001, "ub": 1.0 From 7f8c55a3d0ba73b5754fe75601befc7d2ec782c1 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Wed, 2 Apr 2025 09:03:11 +0100 Subject: [PATCH 08/11] :fire: Remove unused divertor length ratio variables and references --- process/init.py | 1 - process/input.py | 1 - source/fortran/divertor_variables.f90 | 8 -------- tests/integration/ref_dicts.json | 11 ----------- tests/regression/input_files/st_regression.IN.DAT | 6 ------ 5 files changed, 27 deletions(-) diff --git a/process/init.py b/process/init.py index a9acd9dc3a..c444238b44 100644 --- a/process/init.py +++ b/process/init.py @@ -283,7 +283,6 @@ def initialise_iterative_variables(): fortran.define_iteration_variables.init_itv_31() fortran.define_iteration_variables.init_itv_32() fortran.define_iteration_variables.init_itv_33() - fortran.define_iteration_variables.init_itv_34() fortran.define_iteration_variables.init_itv_35() fortran.define_iteration_variables.init_itv_36() fortran.define_iteration_variables.init_itv_37() diff --git a/process/input.py b/process/input.py index b42e2a1de0..ebf1df51e1 100644 --- a/process/input.py +++ b/process/input.py @@ -1078,7 +1078,6 @@ def __post_init__(self): "rhopfbus": InputVariable(fortran.pfcoil_variables, float, range=(0.0, 1e-05)), "rinboard": InputVariable(fortran.build_variables, float, range=(0.1, 10.0)), "ripmax": InputVariable(fortran.tfcoil_variables, float, range=(0.1, 100.0)), - "rlenmax": InputVariable(fortran.divertor_variables, float, range=(0.0, 1.0)), "rmajor": InputVariable(fortran.physics_variables, float, range=(0.1, 50.0)), "robotics_h": InputVariable(fortran.buildings_variables, float, range=(1.0, 100.0)), "robotics_l": InputVariable( diff --git a/source/fortran/divertor_variables.f90 b/source/fortran/divertor_variables.f90 index 09ba6d7a21..fcb5a1e8dd 100644 --- a/source/fortran/divertor_variables.f90 +++ b/source/fortran/divertor_variables.f90 @@ -70,12 +70,6 @@ module divertor_variables real(dp) :: rconl !! connection length ratio, outboard side - real(dp) :: rlclolcn - !! ratio of collision length / connection length - - real(dp) :: rlenmax - !! maximum value for length ratio (rlclolcn) (`constraintg eqn 22`) - real(dp) :: rsrd !! effective separatrix/divertor radius ratio @@ -111,8 +105,6 @@ subroutine init_divertor_variables hldivlim = 5.0D0 prn1 = 0.285D0 rconl = 0.0D0 - rlclolcn = 0.0D0 - rlenmax = 0.5D0 rsrd = 0.0D0 tconl = 0.0D0 tdiv = 2.0D0 diff --git a/tests/integration/ref_dicts.json b/tests/integration/ref_dicts.json index 1b901bf9c1..ef037bbfab 100644 --- a/tests/integration/ref_dicts.json +++ b/tests/integration/ref_dicts.json @@ -4203,8 +4203,6 @@ "j_cs_critical_pulse_start": 0.0, "j_pf_wp_critical": 0.0, "rkind": "double", - "rlclolcn": 0.0, - "rlenmax": 0.5, "ind_plasma_internal_norm": 0.9, "ind_plasma": 0.0, "rmaj": null, @@ -10477,8 +10475,6 @@ "j_cs_critical_pulse_start": "allowable central solenoid current density at beginning of pulse (A/m2)", "j_pf_wp_critical": "allowable winding pack current density of PF coil i (A/m2)", "rkind": "", - "rlclolcn": "ratio of collision length / connection length", - "rlenmax": "maximum value for length ratio (rlclolcn) (`constraintg eqn 22`)", "ind_plasma_internal_norm": "plasma normalised internal inductance (calculated from alphaj if `iprofile=1`)", "ind_plasma": "plasma inductance (H)", "rmaj": "", @@ -14003,10 +13999,6 @@ "lb": 0.1, "ub": 100.0 }, - "rlenmax": { - "lb": 0.0, - "ub": 1.0 - }, "ind_plasma_internal_norm": { "lb": 0.0, "ub": 10.0 @@ -17755,8 +17747,6 @@ "hldivlim", "prn1", "rconl", - "rlclolcn", - "rlenmax", "rsrd", "tconl", "tdiv", @@ -20466,7 +20456,6 @@ "rinboard": "real_variable", "ripmax": "real_variable", "j_pf_coil_wp_peak": "real_array", - "rlenmax": "real_variable", "ind_plasma_internal_norm": "real_variable", "rmajor": "real_variable", "f_nd_beam_electron": "real_variable", diff --git a/tests/regression/input_files/st_regression.IN.DAT b/tests/regression/input_files/st_regression.IN.DAT index 2980905a4b..9999586601 100644 --- a/tests/regression/input_files/st_regression.IN.DAT +++ b/tests/regression/input_files/st_regression.IN.DAT @@ -799,12 +799,6 @@ boundu(97) = 1.0 *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Divertor Heat Model ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -*rlenmax = -* DESCRIPTION: Maximum value for length ratio (rlclolcn) (`constraintg eqn 22`) -* JUSTIFICATION: Turned off, not using icc =22 - -*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - *icc = 78 * DESCRIPTION: Constraint equation for Reinke criterion, divertor impurity fraction lower limit * JUSTIFICATION: Turned off, not concerned with lower divertor impurity From 599e08261db51c2c5d4f6791ad6ff4a73938ca19 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Wed, 2 Apr 2025 14:21:21 +0100 Subject: [PATCH 09/11] Add new obsolete divertor variables and update i_hldiv initialization to use Wade model --- process/io/obsolete_vars.py | 18 ++++++++++++++++++ source/fortran/divertor_variables.f90 | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/process/io/obsolete_vars.py b/process/io/obsolete_vars.py index 4fb5d0fbe6..f1926e71d7 100644 --- a/process/io/obsolete_vars.py +++ b/process/io/obsolete_vars.py @@ -273,6 +273,24 @@ "ipump": "i_fw_blkt_shared_coolant", "coolwh": "i_blkt_coolant_type", "iblanket_thickness": None, + "bpsout": None, + "c1div": None, + "c2div": None, + "c3div": None, + "c4div": None, + "c5div": None, + "c6div": None, + "delld": None, + "fdfs": None, + "fdivcol": None, + "fififi": None, + "frrp": None, + "ksic": None, + "omegan": None, + "rlenmax": None, + "xparain": None, + "zeffdiv": None, + "divdum": None, } OBS_VARS_HELP = { diff --git a/source/fortran/divertor_variables.f90 b/source/fortran/divertor_variables.f90 index fcb5a1e8dd..654b5fd1c5 100644 --- a/source/fortran/divertor_variables.f90 +++ b/source/fortran/divertor_variables.f90 @@ -101,7 +101,7 @@ subroutine init_divertor_variables fdiva = 1.11D0 flux_exp = 2.0D0 hldiv = 0.0D0 - i_hldiv = 0 + i_hldiv = 2 hldivlim = 5.0D0 prn1 = 0.285D0 rconl = 0.0D0 From e1e9370b5f30e36138b155f34b3aeb73cd8bade7 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Wed, 2 Apr 2025 16:10:12 +0100 Subject: [PATCH 10/11] Simplify divertor initialization condition by removing redundant check for i_hldiv --- process/divertor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/process/divertor.py b/process/divertor.py index 3f9c52e551..8a39497ce8 100644 --- a/process/divertor.py +++ b/process/divertor.py @@ -33,7 +33,7 @@ def run(self, output: bool) -> None: :type output: boolean """ - if pv.itart == 1 and (dv.i_hldiv == 0 or dv.i_hldiv == 1): + if dv.i_hldiv == 1: self.divtart( pv.rmajor, pv.rminor, From 5f6b6547aecbd51987f3c38d92bdf1138f7b1da9 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Thu, 3 Apr 2025 09:35:12 +0100 Subject: [PATCH 11/11] Add output condition for divertor heat load logging --- process/divertor.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/process/divertor.py b/process/divertor.py index 8a39497ce8..2be5806a49 100644 --- a/process/divertor.py +++ b/process/divertor.py @@ -32,7 +32,9 @@ def run(self, output: bool) -> None: :param output: indicate whether output should be written to the output file, or not :type output: boolean """ - + if dv.i_hldiv == 0 and output: + po.ovarre(self.outfile, "Divertor heat load (MW/m2)", "(hldiv)", dv.hldiv) + return if dv.i_hldiv == 1: self.divtart( pv.rmajor,