|
[Sponsors] | |||||
[solids4Foam] codeStream for pressure boundary condition in 0/solid/D |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|
|
#1 |
|
New Member
Sam Mallinson
Join Date: Aug 2013
Posts: 9
Rep Power: 14 ![]() |
I wish to express a pressure load on a solid wall as a function of location.
I have been using the traction BC in 0/solid/D to apply a fixed value pressure, but the case I am computing requires the pressure to be a function of distance from a point. Is it possible to use codeStream to do this? I think this might be tricky as the traction BC is for displacements, and I want to apply a pressure. Details of system: OpenFOAM: Build : _76d719d1e6-20220624 OPENFOAM=2206 version=v2206 solids4foam: installed March 2025 via repository OS: Ubuntu 20.04 Last edited by SamMallinson; October 21, 2025 at 18:57. Reason: adding details |
|
|
|
|
|
|
|
|
#2 |
|
New Member
Sam Mallinson
Join Date: Aug 2013
Posts: 9
Rep Power: 14 ![]() |
This is what I tried:
in `0/solid/D`, at the top of the file, I had ``` #include "pressureCondition" ``` then in the body ``` compression-force { type solidTraction; traction uniform ( 0 0 0 ); value uniform (0 0 0); pressure $pressureF; } ``` The file `pressureCondition` is as follows: ``` pressureF #codeStream { code #{ scalar D = 0.003; scalar A = 2 * 3.14159 * 0.002 * D; const IOdictionary& d = static_cast<const IOdictionary&> ( dict.parent().parent() ); const fvMesh& mesh = refCast<const fvMesh>(d.db()); const label id = mesh.boundary().findPatchID("compression-force"); const fvPatch& patch = mesh.boundary()[id]; scalarField myPatch(patch.size(), scalar(0) ); forAll(myPatch, celli) { scalar zc = patch.Cf()[celli][2]; myPatch[celli] = scalar(250 * pow(Foam::constant::mathematical::e, ((-4 * pow(zc,2))/(pow((4 * D),2))) ) / A); } operator == (myPatch); #}; codeInclude #{ #include "fvCFD.H" #include "volFields.H" #}; codeOptions #{ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(FOAM_CASE)/system #}; codeLibs #{ -lfiniteVolume \ -lmeshTools #}; }; #inputMode merge ``` |
|
|
|
|
|
![]() |
| Tags |
| codestream, solids4foam |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to update Boundary Condition in the loop with #codeStream? | TeddyL | OpenFOAM | 0 | October 20, 2024 03:56 |
| sliding mesh problem in CFX | Saima | CFX | 46 | September 11, 2021 08:38 |
| Centrifugal fan | j0hnny | CFX | 13 | October 1, 2019 14:55 |
| Radiation interface | hinca | CFX | 15 | January 26, 2014 18:11 |
| CFX fails to calculate a diffuser pipe flow | shenying0710 | CFX | 7 | March 26, 2013 05:13 |