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

Java with CCM+

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   October 4, 2013, 02:27
Default
  #5
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,695
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Quote:
Originally Posted by crevoise View Post
You are calling the class 'MixtureComponentManager'
How do you know the existence of this class? Is there somewhere a list of all the available classes available in CCM+?
The STARCCM installation contains the javadocs for its API. The descriptions are not exactly complete, but should provide you with enough information. The subdirectory: star/lib/doc/client/html/

Quote:
a/ clearing sim_ : Is it important to all time do so before starting a java script?
This is not needed, but I think it is good style.

Quote:
b/ declaring the string varaible Physic_name defined by the continuum.
If there are several continuum defined, how does this will work?
This only works for the case that you posed. If the continuum is named differently, or if there are more of them that you want to clear, you'll have a problem. If you want to loop over all possible physics continua, you'd need something like this:

Code:
ContinuumManager contMgr = sim_.getContinuumManager();
 
for (PhysicsContinuum cont: contMgr.getObjectsOf(PhysicsContinuum.class))
{
    ModelManager mdlMgr = cont.getModelManager()
 
    try
    {
        MixtureComponentManager gasMixMgr = mdlMgr
            .getModel(MultiComponentGasModel.class).getMixture().getComponents();
        gasMixMgr.deleteChildren(gasMixMgr.getComponents());
    }
    catch (Exception ex)
    {}
}
Note that we stuff the interesting bits inside of a try/catch grouping. This makes it failsafe for continua that are not actually gas mixtures.


Quote:
@Override
public void execute() etc....

*******************
c/ What is the use of @Override ?
This somewhat pedantic. It works equally well without this annotation. However, the StarMacro already provides an empty 'execute' method that we are overriding and the @Override annotation documuments this.
olesen is offline   Reply With Quote

 

Tags
ccm+, java


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
problem when imported geometry from 3D CAD to star ccm, TAREK GANAT STAR-CCM+ 1 May 21, 2013 22:15
Macro to access java files in sub-directory abraum STAR-CCM+ 3 July 11, 2012 02:46
Fluent Vs Star CCM firda Main CFD Forum 3 February 26, 2011 02:51
error in star ccm maurizio Siemens 3 October 16, 2007 05:17
Getting OpenFOAM to coexist with an existing JAVA VM nik777 OpenFOAM Installation 5 February 22, 2007 07:21


All times are GMT -4. The time now is 20:23.