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

Java Macro -- Passive Pith in Superposing Rotation Motion

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 3, 2018, 08:41
Question Java Macro -- Passive Pith in Superposing Rotation Motion
  #1
New Member
 
Weidong Dai
Join Date: Oct 2016
Location: Edinburgh, Scotland, UK
Posts: 9
Rep Power: 9
Weidong Dai is on a distinguished road
Hi everyone,

I met a problem. There is a blade actively rotating in Y direction ('Rotation'), however it will passively rotate ('Pitch') in Z direction. ('Pitch' axis will change based on time). You can find the geometry in attached file.

The idea is using Rotation motion for 'Rotation'and Superposing Motion for 'Pitch' at the same time. Here is a java code to calculate 'Pitch' rotation rate but it does not work. But if I use it to change the rotation rate for 'Rotation', it works. So I think there might be something wrong when I try to read information for 'Pitch', '' SuperposingRotatingMotion rotation =(SuperposingRotatingMotion) sim. get(SuperposingMotionManager.class).getObject("Pit ch"); '' When I used it, it will show 'Manager is not found in ManagerManager'.

I just wonder if any of you meet similar problem or you know how to fix this. Thank you very much.

Cheers,
Weidong Dai



**************************************************
Code:

package macro;

import star.base.report.Report;
import star.common.ImplicitUnsteadySolver;
import star.common.PhysicalTimeStoppingCriterion;
import star.common.Simulation;
import star.common.StarMacro;
import star.motion.MotionManager;
import star.motion.RotatingMotion;
import star.motion.SuperposingMotionManager;
import star.motion.SuperposingRotatingMotion;

public class PitchRate extends StarMacro {

public void execute() {
Simulation sim = getActiveSimulation();

//RotatingMotion rotation = (RotatingMotion) sim.get(MotionManager.class).getObject("Rotation") ; // if I use this line, it will work and change the rotation rate for 'Rotation'

SuperposingRotatingMotion rotation =(SuperposingRotatingMotion) sim. get(SuperposingMotionManager.class).getObject("Pit ch"); // If I use this to change the 'Pitch' rate, it did not work.

Report torqueReport = sim.getReportManager().getReport("TorqueReport"); // torque report

PhysicalTimeStoppingCriterion maxTimeStoppingCriterion = (PhysicalTimeStoppingCriterion) sim.getSolverStoppingCriterionManager().getSolverS toppingCriterion("Maximum Physical Time");

double rotationRate = 0;
double timeStep = ((ImplicitUnsteadySolver) sim.getSolverManager().getSolver(ImplicitUnsteadyS olver.class)).getTimeStep().getValue();

do {
if(sim.getSolution().getPhysicalTime()>0) {
double currentTorque = torqueReport.getReportMonitorValue();
rotationRate = rotationRate+currentTorque/10000*timeStep;
rotation.getRotationRate().setValue(rotationRate);
}
sim.getSimulationIterator().step(1);

} while(!maxTimeStoppingCriterion.getIsSatisfied());
}
}
************************************************** ******
Attached Images
File Type: png Capture1.PNG (63.9 KB, 4 views)
File Type: png Capture.PNG (15.0 KB, 2 views)
Attached Files
File Type: docx java.docx (13.7 KB, 3 views)
Weidong Dai is offline   Reply With Quote

Old   August 3, 2018, 08:43
Default
  #2
New Member
 
Weidong Dai
Join Date: Oct 2016
Location: Edinburgh, Scotland, UK
Posts: 9
Rep Power: 9
Weidong Dai is on a distinguished road
Hi everyone

I forgot to say, the code is from abdul099.

Error: Cycle detected in field function.

Cheers~
Weidong Dai

Last edited by Weidong Dai; August 3, 2018 at 10:06.
Weidong Dai is offline   Reply With Quote

Old   August 4, 2018, 05:39
Default
  #3
New Member
 
Weidong Dai
Join Date: Oct 2016
Location: Edinburgh, Scotland, UK
Posts: 9
Rep Power: 9
Weidong Dai is on a distinguished road
Hi guys

I figured out how to do it today. You need to claim 'rotation' first and say 'pitch' is a sub file of 'rotation' . The code should be like:


RotatingMotion rotation = (RotatingMotion) sim.get(MotionManager.class).getObject("Rotation") ;

SuperposingRotatingMotion pitch =(SuperposingRotatingMotion) rotation.getSuperposingMotionManager().getObject(" Pitch");


Hope you guys will think it is useful.

And now I am working on adding a torsional spring for the passive pitch, if you guys know how to deal with this, be free to leave comments.

Cheers
Weidong Dai
Weidong Dai is offline   Reply With Quote

Reply

Tags
macro, managermanager, passive, star-ccm+, superposing

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
How to use "translation" in solidBodyMotionFunction in OpenFOAM rupesh_w OpenFOAM Running, Solving & CFD 5 August 16, 2016 04:27
External management of solid motion (using dynamicmesh) maxou1993 Main CFD Forum 0 July 28, 2015 11:37
3DOF DFBI motion can not record the rotation Scabbard STAR-CCM+ 1 April 20, 2015 11:45
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20
Mesh motion with Translation & Rotation Doginal CFX 2 January 12, 2014 06:21


All times are GMT -4. The time now is 11:31.