Example #1
0
        public SolverData()
        {
            FieldEpsilon = new FieldEpsilon();
            FieldK = new FieldK();
            FieldNut = new BoundaryField();
            FieldP = new FieldP();
            FieldR = new FieldR();
            FieldU = new FieldU();
            #region Handlers
            _controlDictHandler = new ControlDictHandler();
            _transportPropHandler = new TransportPropertiesHandler();
            _blockMeshHandler = new BlockMeshDictHandler();
            _turbineArrayPropHandler = new TurbineArrayPropHandler();
            _turbineProperiesHandler = new TurbineProperiesHandler("NREL5MWRef", true);
            _fieldEpsilonHandler = new FieldEpsilonHandler();
            _fieldKHandler = new FieldKHandler();
            _fieldPHandler = new FieldPHandler();
            _fieldUHandler = new FieldUHandler();
            _fieldRHandler = new FieldRHandler();
            _fvSolutionHandler = new FvSolutionHandler();
            _fvSchemesHandler = new FvSchemesHandler();
            _decomposeParDictHandler = new DecomposeParDictHandler();
            _turbulencePropertiesHandler = new TurbulencePropertiesHandler();
            _airfoilPropertiesHandler = new AirfoilPropertiesHandler(null);
            #endregion

            #region Data
            BlockMeshDict = (BlockMeshDictData) _blockMeshHandler.Read(null);
            ControlDict = (ControlDictData) _controlDictHandler.Read(null);
            TransportProperties = (TransportPropertiesData) _transportPropHandler.Read(null);
            TurbineArrayProperties = (TurbineArrayPropData) _turbineArrayPropHandler.Read(null);
            TurbineProperties = (TurbinePropertiesData) _turbineProperiesHandler.Read(null);
            FvSolution = (FvSolutionData) _fvSolutionHandler.Read(null);
            FvScheme = (FvSchemesData) _fvSchemesHandler.Read(null);
            DecomposeParDict = (DecomposeParDictData) _decomposeParDictHandler.Read(null);
            TurbulenceProperties = (TurbulencePropertiesData)_turbulencePropertiesHandler.Read(null);

            AirfoilData = _airfoilPropertiesHandler.ReadDefault();

            #endregion

            /* extra post-initialize calls */
            InitTransportProperties(TransportProperties);
            InitFieldK(FieldK);
            InitFieldEpsilon(FieldEpsilon);
            InitFieldP(FieldP);
            InitFieldR(FieldR);
            InitFieldU(FieldU);

            AirfoilProperties = new AirfoilPropertiesData();
            ProcessingSettings = new ProcessingSettings();
        }
Example #2
0
        public VTurbineType( string typeInstance, string path, bool useDefaultData )
        {
            if (typeInstance == null) return;
            _fileHandler = new TurbineProperiesHandler(typeInstance, useDefaultData);
            var d = (TurbinePropertiesData)_fileHandler.Read(_fileHandler.GetPath(path));

            PropName = typeInstance;
            ShowInstance = Visibility.Visible;
            BladeIner = d.BladeIner;
            HubIner = d.HubIner;
            HubRad = d.HubRad;
            NumBl = d.NumBl;
            Update_TipPicture();
            TipRad = d.TipRad;
            UndSling = d.UndSling;
            OverHang = d.OverHang;
            TowerHt = d.TowerHt;
            Twr2Shft = d.Twr2Shft;
            ShftTilt = d.ShftTilt;
            PreCone = new VVertice(d.PreCone);
            GBRatio = d.GBRatio;
            GenIner = d.GenIner;
            TorqueControllerType = d.TorqueControllerType;
            YawControllerType = d.YawControllerType;
            PitchControllerType = d.PitchControllerType;

                #region Fill TorqueControllerParams
            if (d.torqueControllerParams != null)
            {
                CutInGenSpeed = d.torqueControllerParams.CutInGenSpeed;
                RatedGenSpeed = d.torqueControllerParams.RatedGenSpeed;
                Region2StartGenSpeed = d.torqueControllerParams.Region2StartGenSpeed;
                Region2EndGenSpeed = d.torqueControllerParams.Region2EndGenSpeed;
                CutInGenTorque = d.torqueControllerParams.CutInGenTorque;
                RatedGenTorque = d.torqueControllerParams.RatedGenTorque;
                RateLimitGenTorque = d.torqueControllerParams.RateLimitGenTorque;
                KGen = d.torqueControllerParams.KGen;
                TorqueControllerRelax = d.torqueControllerParams.TorqueControllerRelax;
            }

            #endregion
                #region Fill PitchControllerParams
            if (d.pitchControllerParams != null)
            {
                PitchControlStartPitch = d.pitchControllerParams.PitchControlStartPitch;
                PitchControlEndPitch = d.pitchControllerParams.PitchControlEndPitch;
                PitchControlStartSpeed = d.pitchControllerParams.PitchControlStartSpeed;
                PitchControlEndSpeed = d.pitchControllerParams.PitchControlEndSpeed;
                RateLimitPitch = d.pitchControllerParams.RateLimitPitch;
            }
            #endregion

            airfoilBlade = new ObservableCollection<VAirfoilBlade>();

            foreach (var x in d.airfoilBlade)
            {
                var copyOfBlade = new ObservableCollection<VVertice>();
                foreach (var y in x.Blade)
                {
                    copyOfBlade.Add(new VVertice(y));
                }
                airfoilBlade.Add(new VAirfoilBlade()
                {
                    AirfoilName = x.AirfoilName,
                    Blade = copyOfBlade
                });
            }
        }