|
[Sponsors] |
May 24, 2023, 06:07 |
Make diskdir time independant
|
#1 |
New Member
Riboulet Baptiste
Join Date: May 2023
Location: Rennes
Posts: 1
Rep Power: 0 |
Hello Foamers,
I am using a dynamic mesh to move the actuator disk (AD) in a domain around an axis of rotation. However, when the AD is moving, the normal vector (diskdir defined in actuationDisksource in fvModels) always points in the x direction. So i am trying to make the normal vector from actuationdisk time dependant so that the kinetic energy is transferred normally to the AD even when moving, as follows : diskdir = =(-cos(teta),-sin(teta),0) with teta = time * rotation_speed_mesh Please find attached an image illustrating the problem. I have modified and recompiled with wmake from fvModels and finiteVolume directory the code actuationDisksource.C, fvModels.C and fvModel.C as follows : At the end of the file depactuationDisksource.C (the modified one) : Code:
void Foam::fv::actuationDiskSource::updateDiskDir(vector& newDiskDir) { Info << "New diskDir:" << newDiskDir<< " " << "Old diskDir:" << diskDir_<< endl; diskDir_ = newDiskDir; } Code:
virtual void updateDiskDir(vector& newDiskDir); Code:
void Foam::fvModels::updateDiskDir(vector& newDiskDir) { PtrListDictionary<fvModel>& modelList(*this); forAll(modelList, i) { modelList[i].updateDiskDir(newDiskDir); } } Code:
void Foam::fvModel::updateDiskDir(vector& newDiskDir) {} Code:
virtual void updateDiskDir(vector& newDiskDir); Code:
const scalar omega = 10.0; // before time loop scalar t = 0.0; // before time loop scalar theta = 0.0; // before time loop Code:
t = runTime.value(); // in time loop theta = t*omega; //in time loop Code:
vector newDiskDir(-Foam::cos(theta),-Foam::sin(theta),0); fvModels.updateDiskDir(newDiskDir); When I am using the modified solver, I have this error : Code:
Selecting finite volume model type depactuationDiskSource #0 Foam::error::printStack(Foam::Ostream&) at ??:? #1 Foam::sigSegv::sigHandler(int) at ??:? #2 ? in "/lib/x86_64-linux-gnu/libc.so.6" #3 Foam::fvModel::New(Foam::word const&, Foam::dictionary const&, Foam::fvMesh const&) at ??:? #4 Foam::fvModels::fvModels(Foam::fvMesh const&) at ??:? #5 ? in "/home/briboulet/OpenFOAM/briboulet-10/platforms/linux64GccDPInt32Opt/bin/deppimpleFoam" #6 ? in "/home/briboulet/OpenFOAM/briboulet-10/platforms/linux64GccDPInt32Opt/bin/deppimpleFoam" #7 ? in "/lib/x86_64-linux-gnu/libc.so.6" #8 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" #9 ? in "/home/briboulet/OpenFOAM/briboulet-10/platforms/linux64GccDPInt32Opt/bin/deppimpleFoam" Erreur de segmentation (core dumped) I was also wondering about the validity of compiling the different files but I have recompiled everything from finiteVolume and fvModels including the modification of files .C. The solver recognise the function updatediskdir so I think the compile part is ok. I will also try to compile in debug mode. Please help me going through this problem, I am not at ease with the C++ syntax from openfoam and the problem should come from what I've written. There are maybe other ways to do this so feel free to suggest other solutions (codedSource ? adding the parameter time in the actuation disk function ?) Thanks in advance |
|
June 6, 2023, 07:14 |
|
#2 |
Senior Member
Hassan Kassem
Join Date: May 2010
Location: Germany
Posts: 242
Rep Power: 18 |
I think an easy way would be changing the time of ``diskDir_`` from ``vector`` to ``function1<vector>`` since it is function of time. Here is an example;
https://github.com/OpenFOAM/OpenFOAM...onSource.H#L89 ``function1`` will allow you to have few options as input which would make your code more general. |
|
Tags |
actuatordisk, compilation, diskdir, segmentation error, syntax error |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
somaFoam - And plasma goes weee | Destouches | OpenFOAM Running, Solving & CFD | 11 | July 17, 2024 07:55 |
laplacianFoam with source term | Herwig | OpenFOAM Running, Solving & CFD | 17 | November 19, 2019 14:47 |
Extrusion with OpenFoam problem No. Iterations 0 | Lord Kelvin | OpenFOAM Running, Solving & CFD | 8 | March 28, 2016 12:08 |
Moving mesh | Niklas Wikstrom (Wikstrom) | OpenFOAM Running, Solving & CFD | 122 | June 15, 2014 07:20 |
dynamic Mesh is faster than MRF???? | sharonyue | OpenFOAM Running, Solving & CFD | 14 | August 26, 2013 08:47 |