forked from 1b-agent/fieldcraft-upstream
decks: ties as Abaqus *TIE and LS-DYNA tied contact
Nastran refuses them by name. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01UhhZMBTviDQxZvwnyP89fo
This commit is contained in:
1 parent
7e9366f726
commit
794aa9f158
4 files changed
+48
-2
No files matched your search
@@ -28,6 +28,11 @@
|
||||
//! initial overclosure have no Abaqus counterpart and are noted in comments (Abaqus chooses its
|
||||
//! own penalty and resolves overclosure in the first increment).
|
||||
//!
|
||||
//! # Ties
|
||||
//!
|
||||
//! Each tie is `*TIE, NAME=…, ADJUST=NO` with the secondary surface first and its position
|
||||
//! tolerance when it has one: FieldCraft ties the nodes where they are (no adjustment).
|
||||
//!
|
||||
//! # Steps and the activity table
|
||||
//!
|
||||
//! The model lists, for every step, exactly the boundary conditions and loads active in it; Abaqus
|
||||
@@ -187,6 +192,7 @@ pub fn write_resolved(model: &Model, r: &Resolved) -> Result<String> {
|
||||
d.discrete_properties(&discrete)?;
|
||||
d.couplings(model, r);
|
||||
d.contacts(model, r)?;
|
||||
d.ties(model)?;
|
||||
d.steps(model, r)?;
|
||||
Ok(d.out)
|
||||
}
|
||||
@@ -1042,6 +1048,20 @@ impl Deck {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Ties: `*TIE` per tie, secondary surface first.
|
||||
fn ties(&mut self, model: &Model) -> Result<()> {
|
||||
if model.ties().is_empty() {
|
||||
return Ok(());
|
||||
}
|
||||
self.comment("Ties: each secondary surface bonded to its main surface");
|
||||
for (name, t) in model.ties() {
|
||||
let tolerance = t.position_tolerance.map_or(String::new(), |v| format!(", POSITION TOLERANCE={v:?}"));
|
||||
self.line(&format!("*TIE, NAME={name}, ADJUST=NO{tolerance}"));
|
||||
self.line(&format!("{}, {}", t.secondary, t.main));
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn boundary_lines<'n>(&mut self, model: &Model, r: &Resolved, names: impl IntoIterator<Item = &'n String>) -> Result<()> {
|
||||
for name in names {
|
||||
let Some(bc) = model.boundary_condition(name) else { continue };
|
||||
|
||||
@@ -23,7 +23,8 @@
|
||||
//! node set), distributing as `*CONSTRAINED_INTERPOLATION` (the reference point dependent on
|
||||
//! the set's translations, equal weights);
|
||||
//! - contact: a pair as `*CONTACT_AUTOMATIC_SURFACE_TO_SURFACE` between segment sets (the
|
||||
//! secondary surface first), general contact as `*CONTACT_AUTOMATIC_SINGLE_SURFACE` on a segment
|
||||
//! secondary surface first; a tie as `*CONTACT_TIED_SURFACE_TO_SURFACE` likewise), general
|
||||
//! contact as `*CONTACT_AUTOMATIC_SINGLE_SURFACE` on a segment
|
||||
//! set or on every part (`surfatyp` 5); the static and kinetic coefficients and the decay
|
||||
//! coefficient (`fs`, `fd`, `dc`: the same exponential decay law) and the penalty scale on both
|
||||
//! sides (`sfsa`, `sfsb`, a factor on LS-DYNA's own default stiffness). LS-DYNA moves nodes
|
||||
@@ -280,6 +281,9 @@ fn plan<'a>(model: &'a Model, r: &Resolved) -> Result<Plan<'a>> {
|
||||
for c in model.contacts().values() {
|
||||
segment_sets.extend(c.surfaces.sets());
|
||||
}
|
||||
for t in model.ties().values() {
|
||||
segment_sets.extend([t.main.as_str(), t.secondary.as_str()]);
|
||||
}
|
||||
let mut gravity_sets: BTreeSet<Option<&str>> = BTreeSet::new();
|
||||
for step in model.steps() {
|
||||
if matches!(step.procedure, Procedure::ExplicitDynamic(_)) {
|
||||
@@ -733,6 +737,21 @@ fn contacts(d: &mut Deck, model: &Model, plan: &Plan) -> Result<()> {
|
||||
d.header(&["sfsa", "sfsb"]);
|
||||
d.card([Field::from(c.penalty_scale), Field::from(c.penalty_scale)]);
|
||||
}
|
||||
// Ties: a tied surface-to-surface contact between the segment sets, secondary first.
|
||||
for (name, t) in model.ties() {
|
||||
let sid = |set: &str| plan.sets.get(set).copied().ok_or_else(|| broken(format!("tie `{name}`: set `{set}`")));
|
||||
d.comment(&format!("tie `{name}`"));
|
||||
if t.position_tolerance.is_some() {
|
||||
d.comment("FieldCraft's position tolerance: LS-DYNA ties the nodes within its own search distance");
|
||||
}
|
||||
d.line("*CONTACT_TIED_SURFACE_TO_SURFACE");
|
||||
d.header(&["surfa", "surfb", "surfatyp", "surfbtyp"]);
|
||||
d.card([Field::from(sid(&t.secondary)?), Field::from(sid(&t.main)?), Field::from(0), Field::from(0)]);
|
||||
d.header(&["fs", "fd", "dc"]);
|
||||
d.card([Field::from(0.0), Field::from(0.0), Field::from(0.0)]);
|
||||
d.header(&["sfsa", "sfsb"]);
|
||||
d.card([Field::from(1.0), Field::from(1.0)]);
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
@@ -337,6 +337,9 @@ impl<'m> Deck<'m> {
|
||||
for name in self.model.contacts().keys() {
|
||||
self.problems.insert(format!("contact `{name}` (Nastran's linear solutions SOL 101 and 103 have no contact)"));
|
||||
}
|
||||
for name in self.model.ties().keys() {
|
||||
self.problems.insert(format!("tie `{name}` (this writer does not write glued contact yet)"));
|
||||
}
|
||||
for sub in &mut self.subcases {
|
||||
if matches!(sub.step.procedure, Procedure::Frequency { .. }) {
|
||||
sub.method = Some(next_id(&mut self.next_sid)?);
|
||||
|
||||
Reference in new issue
Block a user