CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   STAR-CCM+ (https://www.cfd-online.com/Forums/star-ccm/)
-   -   Generate mesh in batch (https://www.cfd-online.com/Forums/star-ccm/109130-generate-mesh-batch.html)

rks171 November 9, 2012 19:44

Generate mesh in batch
 
Is it possible in starccm+ to setup all the modeling choices that I want for making a mesh and then to do the meshing in batch instead of interactive mode? The geometry I'm meshing is very complex and meshing takes many hours. I would rather if I could submit the job to the job-queuing system on one of our clusters instead of tying up an interactive node. Furthermore, the computer that I would like to mesh on may not be able to open up a GUI. If this is possible, what is the command that I have to give on the command line?

cfdguy November 11, 2012 10:43

Does this small macro help?

Code:

package macro;

import java.util.*;

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

public class MeshAndSave extends StarMacro {

  public void execute() {
    execute0();
  }

  private void execute0() {

    Simulation sim = getActiveSimulation();

    MeshPipelineController msh = sim.get(MeshPipelineController.class);

    msh.generateSurfaceMesh();
   
    msh.generateVolumeMesh();
   
    sim.saveState("mesh.sim");

  }
 
}


rks171 November 12, 2012 15:19

I didn't think of using a macro. So how do I start starccm+ and then execute this macro on startup from the command line?

olauer November 13, 2012 04:22

Did you ever read the manual?

Try
starccm+ -batch name.java case.sim

rks171 November 13, 2012 08:32

Yep, I must of missed that somehow in that brief 11,000 page read, but thanks for pointing it out for me.


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