|
[Sponsors] |
Initial and Boundary Conditions in the .C File |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 28, 2020, 05:56 |
Initial and Boundary Conditions in the .C File
|
#1 |
New Member
Mohammad Khojastehmehr
Join Date: Jul 2020
Posts: 20
Rep Power: 6 |
Hey everybody Hope you are doing great!
I wanted to write a program in which the initial and boundary conditions for the fields depend on some initial calculations. At first, I thought it would be a good idea to write a C++ program that reads and edits the files in the 0 the folder; then I figured out it is not that easy; so I came to the conclusion that it might be best to try this method but I'm not quite sure yet: I decided to define the fields in the main file. Is there any way to create a volVectorField or volScalarField in the .C file with defined boundary and initial condition? For example, I want to have something like this in my .C file: Code:
/*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 7 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object eps; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 0 0 0 0 0]; internalField nonuniform List<scalar> 10 ( 0.154467036866835 0.162033854429180 0.135407628800740 0.165665945521539 0.150504310464983 0.163532375941872 0.134619297472226 0.163464960781439 0.147743669796071 0.146223849079981 ); boundaryField { inlet { type zeroGradient; } outlet { type zeroGradient; } fixedWalls { type zeroGradient; } } // ************************************************************************* // Mohammad |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Suppress twoPhaseEulerFoam energy | AlmostSurelyRob | OpenFOAM Running, Solving & CFD | 33 | September 25, 2018 18:45 |
HeatSource BC to the whole region in chtMultiRegionHeater | xsa | OpenFOAM Running, Solving & CFD | 3 | November 7, 2016 06:07 |
simpleFoam error - "Floating point exception" | mbcx4jc2 | OpenFOAM Running, Solving & CFD | 12 | August 4, 2015 03:20 |
Micro Scale Pore, icoFoam | gooya_kabir | OpenFOAM Running, Solving & CFD | 2 | November 2, 2013 14:58 |
Error finding variable "THERMX" | sunilpatil | CFX | 8 | April 26, 2013 08:00 |