|
[Sponsors] |
June 29, 2020, 21:56 |
issue with mesh_.V()
|
#1 |
Member
Sam
Join Date: May 2019
Posts: 64
Rep Power: 6 |
Hey guys,
I found this here https://www.openfoam.com/documentati...ces-coded.html and I was wondering if there was an error here. This is regarding the treatment of V (heSource[i] += 1e5*sin(200*cellx[i])*V[i] surely this is should be divided instead. If not why? I just wish to check. Usage An example showing how to add a source to the energy equation of the form Sh=1/V*100000sin(200Cx) is shown below: codedSource { type coded; selectionMode all; fields (h); name sourceTime; codeAddSup #{ const Time& time = mesh().time(); const scalarField& V = mesh_.V(); scalarField& heSource = eqn.source(); // Start time const scalar startTime = 2.0; // Retrieve the x component of the cell centres const scalarField& cellx = mesh_.C().component(0); // Only apply when we have reached the start time if (time.value() > startTime) { // Apply the source forAll(cellx, i) { // cell volume specific source heSource[i] += 1e5*sin(200*cellx[i])*V[i]; }; } #}; } Thanks, Sam |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[snappyHexMesh] SnappyHexMesh/splitMeshRegion : region1 in zone "-1" | GuiMagyar | OpenFOAM Meshing & Mesh Conversion | 3 | August 4, 2023 13:38 |
how to set periodic boundary conditions | Ganesh | FLUENT | 15 | November 18, 2020 07:09 |
[Gmsh] GMSH : structured mesh issue | bibiboom | OpenFOAM Meshing & Mesh Conversion | 0 | May 17, 2017 19:49 |
[snappyHexMesh] No layers in a small gap | bobburnquist | OpenFOAM Meshing & Mesh Conversion | 6 | August 26, 2015 10:38 |
[snappyHexMesh] Layers:problem with curvature | giulio.topazio | OpenFOAM Meshing & Mesh Conversion | 10 | August 22, 2012 10:03 |