Loading...
Searching...
No Matches
fsiBasic.C
1/*---------------------------------------------------------------------------*\
2 ██╗████████╗██╗ ██╗ █████╗ ██████╗ █████╗ ███████╗██╗ ██╗
3 ██║╚══██╔══╝██║ ██║██╔══██╗██╔════╝██╔══██╗ ██╔════╝██║ ██║
4 ██║ ██║ ███████║███████║██║ ███████║█████╗█████╗ ██║ ██║
5 ██║ ██║ ██╔══██║██╔══██║██║ ██╔══██║╚════╝██╔══╝ ╚██╗ ██╔╝
6 ██║ ██║ ██║ ██║██║ ██║╚██████╗██║ ██║ ██║ ╚████╔╝
7 ╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═══╝
8
9 * In real Time Highly Advanced Computational Applications for Finite Volumes
10 * Copyright (C) 2017 by the ITHACA-FV authors
11-------------------------------------------------------------------------------
12License
13 This file is part of ITHACA-FV
14 ITHACA-FV is free software: you can redistribute it and/or modify
15 it under the terms of the GNU Lesser General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18 ITHACA-FV is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU Lesser General Public License for more details.
22 You should have received a copy of the GNU Lesser General Public License
23 along with ITHACA-FV. If not, see <http://www.gnu.org/licenses/>.
24Description
25 Example of Fsi simulation for PIMPLE algorithm
26SourceFiles
27 fsiBasic.C
28\*---------------------------------------------------------------------------*/
29
30#include "fsiBasic.H"
31
32// Construct Null
35fsiBasic::fsiBasic(int argc, char* argv[])
36 : UnsteadyProblem()
37{
38 // to create argument list
39 _args = autoPtr<argList>
40 (
41 new argList(argc, argv)
42 );
43
44 if (!_args->checkRootCase())
45 {
46 Foam::FatalError.exit();
47 }
48
49 argList& args = _args();
50#include "createTime.H"
51 //#include "createDynamicFvMesh.H"
52 Info << "Create a dynamic mesh for time = "
53 << runTime.timeName() << nl << endl;
54 meshPtr = autoPtr<dynamicFvMesh> (dynamicFvMesh::New(args, runTime));
55 dynamicFvMesh& mesh = meshPtr();
56 _pimple = autoPtr<pimpleControl>
57 (
58 new pimpleControl
59 (
60 mesh
61 )
62 );
63 //pimpleControl& pimple = _pimple();
64#include "createFields.H"
65#include "initContinuityErrs.H"
66 ITHACAdict = new IOdictionary
67 (
68 IOobject
69 (
70 "ITHACAdict",
71 runTime.system(),
72 mesh,
73 IOobject::MUST_READ,
74 IOobject::NO_WRITE
75 )
76 );
77 // oMesh.reset
78 // (
79 // new IOobject
80 // (
81 // "OriginalMesh",
82 // runTime.timeName(),
83 // runTime,
84 // IOobject::NO_READ,
85 // IOobject::AUTO_WRITE
86 // )
87 // );
90 //para = ITHACAparameters::getInstance(mesh, runTime);
93 //setTimes(runTime);
94 // point0 = mesh.points().clone();
95 // faces0 = mesh.faces().clone();
96 // celllist0 = mesh.cells().clone();
97 // ///
98 // //const polyBoundaryMesh& boundary = mesh.boundaryMesh();
99 // /// Construct the initial mesh
100 // Mesh0.reset
101 // (new fvMesh
102 // (
103 // oMesh,
104 // std::move(point0),
105 // std::move(faces0),
106 // std::move(celllist0),
107 // true
108 // )
109 // );
110 // /*
111 // Mesh0
112 // (
113 // oMesh,
114 // std::move(point0),
115 // std::move(faces0),
116 // std::move(celllist0),
117 // true // syncPar
118 // );*/
119 // PtrList<polyPatch> patches(meshPtr->boundaryMesh().size());
120 // forAll(meshPtr->boundaryMesh(), patchI)
121 // {
122 // patches.set
123 // (
124 // patchI,
125 // meshPtr->boundaryMesh()[patchI].clone
126 // (
127 // Mesh0->boundaryMesh(),
128 // patchI,
129 // meshPtr->boundaryMesh()[patchI].size(),
130 // meshPtr->boundaryMesh()[patchI].start()
131 // )
132 // );
133 // }
134 // Mesh0->addFvPatches(patches);
135 // // Now meshCopyPtr is fully independent
136 // Mesh0->write();
137 Info << offline << endl;
139 NUmodesOut = para->ITHACAdict->lookupOrDefault<label>("NmodesUout", 15);
141 NPmodesOut = para->ITHACAdict->lookupOrDefault<label>("NmodesPout", 15);
143 NNutModesOut = para->ITHACAdict->lookupOrDefault<label>("NmodesNutOut", 15);
145 NUmodes = para->ITHACAdict->lookupOrDefault<label>("NmodesUproj", 10);
147 NPmodes = para->ITHACAdict->lookupOrDefault<label>("NmodesPproj", 10);
149 NNutModes = para->ITHACAdict->lookupOrDefault<label>("NmodesNutProj", 0);
150}
151
152void fsiBasic::truthSolve(label folderN, fileName folder)
153{
154 Time& runTime = _runTime();
155 dynamicFvMesh& mesh = meshPtr();
156 //fvMesh& mesh0 = Mesh0();
157 // Create a new independent copy (if dynamicFvMesh supports copying)
158 //autoPtr<dynamicFvMesh> mesh2Ptr(meshPtr->clone()); // Requires clone() method
159 //dynamicFvMesh& mesh = mesh2Ptr(); // Now 'mesh' is independent of 'meshPtr'
160 fv::options& fvOptions = _fvOptions();
161 pimpleControl& pimple = _pimple();
162 volScalarField& p = _p();
163 volVectorField& U = _U();
164 surfaceScalarField& phi = _phi();
165 IOMRFZoneList& MRF = _MRF();
166 //surfaceVectorField& Uf = _Uf();
167 singlePhaseTransportModel& laminarTransport = _laminarTransport();
168 instantList Times = runTime.times();
169 runTime.setEndTime(finalTime);
170 // Perform a TruthSolve
171 runTime.setTime(Times[1], 1);
172 runTime.setDeltaT(timeStep);
173 nextWrite = startTime; // timeStep initialization
174 //const fvMesh& toMeshInit = meshPtr();
175 //meshToMesh0::order mapOrder = meshToMesh0::INTERPOLATE;
176 //meshToMesh0::order mapOrder = meshToMesh0::CELL_VOLUME_WEIGHT;
177 //meshToMesh0::order mapOrder = meshToMesh0::CELL_POINT_INTERPOLATE;
178 meshToMesh0::order mapOrder = meshToMesh0::MAP;
179 dictionary dictCoeffs(dyndict().findDict("sixDoFRigidBodyMotionCoeffs"));
180 Foam::functionObjects::forces fomforces("fomforces", mesh, dictCoeffs);
181 surfaceVectorField N = mesh.Sf() / mesh.magSf();
182 turbulence->validate();
183#include "createUfIfPresent.H"
184 Info << "\nStarting time loop\n" << endl;
185
186 while (runTime.run())
187 {
188#include "CourantNo.H"
189 runTime.setEndTime(finalTime);
190 runTime++;
191 Info << "Time = " << runTime.timeName() << nl << endl;
192
193 // --- Pressure-velocity PIMPLE corrector loop
194 while (pimple.loop())
195 {
196 if (pimple.firstIter() || moveMeshOuterCorrectors)
197 {
198 //#if (DOFVER == 2412 || DOFVER == 2506) //DOPENFOAM
199 fomforces.execute();
200 // #else
201 //fomforces.calcForcesMoment();
202 // #endif
203 // #if defined(OFVERSION) && (OFVERSION > 2106)Do any mesh changes
204 //mesh.controlledUpdate();
205 // The following line remplace the above controlledUpdate() method
206 sDRBMS().solve();
207 mesh.movePoints(sDRBMS().curPoints());
208
209 //meshToMesh0 mapper(mesh, meshPtr());
210 //Info << mapper.toMesh().points()[1000] << endl;
211 //Info << mapper.fromMesh().points()[1000] << endl;
212 if (mesh.changing())
213 {
214 //MRF.update();
215 if (correctPhi)
216 {
217 // Calculate absolute flux
218 // from the mapped surface velocity
219 phi = mesh.Sf() & Uf();
220#include "correctPhi.H"
221 // Make the flux relative to the mesh motion
222 fvc::makeRelative(phi, U);
223 }
224
225 if (checkMeshCourantNo)
226 {
227#include "meshCourantNo.H"
228 }
229 }
230 }
231
232#include "UEqn.H"
233
234 // --- Pressure corrector loop
235 while (pimple.correct())
236 {
237#include "pEqn.H"
238 }
239
240 if (pimple.turbCorr())
241 {
242 laminarTransport.correct();
243 turbulence->correct();
244 }
245 }
246
247 scalar alffa = sDRBMS().motion().omega().z() / runTime.deltaTValue();
248 // Face area normal vectors
249 //surfaceVectorField Sf = mesh.Sf();
250 // Face areas
251 //surfaceScalarField magSf = mesh.magSf();
252 // Face normals
253 //N = mesh.Sf()/mesh.magSf();
254 //N.rename("Uf");
255
256 // Access the result
257 //volVectorField& old_U = t_old_U.ref();
258
259 //Info << "old_U =" << old_U <<
260
261 if (checkWrite(runTime))
262 {
263 //folderN++;
264 fomforcex.append(fomforces.forceEff().x());
265 fomforcey.append(fomforces.forceEff().y());
266 centerofmassx.append(sDRBMS().motion().centreOfMass().x());
267 centerofmassy.append(sDRBMS().motion().centreOfMass().y());
268 centerofmassz.append(quaternion(sDRBMS().motion().orientation()).eulerAngles(
269 quaternion::XYZ).z());
270 /*
271 Foam::meshToMesh0 mapper(mesh,mesh0);
273 //tmp<volVectorField> U_mapped(U);
274 //tmp<volScalarField> p_mapped(p);
275 volVectorField U_mapped
276 (
277 IOobject("U", runTime.timeName(), mesh0),
278 mesh0,
279 dimensionedVector("U", U.dimensions(), Zero)
280 );
281
282 volScalarField p_mapped
283 (
284 IOobject("p", runTime.timeName(), mesh0),
285 mesh0,
286 dimensionedScalar("p", p.dimensions(), Zero)
287 );
288 if (&mesh == &mesh0)
289 {
290 Info << "[mapFieldToMesh0] Meshes are identical. Copying field..." << endl;
291 U_mapped = U;
292 p_mapped = p;
293 }
294 else
295 {
296 U_mapped = mapper.interpolate<Foam::vector, Foam::plusEqOp<Foam::vector>>(U, mapOrder, Foam::plusEqOp<Foam::vector>() );
297
298 p_mapped = mapper.interpolate<scalar,Foam::plusEqOp<scalar>>(p, mapOrder, Foam::plusEqOp<scalar>() );
299
300 }
301 U_mapped.ref().rename("U");
302 p_mapped.ref().rename("p");
303 U_mapped.correctBoundaryConditions();
304 p_mapped.correctBoundaryConditions();*/
305 //ITHACAstream::exportSolution(N, name(counter), folder);
306 word localFolder = folder + name(folderN + 1);
307 //old_U.rename("old_U");
308 ITHACAstream::exportSolution(U, name(counter), localFolder );
309 //ITHACAstream::exportSolution(N, name(counter), localFolder );
310 ITHACAstream::exportSolution(p, name(counter), localFolder );
311 ITHACAstream::exportSolution(sDRBMS().pointDisplacement(),
312 name(counter), localFolder );
313 ITHACAstream::writePoints(mesh.points(),
314 localFolder, name(counter) + "/polyMesh/");
315 //word saveDir = name(counter) + "/polyMesh/";
316 //OFstream os(localFolder/saveDir/"points");
317 // Write points
318 //OFstream os(localFolder/saveDir);
319 //List<vector> list(mesh.points());
320 //list.write(os);
321 //os << mesh.points();
322 // Copy files to save directory
323 //mesh.write();
324 //word saveDir = name(counter) + "/polyMesh/";
325 //cp(runTime.path()/runTime.timeName(), runTime.path()/saveDir);
326 //std::ofstream of(folder + name(counter) + "/" + runTime.timeName());
327 Ufield.append(U.clone() );
328 Pfield.append(p.clone() );
329 Dfield.append(sDRBMS().pointDisplacement().clone());
330 NormalFields.append(N.clone());
331 // Check if this is the last time step
332
333 if (runTime.time().value() + runTime.deltaT().value() >= finalTime)
334 {
335 Info << "===== Storing final mesh =====" << endl;
336 meshes.append(meshPtr.ptr()); // Transfer ownership
337 // NOTE: meshPtr is now empty! Handle accordingly.
338 }
339
340 counter++;
342 }
343 }
344
345 //exit(0);
346 //const pointField& points2 = mesh.points();
347 //Foam::meshToMesh0 mapper(U.mesh(), meshPtr());
348 //Foam::MapConsistentMesh(U.mesh(), meshPtr(),
349 //meshToMesh0::order::MAP);
350 //Info<< nl
351 // << "Consistently creating and mapping fields for time "
352 // << mesh.time().timeIndex() << nl << endl;
353 /*
354 bool meshesDiffer = false;
355 const pointField& points1 = mesh0.points(); // e.g., original mesh
356 const pointField& points2 = mesh.points(); // e.g., moved mesh
357 forAll(points1, i)
358 {
359 if (mesh0.V()[i] != mesh.V()[i]) // or a tolerance like 1e-10
360 {
361 meshesDiffer = true;
362 break;
363 }
364 }
365 if (meshesDiffer)
366 Info << "Meshes differ in point locations." << endl;
367 else
368 Info << "Meshes are geometrically identical." << endl;
369 exit(0);*/
371 //meshes.append(meshPtr.ptr());
372 //meshes.append(meshPtr.release()); // Releases ownership from autoPtr to PtrList
373}
374
375
377{
378 turbulence.clear();
379 _laminarTransport.clear();
380 _p.clear();
381 _U.clear();
382 _phi.clear();
383 _Uf.clear();
384 _pointDisplacement.clear();
385 sDRBMS.clear();
386 _fvOptions.clear();
387 _pimple.clear();
388 argList& args = _args();
389 Time& runTime = _runTime();
390 instantList Times = runTime.times();
391 runTime.setTime(0, 1);
392 //runTime.stopAt(runTime.stopAtControls::saEndTime);
393 //meshPtr().resetMotion();
394 //meshPtr().movePoints(point0);
395 //pointField& pointOld = const_cast<pointField&> (meshPtr().oldPoints());
396 //pointOld = point0;
398 Info << "ReCreating dynamic mesh for time = "
399 << runTime.timeName() << nl << endl;
400 meshPtr = autoPtr<dynamicFvMesh> (dynamicFvMesh::New(args, runTime));
401 //meshPtr.reset(newMesh);
402 // Take ownership from another autoPtr
403 //meshPtr.reset(newMesh.ptr()); // Transfers ownership
404 Foam::dynamicFvMesh& mesh = meshPtr();
405 //exit(0);
406 _pimple = autoPtr<pimpleControl>
407 (
408 new pimpleControl
409 (
410 mesh
411 )
412 );
413#include "createFields.H"
415 counter = 1;
417}
418
420{
421 const volScalarField& nu = _laminarTransport().nu();
422 volScalarField& mu_new = const_cast<volScalarField&>(nu);
423 this->assignIF(mu_new, mu);
424
425 for (label i = 0; i < mu_new.boundaryFieldRef().size(); i++)
426 {
427 this->assignBC(mu_new, i, mu);
428 }
429}
430
431void fsiBasic::change_stiffness(scalar& mu)
432{
433 dictionary& dictCoeffs = dyndict->subDict("sixDoFRigidBodyMotionCoeffs");
434 dictionary& restraints = dictCoeffs.subDict("restraints");
435 dictionary& spring = restraints.subDict("verticalSpring1");
436 scalar stiffness = spring.get<scalar>("stiffness");
437 Info << "==== stiffness ==== " << stiffness << endl;
438 // Set new stiffness value (e.g., 0.1)
439 spring.set("stiffness", mu);
440 stiffness = spring.get<scalar>("stiffness");
441 // Verify the change
442 //scalar newStiffness = spring.lookup<scalar>("stiffness");
443 //Info << "==== New stiffness ==== " << newStiffness << endl;
444 //scalar stiffness = spring.lookupOrDefault<scalar>("stiffness", 0.0);
445 Info << "==== New stiffness ==== " << stiffness << endl;
446 //dyndict->write();
447 dyndict->regIOobject::write();
448}
449
450void fsiBasic::exportFoamFieldToNpy(const word& outputDir,
451 const word& fileName,
452 const List<scalar>& foamField)
453{
454 Eigen::VectorXd eigenData = Foam2Eigen::field2Eigen(foamField);
455 cnpy::save(eigenData, outputDir + "/" + fileName + ".npy");
456}
457
458
459
460
461void fsiBasic::prepareFoamData(const word& outputPath)
462{
463 word fullPath = "./" + outputPath;
464
465 if (!ITHACAutilities::check_folder(fullPath))
466 {
467 mkDir(fullPath);
468 exportFoamFieldToNpy(fullPath, "fomforcex", this->fomforcex);
469 exportFoamFieldToNpy(fullPath, "fomforcey", this->fomforcey);
470 exportFoamFieldToNpy(fullPath, "CentreOfMassY", this->centerofmassy);
471 }
472}
473
474
475void fsiBasic::loadCentreOfMassY(const fileName& baseDir)
476{
477 fileNameList dirs = readDir(baseDir, fileName::DIRECTORY);
478 Eigen::VectorXd vecOfCentreOfMasses;
479 // First, filter and sort the directories
480 wordList sortedDirs;
481 forAll(dirs, i)
482 {
483 if (dirs[i].find("DataFromFoam_") == 0)
484 {
485 sortedDirs.append(dirs[i]);
486 }
487 }
488 // Custom sorting function to sort numerically
489 std::sort(sortedDirs.begin(), sortedDirs.end(),
490 [](const word & a, const word & b)
491 {
492 int numA = std::stoi(a.substr(std::string("DataFromFoam_").length()));
493 int numB = std::stoi(b.substr(std::string("DataFromFoam_").length()));
494 return numA < numB;
495 });
496 // Now process in sorted order
497 forAll(sortedDirs, i)
498 {
499 fileName targetFile = baseDir / sortedDirs[i] / "CentreOfMassY.npy";
500
501 if (exists(targetFile))
502 {
503 Info << "Found CentreOfMassY.npy in " << targetFile << endl;
504 Eigen::MatrixXd CentreOfMassY;
505 cnpy::load(CentreOfMassY, targetFile);
506 Eigen::VectorXd currentVec = CentreOfMassY.col(0);
507 // Info << "CentreOfMassY dimensions: "
508 // << CentreOfMassY.rows() << " x " << CentreOfMassY.cols() << endl;
509 vecOfCentreOfMasses.conservativeResize(vecOfCentreOfMasses.size() +
510 currentVec.size());
511 vecOfCentreOfMasses.tail(currentVec.size()) = currentVec;
512 Info << "Loaded: " << targetFile << endl;
513 }
514 else
515 {
516 Info << "CentreOfMassY.npy not found in " << targetFile << endl;
517 }
518 }
519 this->CylDispl = vecOfCentreOfMasses;
520 // Info << "=== vecOfCentereOfMasses size ===" << vecOfCentreOfMasses.size() << endl;
521}
522
523
524void fsiBasic::updateStiffnessAndRebuildSolver(scalar& newMu, word param_name)
525{
526 dictionary& dictCoeffs = dyndict().subDict("sixDoFRigidBodyMotionCoeffs");
527 dictionary& restraints = dictCoeffs.subDict("restraints");
528 dictionary& spring = restraints.subDict("verticalSpring1");
529 scalar oldMu = spring.get<scalar>(param_name);
530 //Info << ">>> Replacing damping: " << oldMu << " -> " << newMu << endl;
531 spring.set(param_name, newMu);
533 dyndict().regIOobject::write(true);
535 sDRBMS.clear();
536 dyndict.clear();
538 dyndict = autoPtr<IOdictionary>
539 (
540 new IOdictionary
541 (
542 IOobject
543 (
544 "dynamicMeshDict",
545 meshPtr().time().constant(),
546 meshPtr(),
547 IOobject::MUST_READ,
548 IOobject::NO_WRITE,
549 false
550 )
551 )
552 );
554 sDRBMS = autoPtr<sixDoFRigidBodyMotionSolver>
555 (
556 new sixDoFRigidBodyMotionSolver(meshPtr(), dyndict())
557 );
558 Info << ">>> Motion solver rebuilt with new stiffness.\n";
559}
560/*
561template<class Type, class PatchField, class GeoMesh>
562void mapFieldToMesh0(const Foam::GeometricField<Type, PatchField, GeoMesh>& sourceField,
563const Foam::fvMesh& mesh0,
564Foam::GeometricField<Type, PatchField, GeoMesh>& mappedField)
565{
566 const Foam::fvMesh& fromMesh = sourceField.mesh();
567
568 if (&fromMesh == &mesh0)
569 {
570 Info << "[mapFieldToMesh0] Meshes are identical. Copying field..." << endl;
571 mappedField = sourceField;
572 return;
573 }
574
575 Info << "[mapFieldToMesh0] Interpolating field " << sourceField.name()
576 << " to mesh0..." << endl;
577
578 Foam::meshToMesh0 mapper(fromMesh, mesh0);
579
580 Foam::tmp<Foam::GeometricField<Type, PatchField, GeoMesh>> interpField =
581 mapper.interpolate<Type, Foam::plusEqOp<Type>>(
582 Foam::tmp<Foam::GeometricField<Type, PatchField, GeoMesh>>(sourceField),
583 Foam::meshToMesh0::order::LINEAR,
584 Foam::plusEqOp<Type>());
585
586 mappedField = interpField;
587}
588mapFieldToMesh0( const volScalarField& sourceField,
589 const Foam::fvMesh& mesh0,
590 volScalarField& mappedField);
591
592mapFieldToMesh0( const volVectorField& sourceField,
593 const Foam::fvMesh& mesh0,
594 volVectorField& mappedField); */
595
596
597
static Eigen::MatrixXd field2Eigen(GeometricField< Type, PatchField, GeoMesh > &field)
Convert a vector OpenFOAM field into an Eigen Vector.
Class for the definition of some general parameters, the parameters must be defined from the file ITH...
static ITHACAparameters * getInstance()
Gets an instance of ITHACAparameters, to be used if the instance is already existing.
bool checkWrite(Time &timeObject)
Function to check if the solution must be exported.
scalar startTime
Start Time (initial time to start storing the snapshots).
scalar writeEvery
Time step of the writing procedure.
scalar timeStep
Time step of the simulation.
scalar nextWrite
Auxiliary variable to store the next writing instant.
scalar finalTime
Final time (final time of the simulation and consequently of the acquisition of the snapshots).
void updateStiffnessAndRebuildSolver(scalar &newMu, word param_name="stiffness")
Definition fsiBasic.C:524
autoPtr< pointVectorField > _pointDisplacement
pointDisplacement field
Definition fsiBasic.H:115
List< scalar > fomforcey
List to save lift and drag forces.
Definition fsiBasic.H:117
void prepareFoamData(const word &outputPath)
Prepare data such forces and centre of mass.
Definition fsiBasic.C:461
PtrList< surfaceVectorField > NormalFields
List of surface normal vectors.
Definition fsiBasic.H:111
autoPtr< pimpleControl > _pimple
pimpleControl
Definition fsiBasic.H:93
void exportFoamFieldToNpy(const word &outputDir, const word &fileName, const List< scalar > &foamField)
Help function for the prepareFoamData routine.
Definition fsiBasic.C:450
PtrList< pointVectorField > Dfield
List of pointers used to form the displacement snapshots matrix.
Definition fsiBasic.H:108
void change_viscosity(double mu)
Method to construct RBFI for pointDisplacement void PodIpointDispl(Eigen::MatrixXd muu,...
Definition fsiBasic.C:419
void restart()
method to set all fields back to values in 0 folder
Definition fsiBasic.C:376
fsiBasic()
Construct Null.
Definition fsiBasic.C:33
List< scalar > centerofmassx
List scalar for access the centerofmass.
Definition fsiBasic.H:103
void loadCentreOfMassY(const fileName &baseDir="ITHACAoutput")
to load all centre of mass for training RBF network
Definition fsiBasic.C:475
label counter
Counter used for the output of the full order solutions.
void assignBC(volVectorField &s, label BC_ind, Vector< double > &value)
Assign Boundary Condition to a volVectorField.
void assignIF(T &s, G &value)
Assign internal field condition.
bool offline
Boolean variable, it is 1 if the Offline phase has already been computed, else 0.
label folderN
Counter to save intermediate steps in the correct folder, for unsteady and some stationary cases.
IOdictionary * ITHACAdict
dictionary to store input output infos
Eigen::MatrixXd mu
Row matrix of parameters.
autoPtr< argList > _args
argList
bool podex
Boolean variable, it is 1 if the POD has already been computed, else 0.
void truthSolve()
Perform a TruthSolve.
label NPmodes
Number of pressure modes used for the projection.
Definition steadyNS.H:146
autoPtr< surfaceScalarField > _phi
Flux.
Definition steadyNS.H:302
PtrList< volScalarField > Pfield
List of pointers used to form the pressure snapshots matrix.
Definition steadyNS.H:86
autoPtr< fv::options > _fvOptions
fvOptions
Definition steadyNS.H:296
autoPtr< Time > _runTime
Time.
Definition steadyNS.H:299
autoPtr< singlePhaseTransportModel > _laminarTransport
Laminar transport (used by turbulence model).
Definition steadyNS.H:311
label NUmodes
Number of velocity modes used for the projection.
Definition steadyNS.H:143
label NNutModesOut
Number of nut modes to be calculated.
Definition steadyNS.H:140
autoPtr< IOMRFZoneList > _MRF
MRF variable.
Definition steadyNS.H:314
label NNutModes
Number of nut modes used for the projection.
Definition steadyNS.H:152
autoPtr< incompressible::turbulenceModel > turbulence
Turbulence model.
Definition steadyNS.H:308
label NUmodesOut
Number of velocity modes to be calculated.
Definition steadyNS.H:131
label NPmodesOut
Number of pressure modes to be calculated.
Definition steadyNS.H:134
autoPtr< volVectorField > _U
Velocity field.
Definition steadyNS.H:272
autoPtr< volScalarField > _p
Pressure field.
Definition steadyNS.H:269
Header file of the fsiBasic class.
void writePoints(pointField points, fileName folder, fileName subfolder)
Write points of a mesh to a file.
void exportSolution(GeometricField< Type, PatchField, GeoMesh > &s, fileName subfolder, fileName folder, word fieldName)
Export a field to file in a certain folder and subfolder.
bool check_pod()
Check if the POD data folder "./ITHACAoutput/POD" exists.
bool check_off()
Check if the offline data folder "./ITHACAoutput/Offline" exists.
bool check_folder(word folder)
Checks if a folder exists.