public PrescribedVectorExtVel(SinglePhaseField LevelSet, VectorField <SinglePhaseField> Velocity, bool nearfield, NSECommon.IncompressibleBoundaryCondMap bcMap, Func <double[], double, double[]> AnalyticalExtVel) { this.nearfield = nearfield; this.LevelSet = LevelSet; this.Velocity = Velocity; this.AnalyticalExtVel = AnalyticalExtVel; VelocityHistory = new VectorFieldHistory <SinglePhaseField>(Velocity); VelocityHistory.IncreaseHistoryLength(1); VelocityHistory.Push(); explicitNonconservativeAdvection = new ExplicitNonconservativeAdvection(LevelSet, VelocityHistory, bcMap, false); }
/// <summary> /// /// </summary> /// <param name="LSTrk"></param> /// <param name="LevelSet"></param> /// <param name="LevelSetGradient"></param> /// <param name="Velocity"></param> /// <param name="Control"></param> /// <param name="bcMap"></param> /// <param name="BDForder">Quick Hack: -1 = CrankNicholson, 0= Explicit, >0: BDF</param> /// <param name="VectorExtension"></param> /// <param name="nearfield"></param> public VectorExtVelAdvection(LevelSetTracker LSTrk, SinglePhaseField LevelSet, VectorField <SinglePhaseField> LevelSetGradient, VectorField <SinglePhaseField> Velocity, EllipticExtVelAlgoControl Control, NSECommon.IncompressibleBoundaryCondMap bcMap, int BDForder, out VectorField <SinglePhaseField> VectorExtension, SubGrid subGrid = null) { D = LSTrk.GridDat.SpatialDimension; this.LevelSetGradient = LevelSetGradient; this.UseImplicitTimeStepping = (BDForder != 0); this.nearfield = subGrid != null; this.Velocity = Velocity; this.LSTrk = LSTrk; this.LevelSet = LevelSet; VectorExtensionHistory = new VectorFieldHistory <SinglePhaseField>(new VectorField <SinglePhaseField>(D, Velocity[0].Basis, "ExtVel", SinglePhaseField.Factory)); VectorExtension = VectorExtensionHistory.Current; this.VectorExtension = VectorExtension; double PenaltyBase = Control.PenaltyMultiplierInterface * ((double)((LevelSet.Basis.Degree + 1) * (LevelSet.Basis.Degree + D))) / ((double)D); ILevelSetForm InterfaceFlux = new SingleComponentInterfaceForm(PenaltyBase, LSTrk); VelocityExtender = new Extender[D]; for (int d = 0; d < D; d++) { VelocityExtender[d] = new Extender(VectorExtension[d], LSTrk, InterfaceFlux, new List <DGField> { Velocity[d] }, LevelSetGradient, Control); VelocityExtender[d].ConstructExtension(new List <DGField> { Velocity[d] }, Control.subGridRestriction); } if (!this.UseImplicitTimeStepping) { VectorExtensionHistory.IncreaseHistoryLength(1); VectorExtensionHistory.Push(); Advection = new ExplicitNonconservativeAdvection(LevelSet, VectorExtensionHistory, bcMap); } else { Advection = new BDFNonconservativeAdvection(LevelSet, VectorExtension, bcMap, BDForder, subGrid, false); } }