CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   STAR-CCM+ (https://www.cfd-online.com/Forums/star-ccm/)
-   -   set boundary condirions by using java macro (https://www.cfd-online.com/Forums/star-ccm/151248-set-boundary-condirions-using-java-macro.html)

marwan89 April 7, 2015 10:07

set boundary condirions by using java macro
 
hi guys. My advisor asked me to learn how to use java macro in Star CCM+.to be honest I have no clue and am running out of time. Can you guys give me some advises about that. like how to learn it and what is the best and fast way to do it.

kguntur April 8, 2015 02:36

the best way to learn is to record and edit it.
start recording a java, do what you want to do normally, and then edit the java. This is the easiest way to create and learn java macros.

marwan89 April 8, 2015 08:38

Quote:

Originally Posted by kguntur (Post 540467)
the best way to learn is to record and edit it.
start recording a java, do what you want to do normally, and then edit the java. This is the easiest way to create and learn java macros.



thanks for your reply.but as i said i have no idea about that. i mean i know how to record but editing is not easy for me. what i am trying to do is using an equation to control the boundary condition in the inlet and the outle.can u give me an idea how to do it?

kguntur April 9, 2015 02:43

jus a thought.... if you are trying to use an equation to control the boundary condition, then may be you can use field functions instead of a macro.

if you have to use java for some reason, use netbeans or something similar to edit your java codes... it makes life a bit easier. netbeans is a free software you can download and go through this thread for more details.

ggulgulia April 9, 2015 08:03

hey marwan

Install notepad ++ and net beans. Firstly open any of the recorded macros in notepad ++. Notepad ++ is interactive in terms of usage and understanding various lines of codes. However you will not be able to debug the code in case of any errors in notepad++ , nor that notepad ++ will be able to detect any errors. To debug, you should have a fair idea of java syntax too.

To learn java, you should enroll in one of the courses offered by edx (www.edx.org) Here you will learn how to code in java which you will find helpful when coding for STAR CCM+ routines . One of these course has started on 6th april and another one is due to start on 28th april.

The basic fact you should keep in mind while working with STAR CCM+ java is that STAR CCM+ has its own libraries for java which will not be identified by a standard editor such as Net Beans or Eclipse. To get the java editor recognize the star ccm+ recorded macro, you should import the ccm+ libraries in the editor. You will find more info about this on the ccm+ manual.

You will pick up speed once you understand Java in general and star ccm+ java syntax in specific.

ccm+ manual has some very good examples on how to create user input panels when running java codes, which is very useful to feed in the data to ccm+ while doing pre-processing and post-processing.

Hope this was helpful

marwan89 April 9, 2015 10:43

thanks ggulgulia
.I really appreciate these information. I am gonna try to enroll in one of these courses u mentioned.Also,if u meant by manual the tutorials on cd-adapco website , I tried to understand them but i couldn't due to lack of info in Java in general

marwan89 April 9, 2015 10:45

kguntur , thanks again. I thought the same thing in the beginning but my advisor told me to learn Java so I can use equations to control the boundary conditions. and as I said I am not that experience with these things so I am just trying to do what he asked me.

ggulgulia April 9, 2015 12:53

Hi Marwan

by the manual i meant the STAR CCM+ help manual or the documentation. I found the code for generating the command window there. You will get it if you go through the manual carefully


All times are GMT -4. The time now is 05:02.