Boundary Condition Input¶
A number of different methods of applying boundary conditions are provided.
Besides specifying constant scalar, vector, or tensor values as value="..." [phase=""]
,
you can prescribe field values from other PDEs, previous simulations, or other external sources.
Just use the corresponding XML tags within the boundary condition tag.
Below, you can find a description of some of the available methods.
fileData¶
<fileData>
can be used to define the right-hand side vector nodal quantities. For this purpose, one needs to provide a dat-file with node numbers and corresponding RHS values.
This input is only tested for right-hand side nodal values, like nodal forces in mechanics (<force>
in MechPDE). Dirichlet BC in MechPDE was proven not to work correctly with it.
For further information, please refer to the test case. It can be found here. This folder represents how to load element-number based rhs from text file. The file is generated by create_data_file.py.
- Here, we have spacial dependent rhs (for mech-heat problem)
- In data file excitation example
-We need to know the element numbers for the named nodes
inclusion_nodes
- we could use make_mesh.py from NodalForceExpression and make use of the stored mesh.bc
- In this example: assume
performed, where the
-g
creates the .cfs file without parsing the pdes. Then use create_data_file.py
To use the generated .dat file as RHS, refer to the lines in NodalDataFile.xml
grid¶
The <grid>
input allows specifying inhomogeneous Dirichlet BC.
One may use the output results of openCFS (.cfs
) as input for another model.
Another possible application would be to modify the openCFS result file (with python script) and specify needed BC manually for each node. For this purpose, a "fake" results file should be generated, modified, and finally applied as a BC to the matching model using the following code structures.
<displacement name="V_plate">
<grid dofs="all">
<defaultGrid quantity="mechDisplacement" dependtype="GENERAL">
<globalFactor>1</globalFactor>
</defaultGrid>
</grid>
</displacement>
The grid input can be used e.g. as <displacement>
BC in SmoothPDE and MechPDE.
sequenceStep¶
One can appy this to incorporate boundary conditions according to system state calculated in a previous step. This is especially useful when solving a forward coupled system, such as a typical heat-mechanics problem. Another example can be found for an electrostatic capacitor.
<bcsAndLoads>
<thermalStrain name="S_beam">
<sequenceStep index="1">
<quantity name="heatTemperature" pdeName="heatConduction"/>
<timeFreqMapping>
<constant step="1"/>
</timeFreqMapping>
</sequenceStep>
</thermalStrain>
</bcsAndLoads>
externalSimulation¶
Perform first a simulation run (e.g. a transient one) where allowPostProc
-status is set. This activates saving of all data, in order to postprocess data afterwards.
<analysis>
<transient>
<numSteps>5</numSteps>
<deltaT>1e-3</deltaT>
<allowPostProc>yes</allowPostProc>
</transient>
</analysis>
Within the next simulation in a first multisequence step forces of the previous simulation can be applied as force density on the RHS of the considered PDE. Calculate respective quantity from the previous simulation run and apply it as force term on the RHS.
<bcsAndLoads>
<forceDensity name="plateV">
<externalSimulation inputId="input" sequenceStep="1">
<quantity name="magForceLorentzDensity" pdeName="magneticEdge"/>
<timeFreqMapping>
<continuous interpolation="linear" />
</timeFreqMapping>
</externalSimulation>
</forceDensity>
</bcsAndLoads>
Examples can be found here