Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6548fbb

Browse filesBrowse files
committed
Model improvements
- Convective heat losses now introduced in diathermic and participating medium models - Emissivity can now be output in the result format dialog
1 parent 1ce1f8e commit 6548fbb
Copy full SHA for 6548fbb
Expand file treeCollapse file tree

20 files changed

+169
-80
lines changed

‎pom.xml

Copy file name to clipboardExpand all lines: pom.xml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<groupId>kotik-coder</groupId>
55
<artifactId>PULsE</artifactId>
6-
<version>1.94F</version>
6+
<version>1.95</version>
77
<name>PULsE</name>
88
<description>Processing Unit for Laser flash Experiments</description>
99
<developers>

‎src/main/java/pulse/input/InterpolationDataset.java

Copy file name to clipboardExpand all lines: src/main/java/pulse/input/InterpolationDataset.java
+7-4Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import static pulse.properties.NumericPropertyKeyword.SPECIFIC_HEAT;
66

77
import java.util.ArrayList;
8-
import java.util.HashMap;
8+
import java.util.EnumMap;
99
import java.util.List;
1010
import java.util.Map;
1111

@@ -14,6 +14,7 @@
1414

1515
import pulse.input.listeners.ExternalDatasetListener;
1616
import pulse.properties.NumericPropertyKeyword;
17+
import static pulse.properties.NumericPropertyKeyword.EMISSIVITY;
1718
import pulse.util.ImmutableDataEntry;
1819

1920
/**
@@ -29,9 +30,10 @@
2930
public class InterpolationDataset {
3031

3132
private UnivariateFunction interpolation;
32-
private List<ImmutableDataEntry<Double, Double>> dataset;
33-
private static Map<StandartType, InterpolationDataset> standartDatasets = new HashMap<StandartType, InterpolationDataset>();
34-
private static List<ExternalDatasetListener> listeners = new ArrayList<>();
33+
private final List<ImmutableDataEntry<Double, Double>> dataset;
34+
private static final Map<StandartType, InterpolationDataset> standartDatasets
35+
= new EnumMap<StandartType, InterpolationDataset>(StandartType.class);
36+
private static final List<ExternalDatasetListener> listeners = new ArrayList<>();
3537

3638
/**
3739
* Creates an empty {@code InterpolationDataset}.
@@ -121,6 +123,7 @@ public static List<NumericPropertyKeyword> derivableProperties() {
121123
}
122124
if (list.contains(SPECIFIC_HEAT) && list.contains(DENSITY)) {
123125
list.add(CONDUCTIVITY);
126+
list.add(EMISSIVITY);
124127
}
125128
return list;
126129
}

‎src/main/java/pulse/problem/schemes/solvers/ExplicitCoupledSolver.java

Copy file name to clipboardExpand all lines: src/main/java/pulse/problem/schemes/solvers/ExplicitCoupledSolver.java
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ public void prepare(Problem problem) throws SolverException {
5656
hx = grid.getXStep();
5757

5858
var p = (ThermoOpticalProperties) problem.getProperties();
59-
double Bi = (double) p.getHeatLoss().getValue();
59+
//combined Biot
60+
double Bi = (double) p.getHeatLoss().getValue() + (double) p.getConvectiveLosses().getValue();
6061

6162
a = 1. / (1. + Bi * hx);
6263

‎src/main/java/pulse/problem/schemes/solvers/ExplicitCoupledSolverNL.java

Copy file name to clipboardExpand all lines: src/main/java/pulse/problem/schemes/solvers/ExplicitCoupledSolverNL.java
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717

1818
import pulse.problem.schemes.DifferenceScheme;
1919
import pulse.problem.schemes.FixedPointIterations;
20-
import pulse.problem.statements.ParticipatingMedium;
21-
import pulse.problem.statements.Problem;
2220
import static pulse.properties.NumericProperties.def;
2321
import static pulse.properties.NumericProperties.derive;
2422
import pulse.properties.NumericProperty;

‎src/main/java/pulse/problem/schemes/solvers/ImplicitCoupledSolver.java

Copy file name to clipboardExpand all lines: src/main/java/pulse/problem/schemes/solvers/ImplicitCoupledSolver.java
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ public void prepare(Problem problem) throws SolverException {
5858
final double tau = grid.getTimeStep();
5959

6060
var p = (ThermoOpticalProperties) problem.getProperties();
61-
final double Bi1 = (double) p.getHeatLoss().getValue();
61+
//combined Biot
62+
final double Bi1 = (double) p.getHeatLoss().getValue() + (double) p.getConvectiveLosses().getValue();
6263
final double Np = (double) p.getPlanckNumber().getValue();
6364
final double tau0 = (double) p.getOpticalThickness().getValue();
6465

‎src/main/java/pulse/problem/schemes/solvers/ImplicitCoupledSolverNL.java

Copy file name to clipboardExpand all lines: src/main/java/pulse/problem/schemes/solvers/ImplicitCoupledSolverNL.java
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717

1818
import pulse.problem.schemes.DifferenceScheme;
1919
import pulse.problem.schemes.FixedPointIterations;
20-
import pulse.problem.statements.ParticipatingMedium;
21-
import pulse.problem.statements.Problem;
2220
import static pulse.properties.NumericProperties.def;
2321
import static pulse.properties.NumericProperties.derive;
2422
import pulse.properties.NumericProperty;

‎src/main/java/pulse/problem/schemes/solvers/ImplicitDiathermicSolver.java

Copy file name to clipboardExpand all lines: src/main/java/pulse/problem/schemes/solvers/ImplicitDiathermicSolver.java
+5-4Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,12 @@ public void prepare(Problem problem) throws SolverException {
4747
/* Constants */
4848
var properties = (DiathermicProperties) problem.getProperties();
4949

50-
final double Bi1 = (double) properties.getHeatLoss().getValue();
50+
final double BiR = (double) properties.getHeatLoss().getValue();
51+
final double BiC = (double) properties.getConvectiveLosses().getValue();
5152
final double eta = (double) properties.getDiathermicCoefficient().getValue();
5253

53-
z0 = 1.0 + HX2_2TAU + hx * Bi1 * (1.0 + eta);
54-
zN_1 = -hx * eta * Bi1;
54+
z0 = 1.0 + HX2_2TAU + hx * BiR * (1.0 + eta) + hx * BiC;
55+
zN_1 = -hx * eta * BiR;
5556

5657
/* End of constants */
5758
var tridiagonal = new BlockMatrixAlgorithm(grid);
@@ -106,4 +107,4 @@ public Class<? extends Problem>[] domain() {
106107
return new Class[]{DiathermicMedium.class};
107108
}
108109

109-
}
110+
}

‎src/main/java/pulse/problem/schemes/solvers/MixedCoupledSolver.java

Copy file name to clipboardExpand all lines: src/main/java/pulse/problem/schemes/solvers/MixedCoupledSolver.java
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@ public void prepare(Problem problem) throws SolverException {
7474
hx = grid.getXStep();
7575
tau = grid.getTimeStep();
7676

77-
Bi1 = (double) problem.getProperties().getHeatLoss().getValue();
77+
var properties = (ThermoOpticalProperties)problem.getProperties();
78+
//combined biot
79+
Bi1 = (double) properties.getHeatLoss().getValue() +
80+
(double) properties.getConvectiveLosses().getValue();
7881

7982
zeta = (double) ( (ClassicalProblem)problem ).getGeometricFactor().getValue();
8083

‎src/main/java/pulse/problem/statements/DiathermicMedium.java

Copy file name to clipboardExpand all lines: src/main/java/pulse/problem/statements/DiathermicMedium.java
+27-11Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import pulse.problem.statements.model.DiathermicProperties;
1515
import pulse.problem.statements.model.ThermalProperties;
1616
import pulse.properties.Flag;
17+
import static pulse.properties.NumericPropertyKeyword.HEAT_LOSS_CONVECTIVE;
1718
import pulse.ui.Messages;
1819

1920
/**
@@ -60,17 +61,31 @@ public void optimisationVector(ParameterVector output, List<Flag> flags) {
6061
for (int i = 0, size = output.dimension(); i < size; i++) {
6162

6263
var key = output.getIndex(i);
64+
Segment bounds = null;
65+
double value = 0;
6366

64-
if (key == DIATHERMIC_COEFFICIENT) {
65-
66-
var bounds = Segment.boundsFrom(DIATHERMIC_COEFFICIENT);
67-
final double etta = (double) properties.getDiathermicCoefficient().getValue();
68-
69-
output.setTransform(i, new StickTransform(bounds));
70-
output.set(i, etta);
71-
output.setParameterBounds(i, bounds);
72-
67+
switch (key) {
68+
case DIATHERMIC_COEFFICIENT:
69+
bounds = Segment.boundsFrom(DIATHERMIC_COEFFICIENT);
70+
value = (double) properties.getDiathermicCoefficient().getValue();
71+
break;
72+
case HEAT_LOSS_CONVECTIVE:
73+
bounds = Segment.boundsFrom(HEAT_LOSS_CONVECTIVE);
74+
value = (double) properties.getConvectiveLosses().getValue();
75+
break;
76+
case HEAT_LOSS:
77+
if(properties.areThermalPropertiesLoaded()) {
78+
value = (double) properties.getHeatLoss().getValue();
79+
bounds = new Segment(0.0, properties.maxRadiationBiot() );
80+
break;
81+
}
82+
default:
83+
continue;
7384
}
85+
86+
output.setTransform(i, new StickTransform(bounds));
87+
output.set(i, value);
88+
output.setParameterBounds(i, bounds);
7489

7590
}
7691

@@ -90,9 +105,10 @@ public void assign(ParameterVector params) throws SolverException {
90105
case DIATHERMIC_COEFFICIENT:
91106
properties.setDiathermicCoefficient(derive(DIATHERMIC_COEFFICIENT, params.inverseTransform(i)));
92107
break;
108+
case HEAT_LOSS_CONVECTIVE:
109+
properties.setConvectiveLosses(derive(HEAT_LOSS_CONVECTIVE, params.inverseTransform(i)));
110+
break;
93111
default:
94-
continue;
95-
96112
}
97113

98114
}

‎src/main/java/pulse/problem/statements/model/DiathermicProperties.java

Copy file name to clipboardExpand all lines: src/main/java/pulse/problem/statements/model/DiathermicProperties.java
+27-5Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,17 @@
77
import static pulse.properties.NumericProperty.requireType;
88
import pulse.properties.NumericPropertyKeyword;
99
import static pulse.properties.NumericPropertyKeyword.DIATHERMIC_COEFFICIENT;
10+
import static pulse.properties.NumericPropertyKeyword.HEAT_LOSS_CONVECTIVE;
1011

1112
public class DiathermicProperties extends ThermalProperties {
1213

1314
private double diathermicCoefficient;
15+
private double convectiveLosses;
1416

1517
public DiathermicProperties() {
1618
super();
1719
this.diathermicCoefficient = (double) def(DIATHERMIC_COEFFICIENT).getValue();
20+
this.convectiveLosses = (double) def(HEAT_LOSS_CONVECTIVE).getValue();
1821
}
1922

2023
public DiathermicProperties(ThermalProperties p) {
@@ -23,8 +26,10 @@ public DiathermicProperties(ThermalProperties p) {
2326
? ((DiathermicProperties) p).getDiathermicCoefficient()
2427
: def(DIATHERMIC_COEFFICIENT);
2528
this.diathermicCoefficient = (double) property.getValue();
29+
this.convectiveLosses = (double) property.getValue();
2630
}
2731

32+
@Override
2833
public ThermalProperties copy() {
2934
return new ThermalProperties(this);
3035
}
@@ -37,21 +42,38 @@ public void setDiathermicCoefficient(NumericProperty diathermicCoefficient) {
3742
requireType(diathermicCoefficient, DIATHERMIC_COEFFICIENT);
3843
this.diathermicCoefficient = (double) diathermicCoefficient.getValue();
3944
}
45+
46+
public NumericProperty getConvectiveLosses() {
47+
return derive(HEAT_LOSS_CONVECTIVE, convectiveLosses);
48+
}
49+
50+
public void setConvectiveLosses(NumericProperty convectiveLosses) {
51+
requireType(convectiveLosses, HEAT_LOSS_CONVECTIVE);
52+
this.convectiveLosses = (double) convectiveLosses.getValue();
53+
}
4054

4155
@Override
4256
public void set(NumericPropertyKeyword type, NumericProperty property) {
43-
if (type == DIATHERMIC_COEFFICIENT) {
44-
diathermicCoefficient = ((Number) property.getValue()).doubleValue();
45-
} else {
46-
super.set(type, property);
57+
double value = ((Number) property.getValue()).doubleValue();
58+
switch (type) {
59+
case DIATHERMIC_COEFFICIENT:
60+
diathermicCoefficient = value;
61+
break;
62+
case HEAT_LOSS_CONVECTIVE:
63+
convectiveLosses = value;
64+
break;
65+
default:
66+
super.set(type, property);
67+
break;
4768
}
4869
}
4970

5071
@Override
5172
public Set<NumericPropertyKeyword> listedKeywords() {
5273
var set = super.listedKeywords();
5374
set.add(DIATHERMIC_COEFFICIENT);
75+
set.add(HEAT_LOSS_CONVECTIVE);
5476
return set;
5577
}
5678

57-
}
79+
}

‎src/main/java/pulse/problem/statements/model/ExtendedThermalProperties.java

Copy file name to clipboardExpand all lines: src/main/java/pulse/problem/statements/model/ExtendedThermalProperties.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public ThermalProperties copy() {
6262
public void useTheoreticalEstimates(ExperimentalData c) {
6363
super.useTheoreticalEstimates(c);
6464
if (areThermalPropertiesLoaded()) {
65-
Bi3 = biot();
65+
Bi3 = radiationBiot();
6666
}
6767
}
6868

‎src/main/java/pulse/problem/statements/model/ThermalProperties.java

Copy file name to clipboardExpand all lines: src/main/java/pulse/problem/statements/model/ThermalProperties.java
+24-3Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ public void set(NumericPropertyKeyword type, NumericProperty value) {
169169
public void setHeatLoss(NumericProperty Bi) {
170170
requireType(Bi, HEAT_LOSS);
171171
this.Bi = (double) Bi.getValue();
172+
if(areThermalPropertiesLoaded()) {
173+
calculateEmissivity();
174+
}
172175
firePropertyChanged(this, Bi);
173176
}
174177

@@ -272,6 +275,7 @@ public Set<NumericPropertyKeyword> listedKeywords() {
272275
set.add(HEAT_LOSS);
273276
set.add(DENSITY);
274277
set.add(SPECIFIC_HEAT);
278+
set.add(EMISSIVITY);
275279
return set;
276280
}
277281

@@ -285,16 +289,33 @@ public NumericProperty getThermalConductivity() {
285289

286290
public void calculateEmissivity() {
287291
double newEmissivity = Bi * thermalConductivity() / (4. * Math.pow(T, 3) * l * STEFAN_BOTLZMAN);
288-
var transform = new StickTransform(new Segment(0.01, 1.0));
292+
var transform = new StickTransform(Segment.boundsFrom(EMISSIVITY));
289293
setEmissivity(derive(EMISSIVITY,
290294
transform.transform(newEmissivity))
291295
);
292296
}
293297

294-
public double biot() {
298+
/**
299+
* Calculates the radiative Biot number.
300+
* @return the radiative Biot number.
301+
*/
302+
303+
public double radiationBiot() {
295304
double lambda = thermalConductivity();
296305
return 4.0 * emissivity * STEFAN_BOTLZMAN * Math.pow(T, 3) * l / lambda;
297306
}
307+
308+
/**
309+
* Calculates the maximum Biot number at these conditions, which
310+
* corresponds to an emissivity of unity. If emissivity is non-positive,
311+
* returns the maximum Biot number defined in the XML file.
312+
* @return the maximum Biot number
313+
*/
314+
315+
public double maxRadiationBiot() {
316+
double absMax = Segment.boundsFrom(HEAT_LOSS).getMaximum();
317+
return emissivity > 0 ? radiationBiot() / emissivity : absMax;
318+
}
298319

299320
/**
300321
* Performs simple calculation of the <math><i>l<sup>2</sup>/a</i></math>
@@ -320,7 +341,7 @@ public void useTheoreticalEstimates(ExperimentalData c) {
320341
final double t0 = c.getHalfTime();
321342
this.a = PARKERS_COEFFICIENT * l * l / t0;
322343
if (areThermalPropertiesLoaded()) {
323-
Bi = biot();
344+
Bi = radiationBiot();
324345
}
325346
}
326347

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.