Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
2a0100d
Initial implementation for dynamic FSI adjoints
cvencro Aug 5, 2019
1bb175e
Merge branch 'develop' into feature_dynamic_fsi_discadj
cvencro Aug 7, 2019
f927562
Merge branch 'feature_incompressible_ale' into feature_dynamic_fsi_di…
cvencro Aug 7, 2019
32f4b29
fixes for dynamic fluid discrete adjoint
cvencro Aug 11, 2019
45ba51a
update communication of coordinates and solution
cvencro Aug 11, 2019
e37b456
check for non-zero number of elements before deallocating
cvencro Aug 18, 2019
d4aa46f
fixes for dynamic structural adjoint
cvencro Sep 16, 2019
5e76819
Allow sine loading with initial ramp
cvencro Sep 16, 2019
fff0b11
Merge branch 'develop' into feature_dynamic_fsi_discadj and fix confl…
cvencro Sep 16, 2019
64b6aad
fix handling of objective function in the adjoint run for dynamic str…
cvencro Sep 20, 2019
4661f6b
remove unsteady multizone overwrite default settings
cvencro Oct 1, 2019
9530457
add option to use new mesh solver for FSI driver
cvencro Oct 9, 2019
87171ed
Merge branch 'fix_discadjfsi_merge' into 'feature_dynamic_fsi_discadj'
cvencro Oct 20, 2019
27f9fc1
Add output files for FSI discrete adjoint
cvencro Oct 20, 2019
a0b73ca
Add sensitivity output in CElasticityOutput.cpp
cvencro Oct 20, 2019
d14851e
Re-set up Run for dynamic FSI adjoint
cvencro Oct 21, 2019
79293d5
Fix setting of dynamic fluid adjoint iteration number for output file
cvencro Oct 21, 2019
89a9a82
Merge branch 'develop' into 'feature_dynamic_fsi_discadj'
cvencro Nov 11, 2019
7fc84bb
fixes for unsteady restart and sensitivity output
cvencro Nov 12, 2019
1830be5
fix unsteady restart filename for discrete adjoint
cvencro Nov 12, 2019
e3de59a
remove additional deformation calls
cvencro Nov 14, 2019
5b0fc51
Merge branch 'multiphysics_discadj_tweaks' into 'feature_dynamic_fsi_…
cvencro Nov 14, 2019
09db60e
small changes to run multizone for dynamic fsi with CMeshSolver
cvencro Nov 15, 2019
7ed8e86
add framework for dynamic simulation with multizone discrete adjoint …
cvencro Nov 16, 2019
1b974ac
Add note about unsteady default output frequency
cvencro Nov 16, 2019
321b374
fix time iteration outputs
cvencro Nov 17, 2019
b0fd2df
fix needed to run with legacy driver
cvencro Nov 17, 2019
bb873ff
re-add output of files after evaluating sensitivities
cvencro Nov 17, 2019
2d56658
modify restart iter from adjoint iter if needed
cvencro Nov 18, 2019
bf15fad
Restart from old geometry in CMeshSolver for deforming mesh
cvencro Nov 18, 2019
ff1205d
Merge branch 'multiphysics_discadj_tweaks' into 'feature_dynamic_fsi_…
cvencro Nov 18, 2019
2e58ba6
revert python changes
cvencro Nov 18, 2019
c834fa4
clean up
cvencro Nov 18, 2019
794f0f3
move time loop to outside of run
cvencro Nov 19, 2019
3bf3633
use multizone driver for FSI adjoints
cvencro Nov 19, 2019
1e0805c
allow grid-velocity output by default for dynamic problems
cvencro Nov 22, 2019
af9b53a
fix boolean name
cvencro Nov 22, 2019
f8ad8db
correct time files for dynamic fsi
cvencro Nov 24, 2019
59842e1
Merge branch 'develop' into feature_dynamic_fsi_discadj
cvencro Nov 25, 2019
a4d446c
remove overwriting of existing solution containers for adjoint
cvencro Nov 26, 2019
057217f
Use initial mesh to set up negative restart request in dual-time
cvencro Nov 27, 2019
245e063
Merge 'feature_dyn_deform_adjoint' into branch 'feature_dynamic_fsi_d…
cvencro Nov 28, 2019
b2d78cf
test with Euler wall
cvencro Dec 14, 2019
6687052
fix node and numerics calls
cvencro Dec 14, 2019
690a913
Add index calls for dynamic FEA adjoint recording
cvencro Dec 19, 2019
6aa377f
enable CMeshSolver for FEA adjoints
cvencro Dec 21, 2019
13c002a
Merge 'develop' into 'feature_dynamic_fsi_discadj'
cvencro Dec 31, 2019
73a3248
Indexed dynamic FEA adjoint extraction
cvencro Jan 2, 2020
a7c9b8a
Extract indexed dynamic fluid adjoint
cvencro Jan 2, 2020
7e02810
update missing AD indices and tidy booleans
cvencro Jan 21, 2020
a911f40
Merge 'develop' into 'feature_dynamic_fsi_discadj' and fix conflicts
cvencro Jan 30, 2020
d55caff
fix unsteady filename in mesh solver
cvencro Jan 31, 2020
c01d76e
few fixes
cvencro Feb 5, 2020
b3fc4ea
Merge branch 'develop' into 'feature_dynamic_fsi_discadj'
cvencro Feb 6, 2020
838345c
move FEA push indices
cvencro Feb 17, 2020
ca9a802
fix change in gradient with multi-grid
cvencro Feb 17, 2020
540b538
fixes for adjoint FSI Driver
cvencro Feb 18, 2020
5891b59
update unsteady solution and sensitivity
cvencro Feb 19, 2020
160b6f5
missed fixes
cvencro Feb 19, 2020
44c5b80
fix for unsteady multizone adjoints with mesh deformation
cvencro Feb 22, 2020
3c8060b
Update default if deform mesh is specified in config
cvencro Feb 22, 2020
3cbfecd
update logic to fix static FSI gradients
cvencro Feb 23, 2020
406cc6c
make structural BC's less error prone and fix shape derivative bug
cvencro Feb 24, 2020
a817cfc
add mesh register/extract calls
cvencro Feb 24, 2020
82a7402
fix and update mass residual calculation
cvencro Mar 3, 2020
2c7512a
switch euler wall bc
cvencro Mar 9, 2020
466e7a7
set volume nM1 for dynamic grid problems
cvencro Mar 15, 2020
355ab76
fix iZone iInst order
cvencro Mar 18, 2020
5451f43
avoid cross-term adjoint solution in dual-time source terms
cvencro Mar 18, 2020
5f9f705
Merge branch 'develop' into 'feature_dynamic_fsi_discadj' after fixin…
cvencro Apr 20, 2020
0d5c1aa
clean up
cvencro May 6, 2020
61b74c2
Merge branch 'develop' into 'feature_dynamic_fsi_discadj' after fixin…
cvencro May 6, 2020
a0f3450
remove debug comments, duplicated code, general clean-up
cvencro May 7, 2020
d19fbaf
register coordinates for all recording
cvencro May 7, 2020
c6440d2
test fixes for reg tests
cvencro May 8, 2020
da2d5f6
update comments
cvencro May 8, 2020
f00d88a
Merge branch 'develop' into 'feature_dynamic_fsi_discadj'
cvencro May 10, 2020
63e7a79
zero displacement for negative restarts
cvencro May 24, 2020
6afea3a
handle previous time step volumes in Preprocess
cvencro May 24, 2020
e896203
fix restarted previous time FEA solution for adjoint problem
cvencro May 24, 2020
b9d5030
Fix conflicts and merge 'develop' into 'feature_dynamic_fsi_discadj'
cvencro May 24, 2020
f3e3892
fix tab to spaces
cvencro May 25, 2020
2712b63
Merge develop into feature_dynamic_fsi_discadj after fixing conflicts
cvencro Sep 7, 2020
4a8f762
fix dynamic grid velocity output
cvencro Sep 11, 2020
59c8d1d
test transfer of interface velocities
cvencro Sep 15, 2020
d1ef81a
remove second call for deforming bc and update grid vel mpi comms
cvencro Sep 15, 2020
1f63e57
set grid velocity from restart files
cvencro Sep 27, 2020
69904b4
update grid velocities before transfer in case of relaxation
cvencro Sep 28, 2020
a10a26c
easy switch to turn off grid velocity
cvencro Oct 4, 2020
7ef0115
predicted velocity for fsi transfer
cvencro Oct 4, 2020
bedc365
missing source term?
cvencro Oct 4, 2020
aea7617
include disc adj solvers for FSI_Problem
cvencro Oct 4, 2020
3d73d7b
re-add missed structural markers
cvencro Oct 5, 2020
0de5acc
missing booleans
cvencro Oct 9, 2020
538baa9
temporary output of fea dv sensitivities
cvencro Nov 5, 2020
ec563b8
set default using generic time domain criteria
cvencro Nov 21, 2020
50b6be3
update grid velocity transfer and non-dimensionalization
cvencro Nov 23, 2020
186c566
missed time domain checks
cvencro Nov 30, 2020
faf0337
remove temporary booleans
cvencro Jan 19, 2021
fdd6663
fix conflicts and merge branch 'develop' into feature_dynamic_fsi_dis…
cvencro Jan 19, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 31 additions & 3 deletions Common/include/geometry/dual_grid/CPoint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ class CPoint {
su2activevector Volume; /*!< \brief Volume or Area of the control volume in 3D and 2D. */
su2activevector Volume_n; /*!< \brief Volume at time n. */
su2activevector Volume_nM1; /*!< \brief Volume at time n-1. */
su2activevector Volume_Old; /*!< \brief Old containers for Volume. */
su2activevector Volume_n_Old; /*!< \brief Old containers for Volume at time n. */
su2activevector Volume_nM1_Old; /*!< \brief Old containers for Volume at time n-1. */
su2activevector Periodic_Volume; /*!< \brief Missing component of volume or area of a control volume on a periodic marker in 3D and 2D. */

su2vector<bool> Domain; /*!< \brief Indicates if a point must be computed or belong to another boundary */
Expand Down Expand Up @@ -524,9 +527,9 @@ class CPoint {
inline su2double GetVolume_n(unsigned long iPoint) const { return Volume_n(iPoint); }

/*!
* \brief Get the volume of the control volume at time n+1.
* \brief Get the volume of the control volume at time n-1.
* \param[in] iPoint - Index of the point.
* \return Volume of the control volume at time n+1
* \return Volume of the control volume at time n-1
*/
inline su2double GetVolume_nM1(unsigned long iPoint) const { return Volume_nM1(iPoint); }

Expand All @@ -536,10 +539,35 @@ class CPoint {
void SetVolume_n();

/*!
* \brief Set the volume of the control volume at time n+1.
* \brief Set the volume of the control volume at time n-1.
*/
void SetVolume_nM1();

/*!
* \brief Set the volume of the control volume at time n using n-1.
*/
void SetVolume_n_from_OldnM1();

/*!
* \brief Set the volume of the control volume at current time using time n.
*/
void SetVolume_from_Oldn();

/*!
* \brief Set the Volume to Volume_Old.
*/
void SetVolume_Old();

/*!
* \brief Set the Volume_n to Volume_n_Old.
*/
void SetVolume_n_Old();

/*!
* \brief Set the Volume_nM1 to Volume_nM1_Old.
*/
void SetVolume_nM1_Old();

/*!
* \brief Set the parent control volume of an agglomerated control volume.
* \param[in] iPoint - Index of the point.
Expand Down
3 changes: 2 additions & 1 deletion Common/include/option_structure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2214,7 +2214,8 @@ enum MPI_QUANTITIES {
MESH_DISPLACEMENTS = 27, /*!< \brief Mesh displacements at the interface. */
SOLUTION_TIME_N = 28, /*!< \brief Solution at time n. */
SOLUTION_TIME_N1 = 29, /*!< \brief Solution at time n-1. */
PRIMITIVE = 30 /*!< \brief Primitive solution communication. */
PRIMITIVE = 30, /*!< \brief Primitive solution communication. */
SOLUTION_VEL_PRED = 31
};

/*!
Expand Down
15 changes: 6 additions & 9 deletions Common/src/CConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4834,20 +4834,15 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_

Restart_Flow = false;

if (GetKind_GridMovement() != RIGID_MOTION &&
GetKind_GridMovement() != NO_MOVEMENT) {
SU2_MPI::Error(string("Dynamic mesh movement currently only supported for the discrete adjoint solver for\n") +
string("GRID_MOVEMENT = RIGID_MOTION."), CURRENT_FUNCTION);
}

if (Unst_AdjointIter- long(nTimeIter) < 0){
SU2_MPI::Error(string("Invalid iteration number requested for unsteady adjoint.\n" ) +
string("Make sure EXT_ITER is larger or equal than UNST_ADJOINT_ITER."),
CURRENT_FUNCTION);
}

/*--- If the averaging interval is not set, we average over all time-steps ---*/

}
if (Time_Domain) {
if (Iter_Avg_Objective == 0.0) {
Iter_Avg_Objective = nTimeIter;
}
Expand Down Expand Up @@ -9811,10 +9806,12 @@ void CConfig::SetMultizone(CConfig *driver_config, CConfig **config_container){
switch (config_container[iZone]->GetKind_Solver()) {
case EULER: case NAVIER_STOKES: case RANS:
case INC_EULER: case INC_NAVIER_STOKES: case INC_RANS:
case NEMO_EULER: case NEMO_NAVIER_STOKES:
case NEMO_EULER: case NEMO_NAVIER_STOKES:
case DISC_ADJ_EULER: case DISC_ADJ_NAVIER_STOKES: case DISC_ADJ_RANS:
case DISC_ADJ_INC_EULER: case DISC_ADJ_INC_NAVIER_STOKES: case DISC_ADJ_INC_RANS:
fluid_zone = true;
break;
case FEM_ELASTICITY:
case FEM_ELASTICITY: case DISC_ADJ_FEM:
structural_zone = true;
Relaxation = true;
break;
Expand Down
31 changes: 31 additions & 0 deletions Common/src/geometry/dual_grid/CPoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ void CPoint::FullAllocation(unsigned short imesh, const CConfig *config) {
Volume_nM1.resize(npoint) = su2double(0.0);
}

if (config->GetDynamic_Grid() && config->GetDiscrete_Adjoint()) {
Volume_Old.resize(npoint) = su2double(0.0);
Volume_n_Old.resize(npoint) = su2double(0.0);
Volume_nM1_Old.resize(npoint) = su2double(0.0);
}

if(config->GetAD_Mode() && config->GetMultizone_Problem()) {
AD_InputIndex.resize(npoint,nDim) = 0;
AD_OutputIndex.resize(npoint,nDim) = 0;
Expand Down Expand Up @@ -163,6 +169,31 @@ void CPoint::SetVolume_nM1() {
parallelCopy(Volume_n.size(), Volume_n.data(), Volume_nM1.data());
}

void CPoint::SetVolume_Old() {
assert(Volume_Old.size() == Volume.size());
parallelCopy(Volume.size(), Volume.data(), Volume_Old.data());
}

void CPoint::SetVolume_n_Old() {
assert(Volume_n_Old.size() == Volume_n.size());
parallelCopy(Volume_n.size(), Volume_n.data(), Volume_n_Old.data());
}

void CPoint::SetVolume_nM1_Old() {
assert(Volume_nM1_Old.size() == Volume_nM1.size());
parallelCopy(Volume_nM1.size(), Volume_nM1.data(), Volume_nM1_Old.data());
}

void CPoint::SetVolume_n_from_OldnM1() {
assert(Volume_n.size() == Volume_nM1_Old.size());
parallelCopy(Volume_nM1_Old.size(), Volume_nM1_Old.data(), Volume_n.data());
}

void CPoint::SetVolume_from_Oldn() {
assert(Volume.size() == Volume_n_Old.size());
parallelCopy(Volume_n_Old.size(), Volume_n_Old.data(), Volume.data());
}

void CPoint::SetCoord_n() {
assert(Coord_n.size() == Coord.size());
parallelCopy(Coord.size(), Coord.data(), Coord_n.data());
Expand Down
12 changes: 8 additions & 4 deletions Common/src/grid_movement/CVolumetricMovement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,10 @@ void CVolumetricMovement::ComputeSolid_Wall_Distance(CGeometry *geometry, CConfi
for(iMarker=0; iMarker<config->GetnMarker_All(); ++iMarker) {
if( (config->GetMarker_All_KindBC(iMarker) == EULER_WALL ||
config->GetMarker_All_KindBC(iMarker) == HEAT_FLUX) ||
(config->GetMarker_All_KindBC(iMarker) == ISOTHERMAL) ||
(config->GetMarker_All_KindBC(iMarker) == CHT_WALL_INTERFACE)) {
(config->GetMarker_All_KindBC(iMarker) == ISOTHERMAL) ||
(config->GetMarker_All_KindBC(iMarker) == CHT_WALL_INTERFACE) ||
(config->GetMarker_All_KindBC(iMarker) == CLAMPED_BOUNDARY ) ||
(config->GetMarker_All_KindBC(iMarker) == LOAD_BOUNDARY )) {
nVertex_SolidWall += geometry->GetnVertex(iMarker);
}
}
Expand All @@ -457,8 +459,10 @@ void CVolumetricMovement::ComputeSolid_Wall_Distance(CGeometry *geometry, CConfi
for (iMarker=0; iMarker<config->GetnMarker_All(); ++iMarker) {
if ( (config->GetMarker_All_KindBC(iMarker) == EULER_WALL ||
config->GetMarker_All_KindBC(iMarker) == HEAT_FLUX) ||
(config->GetMarker_All_KindBC(iMarker) == ISOTHERMAL) ||
(config->GetMarker_All_KindBC(iMarker) == CHT_WALL_INTERFACE)) {
(config->GetMarker_All_KindBC(iMarker) == ISOTHERMAL) ||
(config->GetMarker_All_KindBC(iMarker) == CHT_WALL_INTERFACE) ||
(config->GetMarker_All_KindBC(iMarker) == CLAMPED_BOUNDARY ) ||
(config->GetMarker_All_KindBC(iMarker) == LOAD_BOUNDARY )) {
for (iVertex=0; iVertex<geometry->GetnVertex(iMarker); ++iVertex) {
iPoint = geometry->vertex[iMarker][iVertex]->GetNode();
PointIDs[jj++] = iPoint;
Expand Down
3 changes: 2 additions & 1 deletion SU2_CFD/include/drivers/CDriver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,8 @@ class CDriver {
*/
void SetSourceTerm_DispAdjoint(unsigned short iMarker, unsigned long iVertex, passivedouble val_AdjointX,
passivedouble val_AdjointY, passivedouble val_AdjointZ);

void SetSourceTerm_VelAdjoint(unsigned short iMarker, unsigned long iVertex, passivedouble val_AdjointX,
passivedouble val_AdjointY, passivedouble val_AdjointZ);
/*!
* \brief Get the undeformed mesh coordinates
* \param[in] iMarker - Marker identifier.
Expand Down
2 changes: 1 addition & 1 deletion SU2_CFD/include/iteration/CAdjFluidIteration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class CAdjFluidIteration : public CFluidIteration {
void Iterate(COutput* output, CIntegration**** integration, CGeometry**** geometry, CSolver***** solver,
CNumerics****** numerics, CConfig** config, CSurfaceMovement** surface_movement,
CVolumetricMovement*** grid_movement, CFreeFormDefBox*** FFDBox, unsigned short val_iZone,
unsigned short val_iInst) override;
unsigned short val_iInst, bool CrossTerm) override;

/*!
* \brief Updates the containers for the adjoint fluid system.
Expand Down
2 changes: 1 addition & 1 deletion SU2_CFD/include/iteration/CDiscAdjFEAIteration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class CDiscAdjFEAIteration : public CIteration {
void Iterate(COutput* output, CIntegration**** integration, CGeometry**** geometry, CSolver***** solver,
CNumerics****** numerics, CConfig** config, CSurfaceMovement** surface_movement,
CVolumetricMovement*** grid_movement, CFreeFormDefBox*** FFDBox, unsigned short val_iZone,
unsigned short val_iInst) override;
unsigned short val_iInst, bool CrossTerm) override;

/*!
* \brief Updates the containers for the discrete adjoint mean flow system.
Expand Down
2 changes: 1 addition & 1 deletion SU2_CFD/include/iteration/CDiscAdjFluidIteration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class CDiscAdjFluidIteration : public CIteration {
void Iterate(COutput* output, CIntegration**** integration, CGeometry**** geometry, CSolver***** solver,
CNumerics****** numerics, CConfig** config, CSurfaceMovement** surface_movement,
CVolumetricMovement*** grid_movement, CFreeFormDefBox*** FFDBox, unsigned short val_iZone,
unsigned short val_iInst) override;
unsigned short val_iInst, bool CrossTerm) override;

/*!
* \brief Updates the containers for the discrete adjoint fluid system.
Expand Down
2 changes: 1 addition & 1 deletion SU2_CFD/include/iteration/CDiscAdjHeatIteration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class CDiscAdjHeatIteration : public CIteration {
void Iterate(COutput* output, CIntegration**** integration, CGeometry**** geometry, CSolver***** solver,
CNumerics****** numerics, CConfig** config, CSurfaceMovement** surface_movement,
CVolumetricMovement*** grid_movement, CFreeFormDefBox*** FFDBox, unsigned short val_iZone,
unsigned short val_iInst) override;
unsigned short val_iInst, bool CrossTerm) override;

/*!
* \brief Perform a single iteration of the adjoint fluid system.
Expand Down
2 changes: 1 addition & 1 deletion SU2_CFD/include/iteration/CFEAIteration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class CFEAIteration : public CIteration {
void Iterate(COutput* output, CIntegration**** integration, CGeometry**** geometry, CSolver***** solver,
CNumerics****** numerics, CConfig** config, CSurfaceMovement** surface_movement,
CVolumetricMovement*** grid_movement, CFreeFormDefBox*** FFDBox, unsigned short val_iZone,
unsigned short val_iInst) override;
unsigned short val_iInst, bool CrossTerm) override;

/*!
* \brief Iterate the structural system for a number of Inner_Iter iterations.
Expand Down
2 changes: 1 addition & 1 deletion SU2_CFD/include/iteration/CFEMFluidIteration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class CFEMFluidIteration : public CFluidIteration {
void Iterate(COutput* output, CIntegration**** integration, CGeometry**** geometry, CSolver***** solver,
CNumerics****** numerics, CConfig** config, CSurfaceMovement** surface_movement,
CVolumetricMovement*** grid_movement, CFreeFormDefBox*** FFDBox, unsigned short val_iZone,
unsigned short val_iInst) override;
unsigned short val_iInst, bool CrossTerm) override;

/*!
* \brief Updates the containers for the finite element flow system.
Expand Down
2 changes: 1 addition & 1 deletion SU2_CFD/include/iteration/CFluidIteration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class CFluidIteration : public CIteration {
void Iterate(COutput* output, CIntegration**** integration, CGeometry**** geometry, CSolver***** solver,
CNumerics****** numerics, CConfig** config, CSurfaceMovement** surface_movement,
CVolumetricMovement*** grid_movement, CFreeFormDefBox*** FFDBox, unsigned short val_iZone,
unsigned short val_iInst) override;
unsigned short val_iInst, bool CrossTerm) override;

/*!
* \brief Iterate the fluid system for a number of Inner_Iter iterations.
Expand Down
2 changes: 1 addition & 1 deletion SU2_CFD/include/iteration/CHeatIteration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class CHeatIteration : public CFluidIteration {
void Iterate(COutput* output, CIntegration**** integration, CGeometry**** geometry, CSolver***** solver,
CNumerics****** numerics, CConfig** config, CSurfaceMovement** surface_movement,
CVolumetricMovement*** grid_movement, CFreeFormDefBox*** FFDBox, unsigned short val_iZone,
unsigned short val_iInst) override;
unsigned short val_iInst, bool CrossTerm) override;

/*!
* \brief Updates the containers for the heat system.
Expand Down
2 changes: 1 addition & 1 deletion SU2_CFD/include/iteration/CIteration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class CIteration {
virtual void Iterate(COutput* output, CIntegration**** integration, CGeometry**** geometry, CSolver***** solver,
CNumerics****** numerics, CConfig** config, CSurfaceMovement** surface_movement,
CVolumetricMovement*** grid_movement, CFreeFormDefBox*** FFDBox, unsigned short val_iZone,
unsigned short val_iInst){}
unsigned short val_iInst, bool CrossTerm){}

/*!
* \brief A virtual member.
Expand Down
3 changes: 2 additions & 1 deletion SU2_CFD/include/solvers/CDiscAdjSolver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,9 @@ class CDiscAdjSolver final : public CSolver {
* after tape has been evaluated.
* \param[in] geometry - The geometrical definition of the problem.
* \param[in] config - The particular config.
* \param[in] CrossTerm - Boolean to determine if this is a cross term extraction.
*/
void ExtractAdjoint_Solution(CGeometry *geometry, CConfig *config) override;
void ExtractAdjoint_Solution(CGeometry *geometry, CConfig *config, bool CrossTerm) override;

/*!
* \brief A virtual member.
Expand Down
6 changes: 5 additions & 1 deletion SU2_CFD/include/solvers/CFEASolver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,10 @@ class CFEASolver : public CSolver {
CNumerics *numerics,
const CConfig *config,
unsigned short val_marker) final;

void BC_Velocity(CGeometry *geometry,
CNumerics *numerics,
const CConfig *config,
unsigned short val_marker) final;
/*!
* \brief Iterate using an implicit Newmark solver.
* \param[in] geometry - Geometrical definition of the problem.
Expand Down Expand Up @@ -638,6 +641,7 @@ class CFEASolver : public CSolver {
* \param[in] config - Configuration of the problem.
*/
void PredictStruct_Displacement(CGeometry *geometry, CConfig *config) final;
void PredictStruct_Velocity(CGeometry *geometry, CConfig *config) final;

/*!
* \brief Computation of Aitken's coefficient.
Expand Down
2 changes: 1 addition & 1 deletion SU2_CFD/include/solvers/CFVMFlowSolverBase.inl
Original file line number Diff line number Diff line change
Expand Up @@ -1369,7 +1369,7 @@ void CFVMFlowSolverBase<V, FlowRegime>::Pressure_Forces(const CGeometry* geometr

RefTemp = Temperature_Inf;
RefDensity = Density_Inf;
if (dynamic_grid) {
if (dynamic_grid && !config->GetMultizone_Problem()) {
Mach2Vel = sqrt(Gamma * Gas_Constant * RefTemp);
Mach_Motion = config->GetMach_Motion();
RefVel2 = (Mach_Motion * Mach2Vel) * (Mach_Motion * Mach2Vel);
Expand Down
2 changes: 2 additions & 0 deletions SU2_CFD/include/solvers/CMeshSolver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ class CMeshSolver final : public CFEASolver {
* \param[in] config - Definition of the particular problem.
*/
void ComputeGridVelocity(CGeometry *geometry, CConfig *config);
void ComputeGridVelocity_FromBoundary(CGeometry **geometry, CNumerics **numerics, CConfig *config);

/*!
* \brief Update the coarse multigrid levels after the grid movement.
Expand All @@ -101,6 +102,7 @@ class CMeshSolver final : public CFEASolver {
* \param[in] config - Definition of the particular problem.
*/
void SetBoundaryDisplacements(CGeometry *geometry, CNumerics *numerics, CConfig *config);
void SetBoundaryVelocities(CGeometry *geometry, CNumerics *numerics, CConfig *config);

public:
/*!
Expand Down
15 changes: 15 additions & 0 deletions SU2_CFD/include/solvers/CSolver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -985,6 +985,10 @@ class CSolver {
CNumerics *numerics,
const CConfig *config,
unsigned short val_marker) { }
inline virtual void BC_Velocity(CGeometry *geometry,
CNumerics *numerics,
const CConfig *config,
unsigned short val_marker) { }

/*!
* \brief A virtual member.
Expand Down Expand Up @@ -3514,6 +3518,8 @@ class CSolver {
*/
inline virtual void PredictStruct_Displacement(CGeometry *geometry,
CConfig *config) { }
inline virtual void PredictStruct_Velocity(CGeometry *geometry,
CConfig *config) { }

/*!
* \brief A virtual member.
Expand Down Expand Up @@ -3775,6 +3781,15 @@ class CSolver {
* \param[in] config - The particular config.
*/
inline virtual void ExtractAdjoint_Solution(CGeometry *geometry, CConfig *config){}

/*!
* \brief A virtual member.
* \param[in] geometry - The geometrical definition of the problem.
* \param[in] solver_container - The solver container holding all solutions.
* \param[in] config - The particular config.
* \param[in] CrossTerm - Boolean to determine if this is a cross term extraction.
*/
inline virtual void ExtractAdjoint_Solution(CGeometry *geometry, CConfig *config, bool CrossTerm){}

/*!
* \brief A virtual member.
Expand Down
9 changes: 9 additions & 0 deletions SU2_CFD/include/variables/CDiscAdjFEABoundVariable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class CDiscAdjFEABoundVariable final : public CDiscAdjFEAVariable {
MatrixType FlowTraction_Sens; /*!< \brief Adjoint of the flow tractions. */
MatrixType SourceTerm_DispAdjoint; /*!< \brief Source term applied into the displacement
adjoint coming from external solvers. */
MatrixType SourceTerm_VelAdjoint;

CVertexMap<unsigned> VertexMap; /*!< \brief Object that controls accesses to the variables of this class. */

Expand Down Expand Up @@ -101,6 +102,10 @@ class CDiscAdjFEABoundVariable final : public CDiscAdjFEAVariable {
if (!VertexMap.GetVertexIndex(iPoint)) return;
SourceTerm_DispAdjoint(iPoint,iDim) = val;
}
inline void SetSourceTerm_VelAdjoint(unsigned long iPoint, unsigned long iDim, su2double val) override {
if (!VertexMap.GetVertexIndex(iPoint)) return;
SourceTerm_VelAdjoint(iPoint,iDim) = val;
}

/*!
* \brief Get the source term applied into the displacement adjoint coming from external solvers
Expand All @@ -111,6 +116,10 @@ class CDiscAdjFEABoundVariable final : public CDiscAdjFEAVariable {
if (!VertexMap.GetVertexIndex(iPoint)) return 0.0;
return SourceTerm_DispAdjoint(iPoint,iDim);
}
inline su2double GetSourceTerm_VelAdjoint(unsigned long iPoint, unsigned long iDim) const override {
if (!VertexMap.GetVertexIndex(iPoint)) return 0.0;
return SourceTerm_VelAdjoint(iPoint,iDim);
}

/*!
* \brief Get whether a node is on the boundary
Expand Down
Loading