Skip to content

Defining own coordinate systems

In openCFS you can define your own coordinate systems.

  <cylindric id="cyl1">
    <origin x="0.0" y="0.0" z="0.0"/>
    <zAxis x="0.0" y="1" z="0.0"/>
    <rAxis x="1" y="0.0" z="0.0"/>

This can be especially useful if you need cylindric coordinates inside a cartesian coordinate system. E.g. defining the current direction in a coil in a 3d-domain.

See a typical xml-input which uses a custom coordinate system
      <hdf5 id="h5"/>
      <text id="txt"/>
      <text id="txt2" fileCollect="timeFreq"/>
    <materialData file="mat.xml" format="xml"/>

  <domain geometryType="3d" printGridInfo="yes">
      <var name="depth" value="50e-3*2"/>
      <var name="radius" value="5e-3"/>
      <region name="air"  material="air"/>
      <region name="coil" material="air"/>
      <region name="core" material="air"/>
    <!-- Cylindric coordinate system for coil current -->
      <cylindric id="mid"> 
        <origin x="0" y="0" z="0"/>
        <zAxis z="1" />
        <rAxis x="1" />

  <sequenceStep index="1">
      <magneticEdge systemId="default">
          <region name="air"/>
          <region name="coil"/>
          <region name="core"/>
          <fluxParallel name="x-inner"/>
          <fluxParallel name="x-outer"/>
          <fluxParallel name="y-inner"/>
          <fluxParallel name="z-outer"/>
          <coil id="myCoil">
            <source type="current" value="1"/>
                <region name="coil"/>
                <analytic coordSysId="mid">
                  <comp dof="phi" value="1"/>
              <wireCrossSection area="2e-6"/>
              <resistance value="0"/> 
          <elemResult type="magPotential">
          <elemResult type="magFluxDensity">
              <elems name="hist" outputIds="txt2"/>
          <regionResult type="magEnergy">
            <allRegions outputIds="txt"/>

The xml-scheme from above is taken from the testsuite