|
[Sponsors] |
December 12, 2015, 08:22 |
user defined variables
|
#1 |
New Member
Lluís M. Biscarri
Join Date: Nov 2011
Posts: 24
Rep Power: 14 |
Hi foamers,
I'm trying to create parametrized meshes using blockMesh and snappyHexMesh. Is it possible to define user variables at the beggining of blockMeshDict and snappyHexMeshDict, and then to use them in algebraic expressions to input the values of meshing parameters? Can somebody explain me how? Thank you very much, Lluis |
|
June 12, 2021, 07:29 |
|
#2 |
Member
Giles Richardson
Join Date: Jun 2012
Location: Cambs UK
Posts: 98
Rep Power: 13 |
good question - did you find a way to do this?
|
|
June 16, 2021, 11:59 |
|
#3 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 668
Rep Power: 14 |
You can define the variables in a separate file, and then include them at the top of the blockMesh and snappyHexMesh dictionaries with an #include command, remembering that the path is relative to the location of the dictionary.
For example, in your case folder, create a folder called include, and in that folder create a file variables, eg: Code:
/*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: dev \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class IOobject; location "include"; object variables; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // U0 3.0; p0 0.0; k0 0.8; eps0 0.03; Code:
#include "../include/variables" |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
User defined time step - Possible to put variable time stepping in it? | maccheese | Fluent UDF and Scheme Programming | 19 | June 4, 2018 09:49 |
User defined heat source | redwanamit034 | STAR-CCM+ | 2 | April 6, 2018 10:00 |
[General] Paraview User defined view | prapanj | ParaView | 3 | January 3, 2014 20:54 |
user defined turbulence model | manuutin | STAR-CD | 5 | October 14, 2009 05:29 |
User Defined Scalars - Returning Values | Carlos V. | FLUENT | 0 | April 19, 2006 18:18 |