/// <summary> /// Constructor /// </summary> /// <param name="sensor"> /// A shock sensor /// </param> /// <param name="dgDegree"> /// Approximation degree of the field to which the given /// <paramref name="sensor"/> is applied /// </param> /// <param name="refSensorLimit"> /// Base value of the hard sensor limit (before scaling) that /// distinguishes between AV or no AV /// </param> /// <param name="refViscosity"> /// Base value of the viscosity (before scaling) that should be used in /// shocked cells. /// </param> public HeavisideArtificialViscosityLaw(IShockSensor sensor, int dgDegree, double refSensorLimit, double refViscosity) { this.sensor = sensor; this.sensorLimit = refSensorLimit / (double)Math.Pow(dgDegree, 4); this.refViscosity = refViscosity; this.dgDegree = dgDegree; }
public ConservativeFVMLimiter(IShockSensor sensor, double sensorLimit, double cellSize, int dgDegree) { this.Sensor = sensor; this.sensorLimit = sensorLimit; this.cellSize = cellSize; this.dgDegree = dgDegree; }
public PrimitiveFVMLimiter(IShockSensor sensor, double sensorLimit, double cellSize, int dgDegree, IProgram <CNSControl> program) { this.Sensor = sensor; this.sensorLimit = sensorLimit; this.cellSize = cellSize; this.dgDegree = dgDegree; this.program = program; }
/// <summary> /// Constructor /// </summary> /// <param name="sensor"> /// Some shock sensor /// </param> /// <param name="dgDegree"> /// Approximation degree of the field to which the given /// <paramref name="sensor"/> is applied /// </param> /// <param name="refSensorLimit"> /// Base value of the sensor limit (before scaling) that defines the /// amount of AV to be used. More precisely, this values defines the /// center of smooth Heaviside approximation (i.e., exactly half of the /// specified maximum <paramref name="refMaxViscosity"/> will be /// applied for the given sensor value) /// </param> /// <param name="refMaxViscosity"> /// Base value of the maximum viscosity (before scaling) that should be /// used in shocked cells. /// </param> /// <param name="kappa"> /// Width (in terms of "range of sensor values") of the smoothed /// transition zone between full AV and no AV /// </param> /// <param name="lambdaMax"> /// Optional: Additional scaling coefficient for the AV. If none is /// given, an estimate will be used according the local flow state /// </param> public SmoothedHeavisideArtificialViscosityLaw(IShockSensor sensor, int dgDegree, double refSensorLimit, double refMaxViscosity, double kappa, double?lambdaMax = null) { this.sensor = sensor; this.dgDegree = dgDegree; this.sensorLimit = Math.Log10(refSensorLimit / (double)Math.Pow(dgDegree, 4)); this.refMaxViscosity = refMaxViscosity; this.kappa = kappa; this.lambdaMax = lambdaMax; }
/// <summary> /// Returns a cell mask containing all cells that are considered shock /// if the sensor limit is given <paramref name="sensorLimit"/> /// </summary> /// <returns></returns> public static CellMask GetShockedCellMask(this IShockSensor sensor, IGridData gridData, double sensorLimit, double cellSize, int dgDegree) { BitArray shockedCellArray = new BitArray(gridData.iLogicalCells.NoOfLocalUpdatedCells); for (int i = 0; i < gridData.iLogicalCells.NoOfLocalUpdatedCells; i++) { double sensorValue = sensor.GetSensorValue(i); shockedCellArray[i] = sensorValue > (sensorLimit * cellSize / dgDegree); } return(new CellMask(gridData, shockedCellArray)); }
/// <summary> /// Constructor /// </summary> /// <param name="sensor"> /// Some shock sensor /// </param> /// <param name="dgDegree"> /// Approximation degree of the field to which the given /// <paramref name="sensor"/> is applied /// </param> /// <param name="refSensorLimit"> /// Base value of the sensor limit (before scaling) that defines the /// amount of AV to be used. More precisely, this values defines the /// center of smooth Heaviside approximation (i.e., exactly half of the /// specified maximum <paramref name="refMaxViscosity"/> will be /// applied for the given sensor value) /// </param> /// <param name="refMaxViscosity"> /// Base value of the maximum viscosity (before scaling) that should be /// used in shocked cells. /// </param> /// <param name="kappa"> /// Width (in terms of "range of sensor values") of the smoothed /// transition zone between full AV and no AV /// </param> /// <param name="lambdaMax"> /// Optional: Additional scaling coefficient for the AV. If none is /// given, an estimate will be used according the local flow state /// </param> /// <param name="fudgeFactor"> /// Correction factor, typically set to 0.5 for the compressible Euler equations (Kloeckner et al. 2011) /// </param> public SmoothedHeavisideArtificialViscosityLaw(IShockSensor sensor, int dgDegree, double refSensorLimit, double refMaxViscosity = 1.0, double kappa = 0.5, double?lambdaMax = null, double?fudgeFactor = null) { this.sensor = sensor; this.dgDegree = dgDegree; this.sensorLimit = Math.Log10(refSensorLimit / (double)Math.Pow(dgDegree, 4)); Debug.Assert(!double.IsNaN(this.sensorLimit), "Sensor limit is NaN"); this.refMaxViscosity = refMaxViscosity; this.kappa = kappa; this.lambdaMax = lambdaMax; this.fudgeFactor = fudgeFactor; }