|
[Sponsors] |
Java Macro -- Passive Pith in Superposing Rotation Motion |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 3, 2018, 08:41 |
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 |
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()); } } ************************************************** ****** |
|
August 3, 2018, 08:43 |
|
#2 |
New Member
Weidong Dai
Join Date: Oct 2016
Location: Edinburgh, Scotland, UK
Posts: 9
Rep Power: 9 |
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. |
|
August 4, 2018, 05:39 |
|
#3 |
New Member
Weidong Dai
Join Date: Oct 2016
Location: Edinburgh, Scotland, UK
Posts: 9
Rep Power: 9 |
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 |
|
Tags |
macro, managermanager, passive, star-ccm+, superposing |
|
|
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 |