1   /* Copyright 2002-2025 CS GROUP
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.models.earth.atmosphere;
18  
19  import org.hipparchus.geometry.euclidean.threed.Vector3D;
20  import org.junit.jupiter.api.Assertions;
21  import org.junit.jupiter.api.BeforeEach;
22  import org.junit.jupiter.api.Test;
23  import org.orekit.Utils;
24  import org.orekit.bodies.OneAxisEllipsoid;
25  import org.orekit.frames.Frame;
26  import org.orekit.frames.FramesFactory;
27  import org.orekit.frames.Transform;
28  import org.orekit.time.AbsoluteDate;
29  import org.orekit.utils.IERSConventions;
30  
31  
32  public class SimpleExponentialAtmosphereTest {
33  
34      @Test
35      public void testExpAtmosphere() {
36          Vector3D posInEME2000 = new Vector3D(10000, Vector3D.PLUS_I);
37          AbsoluteDate date = AbsoluteDate.J2000_EPOCH;
38          Frame itrf = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
39          SimpleExponentialAtmosphere atm =
40              new SimpleExponentialAtmosphere(new OneAxisEllipsoid(Utils.ae, 1.0 / 298.257222101, itrf),
41                                              0.0004, 42000.0, 7500.0);
42          Vector3D vel = atm.getVelocity(date, posInEME2000, FramesFactory.getEME2000());
43  
44          Transform toBody = FramesFactory.getEME2000().getTransformTo(itrf, date);
45          Vector3D test = Vector3D.crossProduct(toBody.getRotationRate(), posInEME2000);
46          test = test.subtract(vel);
47          Assertions.assertEquals(0, test.getNorm(), 2.9e-5);
48  
49      }
50  
51      @BeforeEach
52      public void setUp() {
53          Utils.setDataRoot("regular-data");
54      }
55  
56  }