Community
CFD Forum
Welcome to Autodesk’s CFD Forums. Share your knowledge, ask questions, and explore popular CFD topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Python and Mesh Enhancement

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
RAALVM
494 Views, 4 Replies

Python and Mesh Enhancement

Hi,

 

I am trying to do a case study to see how mech enhancement can modify the results. I am writing a python script to generate designs and scenarios, but I have trouble in finding which is the property of the Scenario for layer gradation when it is not automatic.

I have found the Number of layers, layer factor, and also automaticLayerAdaptation which is a string On Off but if I have a layer gradatio of 1.2 what is the property which should I set?

 

Thanks for help

4 REPLIES 4
Message 2 of 5
Royce_adsk
in reply to: RAALVM

I don't believe that settings was available yet in the API.

 

You could use this flag: mesh_enhance_gradation

 

To set flags with the API refer to the code below:

 

 

def SetFlags(flagsList = None):
	# ""
	# flagsList = {flagName:Value,flagName2:Value}
	# ""
	if flagsList == None:
		CFD.DSE.UI.ShowMessage("Error: Needs Flags when using SetFlags")
	else:
		tempDir = tempfile.gettempdir()
		fileName = tempDir +"\\qtScript.script"
		try:
			f = open(fileName, "w")
			try:
				f.write("study = new DesignStudy;\n")
				f.write("scenario = study.activeScenario();\n")
				
				for flag in flagsList:
					f.write("scenario.addFlag(\"" + flag + "\"," + str(flagsList[flag]) + ", 0);\n")
			except:
				CFD.DSE.UI.ShowMessage("Error: Writing to: " + fileName)
			finally:
				f.close()
		except IOError:
			CFD.DSE.UI.ShowMessage("Error: Creating file: " + fileName)
			pass
		DSE.UI.ExecuteQtScript(fileName)	

 

 



Royce.Abel
Technical Support Manager

Message 3 of 5
RAALVM
in reply to: Royce_adsk

Thanks,

But I have observed that the flag mesh_enhance_gradation has the same value as enhancementStretching property of Scenario could be the same?

Message 4 of 5
RAALVM
in reply to: Royce_adsk

Some quick questions about the mesh_enhance falgs:

 

mesh_enhance_thick  I think it should be Layer Factor from Enhancement but the flag has values of 100 and in the layer factor I have values of 0.45 till 1.2

 

When these flags are applyed on the study, because I have manually modified the mesh_enhance_gradation and if I open the Boundary Mesh Engancement dialog box nothing is changed.

 

I presume that a value of 1 in mesh_enhance_gradation should account for the Auto value of Layer Gradation in the dialog box.

 

Thanks for help.

Message 5 of 5
Royce_adsk
in reply to: RAALVM

That flag doesn't change the UI, it just overrides the setting in the UI at the mesher executable level.



Royce.Abel
Technical Support Manager

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report