|
[Sponsors] |
Calculating the drag coefficient at each time step |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 13, 2022, 12:56 |
Calculating the drag coefficient at each time step
|
#1 |
New Member
Vijay
Join Date: Feb 2020
Posts: 7
Rep Power: 6 |
Hello All,
I want to calculate drag coefficient at each time step on front face of each obstacle (here 6 buildings). Here is my blockMesh 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 dictionary; object blockMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // convertToMeters 1; vertices ( (0 0 0) (200 0 0) (200 150 0) (0 150 0) (0 0 250) (200 0 250) (200 150 250) (0 150 250) ); blocks ( hex (0 1 2 3 4 5 6 7) (50 50 50) simpleGrading (1 1 1) ); edges ( ); boundary ( atmosphere { type patch; faces ( (4 5 6 7) ); } bottom { type wall; faces ( (0 3 2 1) ); } left { type cyclic; neighbourPatch right; faces ( (0 4 7 3) ); } right { type cyclic; neighbourPatch left; faces ( (2 6 5 1) ); } entry { type wall; faces ( (1 5 4 0) ); } exit { type patch; faces ( (3 7 6 2) ); } building { type wall; faces ( ); } ); mergePatchPairs ( ); // ************************************************************************* // I am able to remove solid domain (buildings) using toposet. Here is toposet 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 dictionary; object topoSetDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // actions ( { name c0; type cellSet; action clear; } { name c0; type cellSet; action invert; } { name c0; type cellSet; action delete; source boxToCell; sourceInfo { boxes ( ( 35 50 0 ) ( 65 70 80 ) ( 85 50 0 ) ( 115 70 80 ) ( 135 50 0 ) ( 165 70 80 ) ( 35 100 0 ) ( 65 120 80 ) ( 85 100 0 ) ( 115 120 80 ) ( 135 100 0 ) ( 165 120 80 ) ); } } ); // ************************************************************************* // To try out, I added forcecoeff function in controldict file. Code:
functions { forceCoeffs1 { // Mandatory entries type forceCoeffs; libs ("libforces.so"); patches (building); // Optional entries // Field names p p; U U; rho rho; rho rhoInf; rhoInf 1000; // Reference pressure [Pa] pRef 0; // Include porosity effects? porosity no; // Store and write volume field representations of forces and moments writeFields yes; // Centre of rotation for moment calculations CofR (0 0 0); // Lift direction liftDir (0 0 1); // Drag direction dragDir (0 1 0); // Pitch axis pitchAxis (1 0 0); // Freestream velocity magnitude [m/s] magUInf 30; // Reference length [m] lRef 80; // Reference area [m2] Aref 2400; // Spatial data binning // - extents given by the bounds of the input geometry binData { nBin 20; direction (0 1 0); cumulative yes; } } } // ************************************************************************* // Could anyone tell me how can I create patch for front face of each building which was deleted from topoSet? How can I use createPatch here? And if anyone has different approach, let me know. Thank you in advance : ) |
|
Tags |
createpatchdict, forcecoeffs, toposetdict |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
bash script for pseudo-parallel usage of reconstructPar | kwardle | OpenFOAM Post-Processing | 42 | May 8, 2024 00:17 |
Transient simulation not converging | skabilan | OpenFOAM Running, Solving & CFD | 14 | December 17, 2019 00:12 |
How to write k and epsilon before the abnormal end | xiuying | OpenFOAM Running, Solving & CFD | 8 | August 27, 2013 16:33 |
plot over time | fferroni | OpenFOAM Post-Processing | 7 | June 8, 2012 08:56 |
Upgraded from Karmic Koala 9.10 to Lucid Lynx10.04.3 | bookie56 | OpenFOAM Installation | 8 | August 13, 2011 05:03 |