CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > Siemens

Java Macro to change rigid body degree of freedom during the simulation

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 9, 2015, 06:59
Default Java Macro to change rigid body degree of freedom during the simulation
  #1
Member
 
Ahmed Elhanfi
Join Date: Nov 2014
Posts: 30
Rep Power: 12
Ahmed Elhanafi is on a distinguished road
Hi Everyone,

I'm looking for a way to enable/disable one degree of freedom in DFBI in Star-CCM+. I tried using Java macro to do this for me after a certain time, but it didn't work. This is what I used:

// STAR-CCM+ macro: DFBI.java
// Written by STAR-CCM+ 10.02.010
package macro;

import java.util.*;

import star.common.*;
import star.base.neo.*;
import star.sixdof.*;

public class DFBI extends StarMacro {

public void execute() {
execute0();
}

private void execute0() {

Simulation simulation_0 =
getActiveSimulation();


PhysicalTimeStoppingCriterion physicalTimeStoppingCriterion_0 =
((PhysicalTimeStoppingCriterion) simulation_0.getSolverStoppingCriterionManager().g etSolverStoppingCriterion("Maximum Physical Time"));

if (simulation_0.getSolution().getPhysicalTime()>0.2)


{Body body_0 =
((Body) simulation_0.get(BodyManager.class).getObject("Bod y 1"));

((BodyFreeMotion) body_0.getMotionType()).setFreeTranslationX(false) ;}
}
}


I hope you can help me.

Cheers,

Ahmed.
Ahmed Elhanafi is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Rigid body solution or Immersed solid omidiut CFX 1 July 3, 2012 03:36
Degree of freedom in free surface simulation ? eee CFX 1 September 23, 2010 19:25
degree of freedom ztdep Main CFD Forum 1 January 12, 2009 09:16
6 Degree of Freedom Navier Stoke Equations Apollo Main CFD Forum 6 July 21, 2004 17:46
6 Degree of Freedom Navier Stoke Equations Apollo FLUENT 0 July 5, 2004 06:34


All times are GMT -4. The time now is 09:56.