1   /* Copyright 2022-2025 Luc Maisonobe
2    * Licensed to CS GROUP (CS) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * CS licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *   http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package org.orekit.forces;
18  
19  import org.hipparchus.CalculusFieldElement;
20  import org.hipparchus.geometry.euclidean.threed.FieldVector3D;
21  import org.hipparchus.geometry.euclidean.threed.Vector3D;
22  import org.orekit.propagation.FieldSpacecraftState;
23  import org.orekit.propagation.SpacecraftState;
24  
25  /** Base class representing one panel of a satellite.
26   * @see FixedPanel
27   * @see PointingPanel
28   * @see SlewingPanel
29   * @author Luc Maisonobe
30   * @since 3.0
31   */
32  public abstract class Panel {
33  
34      /** Area in m². */
35      private final double area;
36  
37      /** Indicator for double-sided panels (typically solar arrays). */
38      private final boolean doubleSided;
39  
40      /** Drag coefficient. */
41      private final double drag;
42  
43      /** Drag lift ratio. */
44      private final double liftRatio;
45  
46      /** Radiation pressure absorption coefficient. */
47      private final double absorption;
48  
49      /** Radiation pressure specular reflection coefficient. */
50      private final double reflection;
51  
52      /** Simple constructor.
53       * <p>
54       * As the sum of absorption coefficient, specular reflection coefficient and
55       * diffuse reflection coefficient is exactly 1, only the first two coefficients
56       * are needed here, the third one is deduced from the other ones.
57       * </p>
58       * @param area panel area in m²
59       * @param doubleSided if true, the panel is double-sided (typically solar arrays),
60       * otherwise it is the side of a box and only relevant for flux coming from its
61       * positive normal
62       * @param drag drag coefficient
63       * @param liftRatio drag lift ratio (proportion between 0 and 1 of atmosphere modecules
64       * that will experience specular reflection when hitting spacecraft instead
65       * of experiencing diffuse reflection, hence producing lift)
66       * @param absorption radiation pressure absorption coefficient (between 0 and 1)
67       * @param reflection radiation pressure specular reflection coefficient (between 0 and 1)
68       */
69      protected Panel(final double area, final boolean doubleSided,
70                      final double drag, final double liftRatio,
71                      final double absorption, final double reflection) {
72          this.area        = area;
73          this.doubleSided = doubleSided;
74          this.drag        = drag;
75          this.liftRatio   = liftRatio;
76          this.absorption  = absorption;
77          this.reflection  = reflection;
78      }
79  
80      /** Get panel area.
81       * @return panel area
82       */
83      public double getArea() {
84          return area;
85      }
86  
87      /** Check if the panel is double-sided (typically solar arrays).
88       * @return true if panel is double-sided
89       */
90      public boolean isDoubleSided() {
91          return doubleSided;
92      }
93  
94      /** Get drag coefficient.
95       * @return drag coefficient
96       */
97      public double getDrag() {
98          return drag;
99      }
100 
101     /** Get drag lift ratio.
102      * @return drag lift ratio
103      */
104     public double getLiftRatio() {
105         return liftRatio;
106     }
107 
108     /** Get radiation pressure absorption coefficient.
109      * @return radiation pressure absorption coefficient
110      */
111     public double getAbsorption() {
112         return absorption;
113     }
114 
115     /** Get radiation pressure specular reflection coefficient.
116      * @return radiation pressure specular reflection coefficient
117      */
118     public double getReflection() {
119         return reflection;
120     }
121 
122     /** Get panel normal in spacecraft frame.
123      * @param state current spacecraft state
124      * @return panel normal in spacecraft frame
125      */
126     public abstract Vector3D getNormal(SpacecraftState state);
127 
128     /** Get panel normal in spacecraft frame.
129      * @param <T> type of the field elements
130      * @param state current spacecraft state
131      * @return panel normal in spacecraft frame
132      */
133     public abstract <T extends CalculusFieldElement<T>> FieldVector3D<T> getNormal(FieldSpacecraftState<T> state);
134 
135 }